blazerops 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.
blazerops/__init__.py ADDED
@@ -0,0 +1,48 @@
1
+ """blazerops — the importable client for the BlazerOps platform.
2
+
3
+ Two clients, one package:
4
+
5
+ - `BlazerOps` — the CONSUMER client for a published app, authenticated with an app-scoped
6
+ `blzk_` key (the Python counterpart of `@blazerops/sdk`):
7
+
8
+ from blazerops import BlazerOps
9
+ with BlazerOps() as bo: # $BLAZEROPS_API_KEY, $BLAZEROPS_BASE_URL
10
+ inv = bo.invoke("exam-answers", "stable", {"exam_pdf": Path("exam.pdf")},
11
+ subject="user-42")
12
+
13
+ - `Client` — the BUILDER client behind the `blazerops` CLI (`blazerops_cli`): the /v1
14
+ transport, the CLI login, the version handshake and the builder verbs (push, run).
15
+ """
16
+ # The version is single-sourced from the installed package metadata (which
17
+ # setuptools-scm derives from the git tag), so the tag, the wheel, and
18
+ # `blazerops --version` can never disagree. Running from an uninstalled source
19
+ # checkout (no metadata) falls back rather than crashing.
20
+ from importlib.metadata import PackageNotFoundError, version as _pkg_version
21
+
22
+ try:
23
+ __version__ = _pkg_version("blazerops")
24
+ except PackageNotFoundError: # source checkout without an install
25
+ __version__ = "0.0.0+unknown"
26
+
27
+ from .api import ApiError, Client, SkewError, api_url # noqa: E402 (needs __version__)
28
+ from .apps import BlazerOps, File, Invocation, Upload, invoke # noqa: E402
29
+ from .credentials import CredentialError # noqa: E402
30
+ from .errors import ( # noqa: E402
31
+ AuthError,
32
+ BlazerOpsError,
33
+ ConflictError,
34
+ FailedError,
35
+ NetworkError,
36
+ NotFoundError,
37
+ QuotaError,
38
+ RateLimitError,
39
+ RefusedError,
40
+ TimeoutError,
41
+ )
42
+
43
+ __all__ = [
44
+ "ApiError", "AuthError", "BlazerOps", "BlazerOpsError", "Client", "ConflictError",
45
+ "CredentialError", "FailedError", "File", "Invocation", "NetworkError", "NotFoundError",
46
+ "QuotaError", "RateLimitError", "RefusedError", "SkewError", "TimeoutError", "Upload",
47
+ "__version__", "api_url", "invoke",
48
+ ]