artemis_framework 0.2.0__tar.gz → 0.2.3__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.
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/PKG-INFO +2 -1
- artemis_framework-0.2.3/artemis_framework/asphodel/core/_gpg_binary.py +33 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/gpg_context.py +7 -0
- artemis_framework-0.2.3/artemis_framework/asphodel/core/macos_shim.py +83 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/pyproject.toml +2 -1
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/LICENSE +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/README.md +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/__init__.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/__main__.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/__init__.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/__init__.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/armor_binary.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/encrypt_decrypt.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/key_management.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/sign_verify.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/elysium/__ini +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/elysium/__init__.py +0 -0
- {artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/tartarus/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: artemis_framework
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A package for doing great things!
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Requires-Dist: python-gnupg (>=0.5.6,<0.6.0)
|
|
13
14
|
Description-Content-Type: text/markdown
|
|
14
15
|
|
|
15
16
|
# artemis_framework
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import platform
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_base_path():
|
|
8
|
+
if getattr(sys, "frozen", False):
|
|
9
|
+
return Path(sys._MEIPASS)
|
|
10
|
+
|
|
11
|
+
return Path(__file__).resolve().parent
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_gpg_binary():
|
|
15
|
+
system = platform.system()
|
|
16
|
+
|
|
17
|
+
if system == "Darwin":
|
|
18
|
+
from artemis_framework.asphodel.core.macos_shim import activate, bundled_gpg_binary
|
|
19
|
+
activate()
|
|
20
|
+
bundled = bundled_gpg_binary()
|
|
21
|
+
if bundled and bundled.exists():
|
|
22
|
+
return bundled
|
|
23
|
+
return Path("gpg")
|
|
24
|
+
|
|
25
|
+
base = get_base_path()
|
|
26
|
+
|
|
27
|
+
if system == "Windows":
|
|
28
|
+
return base / "bundled" / "windows" / "gnupg" / "bin" / "gpg.exe"
|
|
29
|
+
|
|
30
|
+
if system == "Linux":
|
|
31
|
+
return base / "bundled" / "linux" / "gpg"
|
|
32
|
+
|
|
33
|
+
raise RuntimeError(f"Unsupported OS: {system}")
|
{artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/gpg_context.py
RENAMED
|
@@ -28,6 +28,13 @@ def build_gpg(
|
|
|
28
28
|
raise RuntimeError(f"Cannot create GNUPGHOME at {home}: {exc}") from exc
|
|
29
29
|
|
|
30
30
|
try:
|
|
31
|
+
# gpg = gnupg.GPG(
|
|
32
|
+
# gnupghome=str(home),
|
|
33
|
+
# gpgbinary=binary,
|
|
34
|
+
# verbose=verbose,
|
|
35
|
+
# use_agent=use_agent,
|
|
36
|
+
# options=options or []
|
|
37
|
+
# )
|
|
31
38
|
gpg = gnupg.GPG(
|
|
32
39
|
gnupghome=str(home),
|
|
33
40
|
gpgbinary=binary,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import atexit
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
_PLACEHOLDER = Path("tmp/gnupg_shim")
|
|
10
|
+
_shim_active = False
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _bundle_macos_dir() -> Path | None:
|
|
14
|
+
import platform
|
|
15
|
+
if platform.system() != "Darwin":
|
|
16
|
+
return None
|
|
17
|
+
|
|
18
|
+
if getattr(sys, "frozen", False):
|
|
19
|
+
base = Path(sys._MEIPASS)
|
|
20
|
+
else:
|
|
21
|
+
base = Path(__file__).resolve().parent
|
|
22
|
+
|
|
23
|
+
candidate = base / "bundled" / "macos"
|
|
24
|
+
return candidate if candidate.exists() else None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def activate() -> bool:
|
|
28
|
+
global _shim_active
|
|
29
|
+
|
|
30
|
+
if _shim_active:
|
|
31
|
+
return True
|
|
32
|
+
|
|
33
|
+
bundle_dir = _bundle_macos_dir()
|
|
34
|
+
if bundle_dir is None:
|
|
35
|
+
return True
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
if _PLACEHOLDER.is_symlink():
|
|
39
|
+
current_target = Path(os.readlink(_PLACEHOLDER))
|
|
40
|
+
if current_target == bundle_dir:
|
|
41
|
+
_shim_active = True
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
_PLACEHOLDER.unlink()
|
|
45
|
+
|
|
46
|
+
elif _PLACEHOLDER.exists():
|
|
47
|
+
print(
|
|
48
|
+
f"[WARN] macos_shim: {_PLACEHOLDER} exists and is not a symlink. "
|
|
49
|
+
"Falling back to system GPG.",
|
|
50
|
+
file=sys.stderr
|
|
51
|
+
)
|
|
52
|
+
return False
|
|
53
|
+
|
|
54
|
+
_PLACEHOLDER.symlink_to(bundle_dir)
|
|
55
|
+
_shim_active = True
|
|
56
|
+
|
|
57
|
+
atexit.register(_deactivate)
|
|
58
|
+
return True
|
|
59
|
+
|
|
60
|
+
except OSError as exc:
|
|
61
|
+
print(f"[WARN] macos_shim: could not create shim: {exc}", file=sys.stderr)
|
|
62
|
+
return False
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _deactivate() -> None:
|
|
66
|
+
global _shim_active
|
|
67
|
+
try:
|
|
68
|
+
if _PLACEHOLDER.is_symlink():
|
|
69
|
+
target = Path(os.readlink(_PLACEHOLDER))
|
|
70
|
+
bundle_dir = _bundle_macos_dir()
|
|
71
|
+
if bundle_dir and target == bundle_dir:
|
|
72
|
+
_PLACEHOLDER.unlink()
|
|
73
|
+
|
|
74
|
+
except OSError:
|
|
75
|
+
pass
|
|
76
|
+
_shim_active = False
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def bundled_gpg_binary() -> Path | None:
|
|
80
|
+
if not _shim_active:
|
|
81
|
+
activate()
|
|
82
|
+
candidate = _PLACEHOLDER / "bin" / "gpg"
|
|
83
|
+
return candidate if candidate.exists() else None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "artemis_framework"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "A package for doing great things!"
|
|
5
5
|
authors = ["Dylan Garrett"]
|
|
6
6
|
license = "MIT"
|
|
@@ -8,6 +8,7 @@ readme = "README.md"
|
|
|
8
8
|
|
|
9
9
|
[tool.poetry.dependencies]
|
|
10
10
|
python = "^3.13"
|
|
11
|
+
python-gnupg = "^0.5.6"
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
[build-system]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/__init__.py
RENAMED
|
File without changes
|
{artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/armor_binary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{artemis_framework-0.2.0 → artemis_framework-0.2.3}/artemis_framework/asphodel/core/sign_verify.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|