tigrbl-typing 0.4.5.dev4__tar.gz → 0.4.5.dev6__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.
Files changed (26) hide show
  1. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/PKG-INFO +7 -7
  2. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/README.md +5 -5
  3. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/pyproject.toml +3 -2
  4. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/types/__init__.py +62 -6
  5. tigrbl_typing-0.4.5.dev6/tigrbl_typing/types/_datetime.py +11 -0
  6. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/vendor/sqlalchemy.py +2 -0
  7. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/LICENSE +0 -0
  8. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/NOTICE +0 -0
  9. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/__init__.py +0 -0
  10. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/channel.py +0 -0
  11. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/gw/__init__.py +0 -0
  12. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/gw/raw.py +0 -0
  13. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/phases.py +0 -0
  14. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/protocols.py +0 -0
  15. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/request.py +0 -0
  16. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/status/__init__.py +0 -0
  17. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/status/converters.py +0 -0
  18. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/status/exceptions.py +0 -0
  19. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/status/mappings.py +0 -0
  20. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/status/utils.py +0 -0
  21. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/types/authn_abc.py +0 -0
  22. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/types/channel.py +0 -0
  23. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/types/op.py +0 -0
  24. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/types/uuid.py +0 -0
  25. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/vendor/__init__.py +0 -0
  26. {tigrbl_typing-0.4.5.dev4 → tigrbl_typing-0.4.5.dev6}/tigrbl_typing/vendor/pydantic.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tigrbl-typing
3
- Version: 0.4.5.dev4
3
+ Version: 0.4.5.dev6
4
4
  Summary: Typing protocols, aliases, generics, and shared type helpers for Tigrbl framework packages and extensions.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -230,7 +230,7 @@ Project-URL: Discord, https://discord.gg/K4YTAPapjR
230
230
  Project-URL: Homepage, https://github.com/tigrbl/tigrbl
231
231
  Project-URL: Issues, https://github.com/tigrbl/tigrbl/issues
232
232
  Project-URL: Organization, https://github.com/tigrbl
233
- Project-URL: Repository, https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing
233
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing
234
234
  Description-Content-Type: text/markdown
235
235
 
236
236
  <div align="center">
@@ -240,7 +240,7 @@ Description-Content-Type: text/markdown
240
240
  <a href="https://pypi.org/project/tigrbl-typing/"><img src="https://img.shields.io/pypi/v/tigrbl-typing?label=PyPI" alt="PyPI version for tigrbl-typing"/></a>
241
241
  <a href="https://pypi.org/project/tigrbl-typing/"><img src="https://static.pepy.tech/badge/tigrbl-typing" alt="Downloads for tigrbl-typing"/></a>
242
242
  <a href="https://discord.gg/K4YTAPapjR"><img src="https://img.shields.io/badge/Discord-Join%20chat-5865F2?logo=discord&logoColor=white" alt="Discord community for tigrbl-typing"/></a>
243
- <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_typing/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_typing/README.md.svg?label=hits" alt="Repository hits for tigrbl-typing README"/></a>
243
+ <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/00_typing/tigrbl_typing/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/00_typing/tigrbl_typing/README.md.svg?label=hits" alt="Repository hits for tigrbl-typing README"/></a>
244
244
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-525252" alt="Apache 2.0 license"/></a>
245
245
  <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776ab" alt="Python versions 3.10 | 3.11 | 3.12 | 3.13 | 3.14 for tigrbl-typing"/></a>
246
246
  <a href="https://github.com/tigrbl/tigrbl/blob/master/docs/README.md"><img src="https://img.shields.io/badge/workspace-core-1f6feb" alt="Workspace group for tigrbl-typing"/></a>
@@ -264,7 +264,7 @@ Framework maintainers, extension authors, and advanced users composing Tigrbl fr
264
264
 
265
265
  ## Where does tigrbl-typing fit?
266
266
 
267
- `tigrbl-typing` lives at `pkgs/core/tigrbl_typing` and serves a focused layer in the split Tigrbl framework.
267
+ `tigrbl-typing` lives at `pkgs/00_typing/tigrbl_typing` and serves a focused layer in the split Tigrbl framework.
268
268
 
269
269
  ## How does tigrbl-typing work?
270
270
 
@@ -286,7 +286,7 @@ pip install tigrbl-typing
286
286
  | Surface | Value |
287
287
  |---|---|
288
288
  | PyPI package | [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/) |
289
- | Repository path | [`pkgs/core/tigrbl_typing`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing) |
289
+ | Repository path | [`pkgs/00_typing/tigrbl_typing`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing) |
290
290
  | Python import root | `tigrbl_typing` |
291
291
  | Console scripts | none declared |
292
292
  | Entry points | none declared |
@@ -375,7 +375,7 @@ Choose `tigrbl-typing` when the quick-answer table matches your use case. Choose
375
375
 
376
376
  - Community: [Discord](https://discord.gg/K4YTAPapjR).
377
377
  - Issues: [GitHub Issues](https://github.com/tigrbl/tigrbl/issues).
378
- - Repository: [pkgs/core/tigrbl_typing](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing).
378
+ - Repository: [pkgs/00_typing/tigrbl_typing](https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing).
379
379
 
380
380
  ## Package-local Boundary
381
381
 
@@ -386,7 +386,7 @@ This README is the package-local distribution entry point for `tigrbl-typing`. I
386
386
  - Package status: governed package in the `tigrbl/tigrbl` workspace.
387
387
  - Governance source: [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json).
388
388
  - Release evidence: [publish workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml) validates package builds, tests, GitHub release assets, and PyPI publication for managed packages.
389
- - Local certification guard: `pkgs/core/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
389
+ - Local certification guard: `pkgs/97_tests/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
390
390
  - Scope note: this README documents the package boundary. Runtime feature support remains governed by `.ssot/` entities and the conformance docs linked below.
391
391
 
392
392
  ## License
@@ -5,7 +5,7 @@
5
5
  <a href="https://pypi.org/project/tigrbl-typing/"><img src="https://img.shields.io/pypi/v/tigrbl-typing?label=PyPI" alt="PyPI version for tigrbl-typing"/></a>
6
6
  <a href="https://pypi.org/project/tigrbl-typing/"><img src="https://static.pepy.tech/badge/tigrbl-typing" alt="Downloads for tigrbl-typing"/></a>
7
7
  <a href="https://discord.gg/K4YTAPapjR"><img src="https://img.shields.io/badge/Discord-Join%20chat-5865F2?logo=discord&logoColor=white" alt="Discord community for tigrbl-typing"/></a>
8
- <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_typing/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/core/tigrbl_typing/README.md.svg?label=hits" alt="Repository hits for tigrbl-typing README"/></a>
8
+ <a href="https://github.com/tigrbl/tigrbl/blob/master/pkgs/00_typing/tigrbl_typing/README.md"><img src="https://hits.sh/github.com/tigrbl/tigrbl/blob/master/pkgs/00_typing/tigrbl_typing/README.md.svg?label=hits" alt="Repository hits for tigrbl-typing README"/></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-525252" alt="Apache 2.0 license"/></a>
10
10
  <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776ab" alt="Python versions 3.10 | 3.11 | 3.12 | 3.13 | 3.14 for tigrbl-typing"/></a>
11
11
  <a href="https://github.com/tigrbl/tigrbl/blob/master/docs/README.md"><img src="https://img.shields.io/badge/workspace-core-1f6feb" alt="Workspace group for tigrbl-typing"/></a>
@@ -29,7 +29,7 @@ Framework maintainers, extension authors, and advanced users composing Tigrbl fr
29
29
 
30
30
  ## Where does tigrbl-typing fit?
31
31
 
32
- `tigrbl-typing` lives at `pkgs/core/tigrbl_typing` and serves a focused layer in the split Tigrbl framework.
32
+ `tigrbl-typing` lives at `pkgs/00_typing/tigrbl_typing` and serves a focused layer in the split Tigrbl framework.
33
33
 
34
34
  ## How does tigrbl-typing work?
35
35
 
@@ -51,7 +51,7 @@ pip install tigrbl-typing
51
51
  | Surface | Value |
52
52
  |---|---|
53
53
  | PyPI package | [`tigrbl-typing`](https://pypi.org/project/tigrbl-typing/) |
54
- | Repository path | [`pkgs/core/tigrbl_typing`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing) |
54
+ | Repository path | [`pkgs/00_typing/tigrbl_typing`](https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing) |
55
55
  | Python import root | `tigrbl_typing` |
56
56
  | Console scripts | none declared |
57
57
  | Entry points | none declared |
@@ -140,7 +140,7 @@ Choose `tigrbl-typing` when the quick-answer table matches your use case. Choose
140
140
 
141
141
  - Community: [Discord](https://discord.gg/K4YTAPapjR).
142
142
  - Issues: [GitHub Issues](https://github.com/tigrbl/tigrbl/issues).
143
- - Repository: [pkgs/core/tigrbl_typing](https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing).
143
+ - Repository: [pkgs/00_typing/tigrbl_typing](https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing).
144
144
 
145
145
  ## Package-local Boundary
146
146
 
@@ -151,7 +151,7 @@ This README is the package-local distribution entry point for `tigrbl-typing`. I
151
151
  - Package status: governed package in the `tigrbl/tigrbl` workspace.
152
152
  - Governance source: [SSOT registry](https://github.com/tigrbl/tigrbl/blob/master/.ssot/registry.json).
153
153
  - Release evidence: [publish workflow](https://github.com/tigrbl/tigrbl/actions/workflows/publish.yml) validates package builds, tests, GitHub release assets, and PyPI publication for managed packages.
154
- - Local certification guard: `pkgs/core/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
154
+ - Local certification guard: `pkgs/97_tests/tigrbl_tests/tests/unit/test_package_badges_and_notices.py` verifies every package README keeps the Discord badge, Apache 2.0 badge, explicit Python-version badge, `LICENSE`, and `NOTICE`.
155
155
  - Scope note: this README documents the package boundary. Runtime feature support remains governed by `.ssot/` entities and the conformance docs linked below.
156
156
 
157
157
  ## License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tigrbl-typing"
3
- version = "0.4.5.dev4"
3
+ version = "0.4.5.dev6"
4
4
  description = "Typing protocols, aliases, generics, and shared type helpers for Tigrbl framework packages and extensions."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -49,7 +49,7 @@ dependencies = [
49
49
  Organization = "https://github.com/tigrbl"
50
50
  Discord = "https://discord.gg/K4YTAPapjR"
51
51
  Homepage = "https://github.com/tigrbl/tigrbl"
52
- Repository = "https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_typing"
52
+ Repository = "https://github.com/tigrbl/tigrbl/tree/master/pkgs/00_typing/tigrbl_typing"
53
53
  Issues = "https://github.com/tigrbl/tigrbl/issues"
54
54
 
55
55
  [build-system]
@@ -68,4 +68,5 @@ dev = [
68
68
  "pytest-asyncio>=0.24.0",
69
69
  "pytest-timeout>=2.3.1",
70
70
  "ruff>=0.9",
71
+ "sqlalchemy>=2.0",
71
72
  ]
@@ -1,13 +1,16 @@
1
1
  # ── Standard Library ─────────────────────────────────────────────────────
2
+ from importlib.metadata import version as distribution_version
2
3
  from types import MethodType, SimpleNamespace
3
4
  from uuid import uuid4, UUID
5
+ import warnings
4
6
 
5
7
  # ── Third-party Dependencies (via deps module) ───────────────────────────
6
8
  from ..vendor.sqlalchemy import (
7
9
  # Core SQLAlchemy
8
10
  Boolean,
9
- Column,
11
+ Column as _SQLAlchemyColumn,
10
12
  _DateTime,
13
+ Float,
11
14
  SAEnum,
12
15
  Text,
13
16
  ForeignKey,
@@ -27,11 +30,11 @@ from ..vendor.sqlalchemy import (
27
30
  JSONB,
28
31
  TSVECTOR,
29
32
  # ORM
30
- Mapped,
33
+ Mapped as _SQLAlchemyMapped,
31
34
  declarative_mixin,
32
35
  declared_attr,
33
36
  foreign,
34
- mapped_column,
37
+ mapped_column as _sqlalchemy_mapped_column,
35
38
  relationship,
36
39
  remote,
37
40
  column_property,
@@ -57,6 +60,7 @@ from ..status.exceptions import StatusDetailError
57
60
 
58
61
  # ── Local Package ─────────────────────────────────────────────────────────
59
62
  from .channel import OpChannel, OpChannelFamily, OpChannelKind, OpChannelSubevent
63
+ from ._datetime import tzutcnow, tzutcnow_plus_day
60
64
  from .op import _Op, _SchemaVerb
61
65
  from .uuid import PgUUID, SqliteUUID
62
66
  from .authn_abc import AuthNProvider
@@ -66,6 +70,39 @@ DateTime = _DateTime(timezone=False)
66
70
  TZDateTime = _DateTime(timezone=True)
67
71
 
68
72
 
73
+ DEPRECATED_EXPORTS_CUTOFF = (0, 7)
74
+
75
+ _DEPRECATED_EXPORTS = {
76
+ "Column": _SQLAlchemyColumn,
77
+ "Mapped": _SQLAlchemyMapped,
78
+ "mapped_column": _sqlalchemy_mapped_column,
79
+ }
80
+ _DEPRECATED_EXPORTS_MESSAGE = (
81
+ "{name} is deprecated in tigrbl_typing.types and will no longer be exported "
82
+ "starting with tigrbl-typing 0.7. Import Column from 'tigrbl_concrete', or "
83
+ "use 'tigrbl_concrete.factories.makeColumn', 'makeVirtualColumn', 'acol', or "
84
+ "'vcol'. For SQLAlchemy declarative typing, import Mapped and mapped_column "
85
+ "from 'sqlalchemy.orm'."
86
+ )
87
+
88
+
89
+ def _major_minor(value: str) -> tuple[int, int]:
90
+ release = value.split("+", 1)[0].split(".dev", 1)[0]
91
+ major, minor, *_ = release.split(".")
92
+ return int(major), int(minor)
93
+
94
+
95
+ def _deprecated_export_names_for(
96
+ current_major_minor: tuple[int, int],
97
+ ) -> list[str]:
98
+ if current_major_minor >= DEPRECATED_EXPORTS_CUTOFF:
99
+ return []
100
+ return list(_DEPRECATED_EXPORTS)
101
+
102
+
103
+ _CURRENT_MAJOR_MINOR = _major_minor(distribution_version("tigrbl-typing"))
104
+
105
+
69
106
  # ── Public Re-exports (Backwards Compatibility) ──────────────────────────
70
107
  __all__: list[str] = [
71
108
  # local
@@ -85,9 +122,11 @@ __all__: list[str] = [
85
122
  "UUID",
86
123
  # sqlalchemy core (from deps.sqlalchemy)
87
124
  "Boolean",
88
- "Column",
89
125
  "DateTime",
90
126
  "TZDateTime",
127
+ "tzutcnow",
128
+ "tzutcnow_plus_day",
129
+ "Float",
91
130
  "Text",
92
131
  "SAEnum",
93
132
  "ForeignKey",
@@ -108,11 +147,9 @@ __all__: list[str] = [
108
147
  "PgUUID",
109
148
  "TSVECTOR",
110
149
  # sqlalchemy.orm (from deps.sqlalchemy)
111
- "Mapped",
112
150
  "declarative_mixin",
113
151
  "declared_attr",
114
152
  "foreign",
115
- "mapped_column",
116
153
  "column_property",
117
154
  "hybrid_property",
118
155
  "relationship",
@@ -132,3 +169,22 @@ __all__: list[str] = [
132
169
  # status
133
170
  "StatusDetailError",
134
171
  ]
172
+
173
+ __all__.extend(_deprecated_export_names_for(_CURRENT_MAJOR_MINOR))
174
+
175
+
176
+ def __getattr__(name: str):
177
+ value = _DEPRECATED_EXPORTS.get(name)
178
+ if value is None:
179
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
180
+ if _CURRENT_MAJOR_MINOR >= DEPRECATED_EXPORTS_CUTOFF:
181
+ raise AttributeError(
182
+ f"{name} is no longer exported by tigrbl_typing.types as of "
183
+ "tigrbl-typing 0.7. " + _DEPRECATED_EXPORTS_MESSAGE.format(name=name)
184
+ )
185
+ warnings.warn(
186
+ _DEPRECATED_EXPORTS_MESSAGE.format(name=name),
187
+ DeprecationWarning,
188
+ stacklevel=2,
189
+ )
190
+ return value
@@ -0,0 +1,11 @@
1
+ from datetime import datetime, timedelta, timezone
2
+
3
+
4
+ def tzutcnow() -> datetime:
5
+ """Return the current time as a timezone-aware UTC datetime."""
6
+ return datetime.now(timezone.utc)
7
+
8
+
9
+ def tzutcnow_plus_day() -> datetime:
10
+ """Return a timezone-aware UTC datetime one day in the future."""
11
+ return tzutcnow() + timedelta(days=1)
@@ -6,6 +6,7 @@ from sqlalchemy import (
6
6
  Column,
7
7
  DateTime as _DateTime,
8
8
  Enum as SAEnum,
9
+ Float,
9
10
  ForeignKey,
10
11
  Index,
11
12
  Integer,
@@ -48,6 +49,7 @@ __all__ = [
48
49
  "Column",
49
50
  "_DateTime",
50
51
  "SAEnum",
52
+ "Float",
51
53
  "Text",
52
54
  "ForeignKey",
53
55
  "Index",