ream-artifacts 0.1.0__py3-none-any.whl
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.
- artifacts/__init__.py +91 -0
- artifacts/py.typed +0 -0
- ream/__init__.py +0 -0
- ream/admin.py +698 -0
- ream/anchors.py +672 -0
- ream/api.py +3779 -0
- ream/app.py +332 -0
- ream/brand/rooted-lg-dk.svg +12 -0
- ream/brand/rooted-lg-lt.svg +12 -0
- ream/brand/rooted-lg-mono.svg +12 -0
- ream/brand/rooted-sm-dk.svg +11 -0
- ream/brand/rooted-sm-lt.svg +11 -0
- ream/brand/rooted-sm-mono.svg +11 -0
- ream/cli.py +185 -0
- ream/client.py +2574 -0
- ream/clientlevel.py +46 -0
- ream/comments.py +2073 -0
- ream/connect.py +347 -0
- ream/connect_cli.py +222 -0
- ream/content.py +1322 -0
- ream/csp.py +234 -0
- ream/db.py +1190 -0
- ream/decide.py +2727 -0
- ream/decisions.py +2901 -0
- ream/design.py +196 -0
- ream/email_share.py +202 -0
- ream/envnames.py +51 -0
- ream/events.py +694 -0
- ream/folders.py +252 -0
- ream/formanswer.py +537 -0
- ream/formrecord.py +313 -0
- ream/forms.py +830 -0
- ream/forms_ui.py +396 -0
- ream/frame_pass.py +106 -0
- ream/gallery.py +7769 -0
- ream/ggscan.py +243 -0
- ream/grants.py +90 -0
- ream/holds.py +175 -0
- ream/hosts.py +103 -0
- ream/idempotency.py +110 -0
- ream/ids.py +7 -0
- ream/image_store.py +343 -0
- ream/images.py +439 -0
- ream/inbox.py +246 -0
- ream/keys.py +373 -0
- ream/listening.py +373 -0
- ream/logo.py +56 -0
- ream/mail.py +119 -0
- ream/maintenance.py +158 -0
- ream/markdown.py +165 -0
- ream/mcp.py +1193 -0
- ream/mcp_apps.py +371 -0
- ream/mcp_clients.py +508 -0
- ream/mcp_headers.py +108 -0
- ream/mcp_tools.py +1220 -0
- ream/migrate.py +515 -0
- ream/news.py +295 -0
- ream/nudge.py +251 -0
- ream/oauth.py +803 -0
- ream/oidc.py +555 -0
- ream/onboarding.py +1142 -0
- ream/owner.py +132 -0
- ream/packing.py +124 -0
- ream/pagediff.py +1257 -0
- ream/partner.py +680 -0
- ream/partner_in.py +977 -0
- ream/pickup.py +10 -0
- ream/plugin_api.py +547 -0
- ream/plugin_cli.py +414 -0
- ream/py.typed +0 -0
- ream/ratelimit.py +137 -0
- ream/reach.py +75 -0
- ream/receipts.py +332 -0
- ream/rename.py +343 -0
- ream/repack.py +224 -0
- ream/republish.py +250 -0
- ream/review.py +213 -0
- ream/scan.py +924 -0
- ream/scanners.py +183 -0
- ream/schema.sql +1329 -0
- ream/schema_sqlite.sql +287 -0
- ream/secret_shapes.txt +129 -0
- ream/sections.py +679 -0
- ream/selfupdate.py +721 -0
- ream/serve.py +196 -0
- ream/settings.py +719 -0
- ream/sinks.py +716 -0
- ream/stamp.py +92 -0
- ream/store.py +3000 -0
- ream/templates/_shared.css +136 -0
- ream/templates/comparison.html +299 -0
- ream/templates/decision-request.html +309 -0
- ream/templates/design.html +329 -0
- ream/templates/explainer.html +323 -0
- ream/templates/implementation-plan.html +288 -0
- ream/templates/incident.html +321 -0
- ream/templates/intent.html +354 -0
- ream/templates/project-status.html +328 -0
- ream/templates.py +127 -0
- ream/text.py +335 -0
- ream/textvars.py +281 -0
- ream/thumbs.py +496 -0
- ream/traps.py +229 -0
- ream/webhook.py +513 -0
- ream_artifacts-0.1.0.dist-info/METADATA +137 -0
- ream_artifacts-0.1.0.dist-info/RECORD +108 -0
- ream_artifacts-0.1.0.dist-info/WHEEL +4 -0
- ream_artifacts-0.1.0.dist-info/entry_points.txt +8 -0
artifacts/__init__.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""The old import name, kept for good: `import artifacts` is `import ream`.
|
|
2
|
+
|
|
3
|
+
The package was renamed to `ream` (docs/decisions.md, "Ream inside the code too"). Callers
|
|
4
|
+
outside this repository still write `import artifacts`, `from artifacts.settings import ...`,
|
|
5
|
+
`artifacts.plugin_api`, or name `artifacts.client:run` as an entry point, and all of it keeps
|
|
6
|
+
working. Nothing here is a copy:
|
|
7
|
+
|
|
8
|
+
* `artifacts` itself becomes the `ream` module object (so `resources.files("artifacts")` finds
|
|
9
|
+
the schema and the templates in `ream`);
|
|
10
|
+
* `artifacts.X` is the SAME module object as `ream.X`, found by the finder below, so
|
|
11
|
+
`settings.override(...)` or a monkeypatch through either name acts on one module, never on
|
|
12
|
+
two copies that each hold their own state.
|
|
13
|
+
|
|
14
|
+
This file reads no environment and holds no logic of the service.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import importlib
|
|
18
|
+
import importlib.abc
|
|
19
|
+
import importlib.util
|
|
20
|
+
import sys
|
|
21
|
+
from importlib.machinery import ModuleSpec
|
|
22
|
+
|
|
23
|
+
import ream
|
|
24
|
+
|
|
25
|
+
_OLD = "artifacts"
|
|
26
|
+
_NEW = "ream"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class _AliasFinder(importlib.abc.MetaPathFinder, importlib.abc.Loader):
|
|
30
|
+
"""Answers `artifacts.<x>` with the already-imported `ream.<x>`."""
|
|
31
|
+
|
|
32
|
+
def __init__(self) -> None:
|
|
33
|
+
self._real_specs: dict[str, ModuleSpec] = {}
|
|
34
|
+
|
|
35
|
+
def find_spec(self, fullname, path=None, target=None) -> ModuleSpec | None:
|
|
36
|
+
if not fullname.startswith(_OLD + "."):
|
|
37
|
+
return None
|
|
38
|
+
real = _NEW + fullname[len(_OLD) :]
|
|
39
|
+
try:
|
|
40
|
+
found = importlib.util.find_spec(real)
|
|
41
|
+
except ModuleNotFoundError:
|
|
42
|
+
return None
|
|
43
|
+
if found is None:
|
|
44
|
+
return None
|
|
45
|
+
self._real_spec(fullname)
|
|
46
|
+
return importlib.util.spec_from_loader(fullname, self)
|
|
47
|
+
|
|
48
|
+
def create_module(self, spec: ModuleSpec):
|
|
49
|
+
return importlib.import_module(_NEW + spec.name[len(_OLD) :])
|
|
50
|
+
|
|
51
|
+
def _real_spec(self, fullname: str) -> ModuleSpec | None:
|
|
52
|
+
"""The spec `ream.<x>` was really imported with. Once `artifacts.<x>` has been
|
|
53
|
+
imported the import system overwrites `module.__spec__` with the alias spec, so
|
|
54
|
+
the first real one seen is kept."""
|
|
55
|
+
real = _NEW + fullname[len(_OLD) :]
|
|
56
|
+
if real not in self._real_specs:
|
|
57
|
+
found = importlib.util.find_spec(real)
|
|
58
|
+
if found is None or found.name != real:
|
|
59
|
+
return found
|
|
60
|
+
self._real_specs[real] = found
|
|
61
|
+
return self._real_specs[real]
|
|
62
|
+
|
|
63
|
+
def exec_module(self, module) -> None:
|
|
64
|
+
"""Nothing to run: the module was executed under its real name. The import
|
|
65
|
+
system has just set `module.__spec__` to the alias spec; put the real one back."""
|
|
66
|
+
real = self._real_spec(_OLD + module.__name__[len(_NEW) :])
|
|
67
|
+
if real is not None:
|
|
68
|
+
module.__spec__ = real
|
|
69
|
+
|
|
70
|
+
def _real_loader(self, fullname: str):
|
|
71
|
+
real = self._real_spec(fullname)
|
|
72
|
+
if real is None or real.loader is None:
|
|
73
|
+
raise ImportError(f"no loader for {fullname}", name=fullname)
|
|
74
|
+
return real.loader
|
|
75
|
+
|
|
76
|
+
# `python -m artifacts.<x>` (runpy) asks the alias spec's loader for the code.
|
|
77
|
+
def get_code(self, fullname: str):
|
|
78
|
+
return self._real_loader(fullname).get_code(_NEW + fullname[len(_OLD) :])
|
|
79
|
+
|
|
80
|
+
def get_source(self, fullname: str):
|
|
81
|
+
return self._real_loader(fullname).get_source(_NEW + fullname[len(_OLD) :])
|
|
82
|
+
|
|
83
|
+
def is_package(self, fullname: str) -> bool:
|
|
84
|
+
return self._real_loader(fullname).is_package(_NEW + fullname[len(_OLD) :])
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if not any(isinstance(f, _AliasFinder) for f in sys.meta_path):
|
|
88
|
+
sys.meta_path.insert(0, _AliasFinder())
|
|
89
|
+
|
|
90
|
+
# `import artifacts` hands back the ream package itself.
|
|
91
|
+
sys.modules[__name__] = ream
|
artifacts/py.typed
ADDED
|
File without changes
|
ream/__init__.py
ADDED
|
File without changes
|