isolate 0.13.9__tar.gz → 0.13.10__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.
Potentially problematic release.
This version of isolate might be problematic. Click here for more details.
- {isolate-0.13.9 → isolate-0.13.10}/PKG-INFO +1 -1
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/_isolate_version.py +2 -2
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/logger.py +14 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/PKG-INFO +1 -1
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/SOURCES.txt +1 -0
- isolate-0.13.10/tests/test_logger.py +22 -0
- {isolate-0.13.9 → isolate-0.13.10}/.github/workflows/release.yml +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/.github/workflows/test.yml +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/.gitignore +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/.pre-commit-config.yaml +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/LICENSE +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/README.md +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/pyproject.toml +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/setup.cfg +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/_version.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/_base.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/common.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/conda.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/container.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/local.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/pyenv.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/remote.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/settings.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/backends/virtualenv.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/common/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/common/timestamp.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/_local/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/_local/_base.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/_local/agent_startup.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/common.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/_base.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/agent.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/configuration.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/agent.proto +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/agent_pb2.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/agent_pb2.pyi +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/agent_pb2_grpc.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/common.proto +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/common_pb2.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/common_pb2.pyi +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/common_pb2_grpc.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/interface.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/ipc/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/ipc/_base.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/ipc/agent.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/logs.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/py.typed +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/registry.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/definitions/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/definitions/server.proto +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/definitions/server_pb2.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/definitions/server_pb2.pyi +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/definitions/server_pb2_grpc.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health/health.proto +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health/health_pb2.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health/health_pb2.pyi +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health/health_pb2_grpc.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/health_server.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/interface.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate/server/server.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/dependency_links.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/entry_points.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/requires.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/src/isolate.egg-info/top_level.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/__init__.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/conftest.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_backends.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_concurrency.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_connections.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_isolate.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_log.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_serialization.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tests/test_server.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/Dockerfile +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/agent_requirements.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/protobuf-requirements.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/regen_grpc.py +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/requirements.txt +0 -0
- {isolate-0.13.9 → isolate-0.13.10}/tools/test_agent_requirements.txt +0 -0
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
# NOTE: we probably should've created a proper `logging.getLogger` here,
|
|
5
6
|
# but it handling `source` would be not trivial, so we are better off
|
|
6
7
|
# just keeping it simple for now.
|
|
7
8
|
class IsolateLogger:
|
|
9
|
+
def __init__(self):
|
|
10
|
+
self.log_labels = {}
|
|
11
|
+
raw = os.getenv("ISOLATE_LOG_LABELS")
|
|
12
|
+
if raw:
|
|
13
|
+
labels = json.loads(raw)
|
|
14
|
+
for key, value in labels.items():
|
|
15
|
+
if value.startswith("$"):
|
|
16
|
+
expanded = os.getenv(value[1:])
|
|
17
|
+
else:
|
|
18
|
+
expanded = value
|
|
19
|
+
self.log_labels[key] = expanded
|
|
20
|
+
|
|
8
21
|
def log(self, level, message, source):
|
|
9
22
|
record = {
|
|
10
23
|
"isolate_source": source.name,
|
|
11
24
|
"level": level.name,
|
|
12
25
|
"message": message,
|
|
26
|
+
**self.log_labels,
|
|
13
27
|
}
|
|
14
28
|
print(json.dumps(record))
|
|
15
29
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from isolate.logger import IsolateLogger
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_logger(monkeypatch):
|
|
7
|
+
labels = {
|
|
8
|
+
"foo": "$MYENVVAR1",
|
|
9
|
+
"bar": "$MYENVVAR2",
|
|
10
|
+
"baz": "baz",
|
|
11
|
+
"qux": "qux",
|
|
12
|
+
}
|
|
13
|
+
monkeypatch.setenv("MYENVVAR1", "myenvvar1")
|
|
14
|
+
monkeypatch.setenv("MYENVVAR2", "myenvvar2")
|
|
15
|
+
monkeypatch.setenv("ISOLATE_LOG_LABELS", json.dumps(labels))
|
|
16
|
+
logger = IsolateLogger()
|
|
17
|
+
assert logger.log_labels == {
|
|
18
|
+
"foo": "myenvvar1",
|
|
19
|
+
"bar": "myenvvar2",
|
|
20
|
+
"baz": "baz",
|
|
21
|
+
"qux": "qux",
|
|
22
|
+
}
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/agent_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{isolate-0.13.9 → isolate-0.13.10}/src/isolate/connections/grpc/definitions/common_pb2_grpc.py
RENAMED
|
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
|
|
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
|
|
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
|