polyswarm-engine 3.2.0__tar.gz → 3.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/PKG-INFO +3 -2
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/__init__.py +1 -1
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/backend.py +13 -6
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/bidutils.py +15 -1
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/settings.py +4 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/PKG-INFO +3 -2
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/requires.txt +3 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/pyproject.toml +25 -3
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/tests/test_bounty.py +5 -1
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/README.md +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/bounty.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/celeryconfig.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/cli.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/command.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/constants.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/engine.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/exceptions.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/log_config.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/py.typed +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/typing.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/utils.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/wine.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine/wsgi.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/SOURCES.txt +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/dependency_links.txt +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/top_level.txt +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/setup.cfg +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/tests/test_bidutils.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/tests/test_engine.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/tests/test_utils.py +0 -0
- {polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/tests/test_wine.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyswarm_engine
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.1
|
|
4
4
|
Summary: Polyswarm engine libarary
|
|
5
5
|
Author-email: Polyswarm Developers <developers@polyswarm.io>
|
|
6
6
|
Project-URL: Homepage, https://github.com/polyswarm/polyswarm_engine
|
|
7
|
-
Requires-Python: <4,>=3.
|
|
7
|
+
Requires-Python: <4,>=3.8
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
Requires-Dist: celery
|
|
10
10
|
Requires-Dist: click
|
|
@@ -12,6 +12,7 @@ Requires-Dist: click-log
|
|
|
12
12
|
Requires-Dist: python-json-logger
|
|
13
13
|
Requires-Dist: requests
|
|
14
14
|
Provides-Extra: tests
|
|
15
|
+
Requires-Dist: pathlib3x; python_version < "3.10" and extra == "tests"
|
|
15
16
|
Requires-Dist: flake8; extra == "tests"
|
|
16
17
|
Requires-Dist: isort; extra == "tests"
|
|
17
18
|
Requires-Dist: mypy; extra == "tests"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
import contextlib
|
|
2
3
|
import logging
|
|
3
4
|
import typing as t
|
|
@@ -9,7 +10,12 @@ import celery
|
|
|
9
10
|
|
|
10
11
|
from polyswarm_engine import exceptions
|
|
11
12
|
from polyswarm_engine.bounty import get_bounty_expiration, get_bounty_tasked_at, CANNOT_FETCH
|
|
12
|
-
from polyswarm_engine.settings import
|
|
13
|
+
from polyswarm_engine.settings import (
|
|
14
|
+
PSENGINE_METADATA_ARCHTECTURE,
|
|
15
|
+
PSENGINE_METADATA_OS,
|
|
16
|
+
PSENGINE_DELIVERY_TASK,
|
|
17
|
+
PSENGINE_DISCARD_EXPIRED_BOUNTIES,
|
|
18
|
+
)
|
|
13
19
|
from polyswarm_engine.constants import (
|
|
14
20
|
BENIGN,
|
|
15
21
|
MALICIOUS,
|
|
@@ -245,11 +251,12 @@ class CeleryBackend:
|
|
|
245
251
|
expiration = get_bounty_expiration(bounty)
|
|
246
252
|
processing_start = datetime.now(timezone.utc)
|
|
247
253
|
if processing_start > expiration:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
254
|
+
if PSENGINE_DISCARD_EXPIRED_BOUNTIES.upper() in ('1', 'YES', 'TRUE'):
|
|
255
|
+
raise exceptions.EngineTimeoutError(
|
|
256
|
+
'Current time %s is past expiration time %s',
|
|
257
|
+
processing_start.isoformat(),
|
|
258
|
+
expiration.isoformat(),
|
|
259
|
+
)
|
|
253
260
|
|
|
254
261
|
try:
|
|
255
262
|
result = self._analyze(bounty)
|
|
@@ -44,7 +44,21 @@ def rescale_to_bid(bounty: 'Bounty', value: 't.SupportsInt', min=0, max=100) ->
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def dni_to_bid(bounty: 'Bounty', value: str) -> 'Bid':
|
|
47
|
-
"""Transform string value from the None / Low / Med / High scale to a bid
|
|
47
|
+
"""Transform string value from the None / Low / Med / High scale to a bid
|
|
48
|
+
|
|
49
|
+
From: https://www.dni.gov/files/documents/ICD/ICD_203_TA_Analytic_Standards_21_Dec_2022.pdf
|
|
50
|
+
|
|
51
|
+
| DNI Scale | Polyswarm Bid |
|
|
52
|
+
|-----------------------------------------+---------------|
|
|
53
|
+
| Not Specified | Not Specified |
|
|
54
|
+
| Almost No Chance / Remote | 5 |
|
|
55
|
+
| Very Unlikely / Highly Improbable | 15 |
|
|
56
|
+
| Unlikely / Improbable | 30 |
|
|
57
|
+
| Roughly Even Chance / Roughly Even Odds | 50 |
|
|
58
|
+
| Likely / Probable | 70 |
|
|
59
|
+
| Very Likely / Highly Probable | 85 |
|
|
60
|
+
| Almost Certain / Nearly Certain | 95 |to appropriate bid amounts.
|
|
61
|
+
"""
|
|
48
62
|
value = value.lower()
|
|
49
63
|
|
|
50
64
|
if value == "none":
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
import os
|
|
2
3
|
import platform
|
|
3
4
|
import shutil
|
|
@@ -39,3 +40,6 @@ PSENGINE_TASK_ALWAYS_EAGER: bool = bool(int(os.getenv('PSENGINE_TASK_ALWAYS_EAGE
|
|
|
39
40
|
#: Name of the Celery task that processes the delivery of assertions and votes.
|
|
40
41
|
# If empty, fallback to doing the delivery directly via HTTP
|
|
41
42
|
PSENGINE_DELIVERY_TASK = os.getenv('PSENGINE_DELIVERY_TASK', '')
|
|
43
|
+
|
|
44
|
+
#: Turn on (set as 1) to discard bounties arrived after the expiration.
|
|
45
|
+
PSENGINE_DISCARD_EXPIRED_BOUNTIES = os.getenv('PSENGINE_DISCARD_EXPIRED_BOUNTIES', '')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyswarm_engine
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.1
|
|
4
4
|
Summary: Polyswarm engine libarary
|
|
5
5
|
Author-email: Polyswarm Developers <developers@polyswarm.io>
|
|
6
6
|
Project-URL: Homepage, https://github.com/polyswarm/polyswarm_engine
|
|
7
|
-
Requires-Python: <4,>=3.
|
|
7
|
+
Requires-Python: <4,>=3.8
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
Requires-Dist: celery
|
|
10
10
|
Requires-Dist: click
|
|
@@ -12,6 +12,7 @@ Requires-Dist: click-log
|
|
|
12
12
|
Requires-Dist: python-json-logger
|
|
13
13
|
Requires-Dist: requests
|
|
14
14
|
Provides-Extra: tests
|
|
15
|
+
Requires-Dist: pathlib3x; python_version < "3.10" and extra == "tests"
|
|
15
16
|
Requires-Dist: flake8; extra == "tests"
|
|
16
17
|
Requires-Dist: isort; extra == "tests"
|
|
17
18
|
Requires-Dist: mypy; extra == "tests"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=70"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "polyswarm_engine"
|
|
7
|
-
version = "3.2.
|
|
7
|
+
version = "3.2.1"
|
|
8
8
|
description = "Polyswarm engine libarary"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
11
11
|
{name = "Polyswarm Developers", email = "developers@polyswarm.io"},
|
|
12
12
|
]
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.8,<4"
|
|
14
14
|
dependencies = [
|
|
15
15
|
"celery",
|
|
16
16
|
"click",
|
|
@@ -24,6 +24,7 @@ Homepage = "https://github.com/polyswarm/polyswarm_engine"
|
|
|
24
24
|
|
|
25
25
|
[project.optional-dependencies]
|
|
26
26
|
tests = [
|
|
27
|
+
"pathlib3x; python_version < '3.10'",
|
|
27
28
|
"flake8",
|
|
28
29
|
"isort",
|
|
29
30
|
"mypy",
|
|
@@ -98,3 +99,24 @@ split_before_dot = "true"
|
|
|
98
99
|
|
|
99
100
|
[tool.setuptools]
|
|
100
101
|
include-package-data = false
|
|
102
|
+
|
|
103
|
+
[tool.bumpversion]
|
|
104
|
+
current_version = "3.2.1"
|
|
105
|
+
commit = true
|
|
106
|
+
tag = false
|
|
107
|
+
sign_tags = true
|
|
108
|
+
tag_name = "{new_version}"
|
|
109
|
+
parse = '^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:\.dev(?P<dev>\d+))?(?:\+(?P<local>[a-z0-9]+(?:\.[a-z0-9]+)*))?$'
|
|
110
|
+
serialize = [
|
|
111
|
+
"{major}.{minor}.{patch}.dev{dev}+{short_commit_sha}",
|
|
112
|
+
"{major}.{minor}.{patch}"
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[tool.bumpversion.parts.dev]
|
|
116
|
+
first_value = "0"
|
|
117
|
+
optional_value = "0"
|
|
118
|
+
|
|
119
|
+
[[tool.bumpversion.files]]
|
|
120
|
+
filename = "polyswarm_engine/__init__.py"
|
|
121
|
+
search = "__VERSION__ = '{current_version}'"
|
|
122
|
+
replace = "__VERSION__ = '{new_version}'"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyswarm_engine-3.2.0 → polyswarm_engine-3.2.1}/polyswarm_engine.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|