pycarta 0.3.11.dev5__tar.gz → 0.3.12__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.
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/.gitlab-ci.yml +1 -1
- pycarta-0.3.12/CHANGELOG.rst +160 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/CONTRIBUTING.rst +42 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/MANIFEST.in +2 -1
- {pycarta-0.3.11.dev5/src/pycarta.egg-info → pycarta-0.3.12}/PKG-INFO +2 -2
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/setup.cfg +8 -2
- pycarta-0.3.12/src/pycarta/__init__.py +595 -0
- pycarta-0.3.12/src/pycarta/__init__.pyi +129 -0
- pycarta-0.3.12/src/pycarta/admin/_error_markers.py +40 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/file.py +16 -7
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/group.py +10 -6
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/permission.py +4 -1
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/user.py +73 -15
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/advanced.py +94 -24
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/auth.py +3 -3
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/permission.py +14 -11
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/resource.py +6 -6
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/workspace.py +7 -3
- pycarta-0.3.12/src/pycarta/auth/__init__.py +148 -0
- pycarta-0.3.12/src/pycarta/auth/_http_compat.py +282 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/agent.py +330 -128
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/profile.py +42 -42
- pycarta-0.3.12/src/pycarta/formsdb/__init__.py +303 -0
- pycarta-0.3.12/src/pycarta/formsdb/_helpers.py +34 -0
- pycarta-0.3.12/src/pycarta/formsdb/admin.py +28 -0
- pycarta-0.3.12/src/pycarta/formsdb/aio/__init__.py +40 -0
- pycarta-0.3.12/src/pycarta/formsdb/aio/admin.py +16 -0
- pycarta-0.3.12/src/pycarta/formsdb/aio/data.py +71 -0
- pycarta-0.3.12/src/pycarta/formsdb/aio/folders.py +36 -0
- pycarta-0.3.12/src/pycarta/formsdb/aio/schema.py +76 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/formsdb/concurrent.py +63 -18
- pycarta-0.3.12/src/pycarta/formsdb/data.py +148 -0
- pycarta-0.3.12/src/pycarta/formsdb/folders.py +63 -0
- pycarta-0.3.12/src/pycarta/formsdb/query.py +211 -0
- pycarta-0.3.12/src/pycarta/formsdb/schema.py +121 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/formsdb/types.py +61 -4
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/__init__.py +1 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/file.py +102 -43
- pycarta-0.3.12/src/pycarta/fs/reference.py +45 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/util.py +19 -13
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/vertex/types.py +8 -4
- pycarta-0.3.12/src/pycarta/py.typed +0 -0
- pycarta-0.3.12/src/pycarta/sbg/__init__.py +11 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/services/proxy.py +19 -35
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/services/server.py +3 -3
- {pycarta-0.3.11.dev5 → pycarta-0.3.12/src/pycarta.egg-info}/PKG-INFO +2 -2
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta.egg-info/SOURCES.txt +16 -0
- pycarta-0.3.11.dev5/CHANGELOG.rst +0 -3
- pycarta-0.3.11.dev5/src/pycarta/__init__.py +0 -354
- pycarta-0.3.11.dev5/src/pycarta/auth/__init__.py +0 -77
- pycarta-0.3.11.dev5/src/pycarta/formsdb/__init__.py +0 -414
- pycarta-0.3.11.dev5/src/pycarta/sbg/__init__.py +0 -11
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/.gitignore +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/.readthedocs.yml +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/AUTHORS.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/LICENSE.txt +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/README.md +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/README.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/Makefile +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/_static/.gitignore +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/authors.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/changelog.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/conf.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/contributing.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/data-management.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/00_index.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/01_authentication.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/02_admin.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/03_services.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/04_mqtt.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/05_data_management.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/06_seven_bridges.ipynb +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/examples/README.md +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/index.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/installation.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/license.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/mqtt.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/quickstart.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/requirements.txt +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/docs/services.rst +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/pyproject.toml +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/setup.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/_compat.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/project.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/secret.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/service.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/connection.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/document_history.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/file.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/group.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/item.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/namespace.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/permission_entity.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/permissions.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/project.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/resource_type.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/service.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/user.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/util.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/types/workspace.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/_helpers.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/aio/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/aio/apitoken.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/aio/auth.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/aio/permission.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/aio/resource.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/apitoken.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/compat.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/exceptions.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/admin/v2/types.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/config.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/dialogs/carta_login.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/ui.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/auth/weblogin.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/exceptions.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/configuration.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/consts.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/multipart_upload.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/types/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/types/configuration.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/types/exception.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/fs/types/file.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/algorithms.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/graph.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/iterator.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/vertex/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/vertex/util.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/visitor/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/graph/visitor/base.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/client.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/connection.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/credentials.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/exceptions.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/formatter.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/publisher.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/mqtt/subscriber.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/sbg/base.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/sbg/login.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/sbg/project.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/services/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/__init__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/__main__.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/core.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/io.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/melt.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/tablify.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/types.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta/tablify/utils.py +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta.egg-info/dependency_links.txt +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta.egg-info/not-zip-safe +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta.egg-info/requires.txt +1 -1
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/src/pycarta.egg-info/top_level.txt +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/static/brand.png +0 -0
- {pycarta-0.3.11.dev5 → pycarta-0.3.12}/tox.ini +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
=========
|
|
2
|
+
Changelog
|
|
3
|
+
=========
|
|
4
|
+
|
|
5
|
+
v2.2 — Performance Improvements (Unreleased)
|
|
6
|
+
=============================================
|
|
7
|
+
|
|
8
|
+
Behavior changes
|
|
9
|
+
----------------
|
|
10
|
+
|
|
11
|
+
- **TYPE-01 / D-01** — ``Profile`` (``pycarta.Profile``, ``pycarta.auth.Profile``)
|
|
12
|
+
has been converted from a pydantic ``BaseModel`` to a stdlib
|
|
13
|
+
``@dataclass(slots=True)``. This change removes pydantic from the core auth
|
|
14
|
+
import path and introduces strict fail-fast behavior on unknown
|
|
15
|
+
``profiles.ini`` keys.
|
|
16
|
+
|
|
17
|
+
**Fail-fast on unknown ini keys (D-01):** constructing ``Profile`` with a
|
|
18
|
+
keyword argument not in its declared field set — including keys inherited from
|
|
19
|
+
the ``[DEFAULT]`` section, which ``configparser`` propagates into every section
|
|
20
|
+
— now raises ``TypeError`` at the call site (``config.py``
|
|
21
|
+
``get_profile`` → ``Profile(**section, profile_name=...)``). Previously,
|
|
22
|
+
pydantic silently dropped unknown fields. This surfaces config drift loudly
|
|
23
|
+
rather than producing a partially-populated ``Profile``.
|
|
24
|
+
|
|
25
|
+
**Public-surface narrowing (declared non-contractual):** ``Profile`` is
|
|
26
|
+
publicly exported from ``pycarta`` and ``pycarta.auth``. Dropping pydantic
|
|
27
|
+
``BaseModel`` as the base class removes pydantic-provided surface that pycarta
|
|
28
|
+
itself never used:
|
|
29
|
+
|
|
30
|
+
- ``.model_dump()`` / ``.model_validate()`` — removed (pycarta never
|
|
31
|
+
serialized ``Profile``; consumers who used these methods must migrate to
|
|
32
|
+
direct attribute access or construct from a ``dict`` explicitly).
|
|
33
|
+
- Constructor type-coercion — removed (pydantic silently coerced non-string
|
|
34
|
+
values; the dataclass constructor now accepts values as-is, which matches
|
|
35
|
+
the ``configparser`` string-only source).
|
|
36
|
+
- Pydantic ``__eq__`` and ``__repr__`` — replaced by dataclass equivalents
|
|
37
|
+
(field-by-field equality and repr; functionally equivalent for typical
|
|
38
|
+
use).
|
|
39
|
+
|
|
40
|
+
**Preserved surface (no change):** attribute access on all six fields
|
|
41
|
+
(``username``, ``environment``, ``password``, ``token``, ``aws_profile``,
|
|
42
|
+
``profile_name``), construction by keyword, and all three methods
|
|
43
|
+
(``is_production()``, ``invalidate_token()``, ``set_token(token)``).
|
|
44
|
+
Method return values and semantics are unchanged — ``is_production()``
|
|
45
|
+
still returns ``None`` (not ``False``) when ``environment`` is ``None``;
|
|
46
|
+
``invalidate_token()`` still returns the result of
|
|
47
|
+
``self.username and self.password`` (a ``str | None``, not a strict
|
|
48
|
+
``bool``).
|
|
49
|
+
|
|
50
|
+
- **DEFER-03 / COMPAT-02** — ``CartaAgent`` boto3 ``Session`` construction and
|
|
51
|
+
AWS credential evaluation are now deferred to the first AWS/Cognito call
|
|
52
|
+
(previously occurred at ``CartaAgent(...)`` construction time). A missing
|
|
53
|
+
credentials file, invalid AWS profile, or boto3 import error now surfaces at
|
|
54
|
+
the first AWS-backed call (e.g. username/password authentication, or
|
|
55
|
+
``reset_user_password``) rather than at agent construction.
|
|
56
|
+
|
|
57
|
+
*Token-only and header-auth callers are unaffected* — they never reach an
|
|
58
|
+
AWS path and will not see this change.
|
|
59
|
+
|
|
60
|
+
Callers who previously relied on a ``boto3`` / credential error being raised
|
|
61
|
+
at construction time must now handle it at the first AWS-backed call.
|
|
62
|
+
The exception types raised are unchanged; only the timing differs.
|
|
63
|
+
|
|
64
|
+
Affected attribute: ``CognitoAgent._aws_session`` (now a
|
|
65
|
+
``functools.cached_property``).
|
|
66
|
+
|
|
67
|
+
- **HTTP-02 / COMPAT-03** — ``httpx`` is now the sole synchronous HTTP client
|
|
68
|
+
across ``CartaAgent``, ``fs/file.py``, ``services/proxy.py``, and
|
|
69
|
+
``services/server.py``. The ``requests.Session``-based transport has been
|
|
70
|
+
replaced with a lazily-constructed ``httpx.Client``.
|
|
71
|
+
|
|
72
|
+
**Behavior parity (D-03):** The shared client is configured with
|
|
73
|
+
``timeout=None`` and ``follow_redirects=True`` to exactly match the prior
|
|
74
|
+
``requests.Session`` defaults. No silent behavior change is introduced by
|
|
75
|
+
the transport swap itself.
|
|
76
|
+
|
|
77
|
+
**Response surface (D-01 / D-06):** ``CartaAgent`` verb methods
|
|
78
|
+
(``get``, ``post``, ``put``, ``patch``, ``delete``, ``head``, ``request``)
|
|
79
|
+
now return a ``ResponseAdapter`` — a thin delegating wrapper that preserves
|
|
80
|
+
the ``requests.Response`` attribute surface (``.status_code``, ``.json()``,
|
|
81
|
+
``.content``, ``.text``, ``.headers``, ``.ok``, ``.reason``,
|
|
82
|
+
``.raise_for_status()``, ``.iter_content()``) for existing SDK consumers.
|
|
83
|
+
The underlying object is an ``httpx.Response``; the adapter is
|
|
84
|
+
**deprecated** and scheduled for retirement in **v3.0**.
|
|
85
|
+
|
|
86
|
+
**Exception shim (D-02):** HTTP-status errors now raise an
|
|
87
|
+
``HTTPStatusError`` shim that inherits from BOTH
|
|
88
|
+
``httpx.HTTPStatusError`` (primary) AND ``requests.exceptions.HTTPError``
|
|
89
|
+
(secondary). This means:
|
|
90
|
+
|
|
91
|
+
- Existing ``except requests.exceptions.HTTPError`` catch-sites continue to
|
|
92
|
+
work unchanged and will additionally receive a ``DeprecationWarning`` on
|
|
93
|
+
each catch.
|
|
94
|
+
- New code should catch ``httpx.HTTPStatusError`` directly.
|
|
95
|
+
- The caught exception's ``.response`` attribute is a ``ResponseAdapter``,
|
|
96
|
+
so ``e.response.status_code`` and ``e.response.json()`` keep working at
|
|
97
|
+
all existing catch-sites.
|
|
98
|
+
|
|
99
|
+
**Transport shims:** ``requests.exceptions.Timeout`` and
|
|
100
|
+
``requests.exceptions.ConnectionError`` catch-sites continue to work.
|
|
101
|
+
Network-level exceptions are mapped via dual-inheritance shims:
|
|
102
|
+
``httpx.TimeoutException`` → ``TimeoutError`` (also a
|
|
103
|
+
``requests.exceptions.Timeout``); ``httpx.RequestError`` →
|
|
104
|
+
``ConnectionError`` (also a ``requests.exceptions.ConnectionError``).
|
|
105
|
+
Both shims emit a ``DeprecationWarning`` on construction and are slated for
|
|
106
|
+
removal in v3.0.
|
|
107
|
+
|
|
108
|
+
**New public API:**
|
|
109
|
+
|
|
110
|
+
- ``CartaAgent.http_client`` — a ``@property`` that lazily constructs and
|
|
111
|
+
returns the shared ``httpx.Client``. Long-lived or high-frequency
|
|
112
|
+
consumers should call ``CartaAgent.close()`` when done to release the
|
|
113
|
+
shared connection pool.
|
|
114
|
+
- ``CartaAgent.close()`` — closes the shared ``httpx.Client`` and resets
|
|
115
|
+
its internal sentinel. No-op if the client has not yet been built. Call
|
|
116
|
+
this at the end of a session to avoid resource leaks when the agent is
|
|
117
|
+
held for a long lifetime.
|
|
118
|
+
|
|
119
|
+
**Presigned fs upload/download — BEHAVIOR CHANGE (raise_for_status):**
|
|
120
|
+
``fs.file.upload()`` and ``fs.file.download()`` now call
|
|
121
|
+
``raise_for_status()`` on the streamed presigned response. Previously,
|
|
122
|
+
non-2xx presigned responses were silently ignored. After this change, a
|
|
123
|
+
non-2xx response from the presigned endpoint (S3, Azure, etc.) raises the
|
|
124
|
+
dual-MRO ``HTTPStatusError`` shim, which can be caught by existing
|
|
125
|
+
``except requests.exceptions.HTTPError`` sites.
|
|
126
|
+
|
|
127
|
+
*Migration:* callers that previously relied on a silent non-2xx presigned
|
|
128
|
+
response (e.g. a 403 from an expired presigned URL proceeding without
|
|
129
|
+
error) must now wrap the call in a try/except block or treat non-2xx as a
|
|
130
|
+
failure.
|
|
131
|
+
|
|
132
|
+
**Deferred hardening (future milestone):** A default request timeout and
|
|
133
|
+
restriction of cross-host redirect Authorization-header propagation are
|
|
134
|
+
intentionally deferred. The current ``timeout=None`` and
|
|
135
|
+
``follow_redirects=True`` settings preserve the prior ``requests.Session``
|
|
136
|
+
behavior (D-03); a future pass may set a default timeout and/or restrict
|
|
137
|
+
redirect behavior.
|
|
138
|
+
|
|
139
|
+
**Retained dependency:** ``requests`` is retained in ``install_requires``
|
|
140
|
+
through the v2.x deprecation window so the dual-inheritance shims always
|
|
141
|
+
have their secondary base classes available. Removal of ``requests``
|
|
142
|
+
(HTTP-03) is deferred to **v3.0**.
|
|
143
|
+
|
|
144
|
+
Deprecations
|
|
145
|
+
------------
|
|
146
|
+
|
|
147
|
+
- ``ResponseAdapter`` (the ``requests.Response``-compatible wrapper returned
|
|
148
|
+
by ``CartaAgent`` verb methods) is deprecated as of v2.2. Callers should
|
|
149
|
+
transition to consuming ``httpx.Response`` directly. The adapter will be
|
|
150
|
+
removed in **v3.0**.
|
|
151
|
+
|
|
152
|
+
- ``HTTPStatusError``, ``TimeoutError``, and ``ConnectionError`` shims in
|
|
153
|
+
``pycarta.auth._http_compat`` are deprecated as of v2.2. Use
|
|
154
|
+
``httpx.HTTPStatusError``, ``httpx.TimeoutException``, and
|
|
155
|
+
``httpx.RequestError`` directly. The shims will be removed in **v3.0**.
|
|
156
|
+
|
|
157
|
+
Breaking changes
|
|
158
|
+
----------------
|
|
159
|
+
|
|
160
|
+
- None currently / Reserved for future entries
|
|
@@ -182,6 +182,44 @@ Submit your contribution
|
|
|
182
182
|
the PR as a draft first and mark it as ready for review after the feedbacks
|
|
183
183
|
from the continuous integration (CI) system or any required fixes.
|
|
184
184
|
|
|
185
|
+
**Reviewer compatibility checklist (COMPAT-02 gate)**
|
|
186
|
+
|
|
187
|
+
Before approving any PR that modifies public ``pycarta`` behavior, verify all of the
|
|
188
|
+
following that apply. This is a process gate checked at review time, not an automated
|
|
189
|
+
registry test — nothing is mechanically deprecated in v2.2 yet, so the gate is
|
|
190
|
+
intentionally human-enforced (decision D-09).
|
|
191
|
+
|
|
192
|
+
- **Potentially-breaking behavior change** (an existing public path changes observable
|
|
193
|
+
behavior *now* — e.g. HTTP-02: swapping a ``requests`` exception type for an
|
|
194
|
+
``httpx`` one): the PR **must** include both:
|
|
195
|
+
|
|
196
|
+
- a *compatibility shim or migration mechanism* that preserves the old contract or
|
|
197
|
+
surfaces the change loudly (raises a clear error with actionable guidance), **and**
|
|
198
|
+
- a ``CHANGELOG.rst`` entry under the ``v2.2`` **"Breaking changes"** sub-section
|
|
199
|
+
with migration guidance.
|
|
200
|
+
|
|
201
|
+
- **Planned future removal** (something still works today but is slated to be removed
|
|
202
|
+
or renamed in a future release — e.g. a renamed env-var or helper): the PR **must**
|
|
203
|
+
include both:
|
|
204
|
+
|
|
205
|
+
- a ``DeprecationWarning`` (or ``FutureWarning`` where the change is visible by
|
|
206
|
+
default, matching the established v2.0 convention) emitted on the old path *now*,
|
|
207
|
+
**and**
|
|
208
|
+
- a ``CHANGELOG.rst`` entry under the ``v2.2`` **"Deprecations"** sub-section naming
|
|
209
|
+
the replacement and the target-removal milestone.
|
|
210
|
+
|
|
211
|
+
- **LAZY-04 special case — ImportError at attribute access**: when an optional
|
|
212
|
+
dependency is first accessed at the module level, a failed import *cannot* reliably
|
|
213
|
+
emit a ``DeprecationWarning`` before raising — the warning cannot precede a failed
|
|
214
|
+
import. For this case the gate requires a **compat-wrapper strategy**: raise a
|
|
215
|
+
clear ``ImportError`` carrying a ``pip install pycarta[X]`` hint (a guard-rail
|
|
216
|
+
message), and/or a thin attribute shim that warns-then-raises, recorded as a
|
|
217
|
+
**"Breaking changes"** changelog note rather than relying on a pre-import warning.
|
|
218
|
+
|
|
219
|
+
Governed examples: **LAZY-04** (optional-dependency ``ImportError``-at-attribute-access)
|
|
220
|
+
and **HTTP-02** (``requests`` → ``httpx`` exception-type migration). Future executors:
|
|
221
|
+
both changes are subject to this gate when they land in Phases 28–33.
|
|
222
|
+
|
|
185
223
|
|
|
186
224
|
Troubleshooting
|
|
187
225
|
---------------
|
|
@@ -246,6 +284,10 @@ on PyPI_, the following steps can be used to release a new version for
|
|
|
246
284
|
``pycarta``:
|
|
247
285
|
|
|
248
286
|
#. Make sure all unit tests are successful.
|
|
287
|
+
#. **Compatibility gate (COMPAT-02):** confirm that every breaking or deprecating
|
|
288
|
+
change in this milestone has its matching ``CHANGELOG.rst`` entry (under
|
|
289
|
+
"Breaking changes" or "Deprecations") and its deprecation warning or
|
|
290
|
+
compatibility shim already in place before tagging.
|
|
249
291
|
#. Tag the current commit on the main branch with a release tag, e.g., ``v1.2.3``.
|
|
250
292
|
#. Push the new tag to the upstream repository_, e.g., ``git push upstream v1.2.3``
|
|
251
293
|
#. Clean up the ``dist`` and ``build`` folders with ``tox -e clean``
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycarta
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.12
|
|
4
4
|
Summary: Python interface to Carta.
|
|
5
5
|
Author: Branden Kappes
|
|
6
6
|
Author-email: branden.kappes@contextualize.us.com
|
|
@@ -13,6 +13,7 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
License-File: LICENSE.txt
|
|
14
14
|
Requires-Dist: authlib
|
|
15
15
|
Requires-Dist: boto3
|
|
16
|
+
Requires-Dist: httpx>=0.27
|
|
16
17
|
Requires-Dist: pycognito
|
|
17
18
|
Requires-Dist: pydantic
|
|
18
19
|
Requires-Dist: python-dotenv
|
|
@@ -27,7 +28,6 @@ Requires-Dist: requests; extra == "slim"
|
|
|
27
28
|
Provides-Extra: carta
|
|
28
29
|
Requires-Dist: pycarta[slim]; extra == "carta"
|
|
29
30
|
Requires-Dist: fastapi[standard]; extra == "carta"
|
|
30
|
-
Requires-Dist: httpx>=0.27; extra == "carta"
|
|
31
31
|
Requires-Dist: inflection; extra == "carta"
|
|
32
32
|
Requires-Dist: itsdangerous; extra == "carta"
|
|
33
33
|
Provides-Extra: mqtt
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = pycarta
|
|
3
|
-
version = 0.3.
|
|
3
|
+
version = 0.3.12
|
|
4
4
|
description = Python interface to Carta.
|
|
5
5
|
author = Branden Kappes
|
|
6
6
|
author_email = branden.kappes@contextualize.us.com
|
|
@@ -23,6 +23,7 @@ python_requires = >=3.12
|
|
|
23
23
|
install_requires =
|
|
24
24
|
authlib
|
|
25
25
|
boto3
|
|
26
|
+
httpx>=0.27
|
|
26
27
|
pycognito
|
|
27
28
|
pydantic
|
|
28
29
|
python-dotenv
|
|
@@ -44,7 +45,6 @@ slim =
|
|
|
44
45
|
carta =
|
|
45
46
|
pycarta[slim]
|
|
46
47
|
fastapi[standard]
|
|
47
|
-
httpx>=0.27
|
|
48
48
|
inflection
|
|
49
49
|
itsdangerous
|
|
50
50
|
mqtt =
|
|
@@ -92,6 +92,11 @@ develop =
|
|
|
92
92
|
testing =
|
|
93
93
|
pycarta[dev]
|
|
94
94
|
|
|
95
|
+
[options.package_data]
|
|
96
|
+
pycarta =
|
|
97
|
+
py.typed
|
|
98
|
+
__init__.pyi
|
|
99
|
+
|
|
95
100
|
[options.entry_points]
|
|
96
101
|
|
|
97
102
|
[tool:pytest]
|
|
@@ -108,6 +113,7 @@ markers =
|
|
|
108
113
|
integration: mark test as integration test (requires external services)
|
|
109
114
|
smoke_test: mark test as smoke/integration test (skipped unless --smoke-test)
|
|
110
115
|
extras_isolation: mark test as extras isolation test (creates clean venvs, slow)
|
|
116
|
+
perf: mark test as opt-in timing benchmark (skipped unless --perf)
|
|
111
117
|
strict_markers = true
|
|
112
118
|
|
|
113
119
|
[devpi:upload]
|