base-typed-string 0.1.2__tar.gz → 0.2.0__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.
- base_typed_string-0.2.0/CHANGELOG.md +57 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/LICENSE +8 -8
- base_typed_string-0.2.0/MANIFEST.in +7 -0
- {base_typed_string-0.1.2/src/base_typed_string.egg-info → base_typed_string-0.2.0}/PKG-INFO +797 -569
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/README.md +746 -521
- base_typed_string-0.2.0/RELEASING.md +130 -0
- base_typed_string-0.2.0/examples/basic_usage.py +125 -0
- base_typed_string-0.2.0/examples/constrained_usage.py +33 -0
- base_typed_string-0.2.0/examples/pickle_roundtrip.py +50 -0
- base_typed_string-0.2.0/examples/pydantic_constrained_usage.py +33 -0
- base_typed_string-0.2.0/examples/pydantic_roundtrip_from_dump.py +111 -0
- base_typed_string-0.2.0/examples/pydantic_runtime_vs_dump.py +110 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/pyproject.toml +150 -141
- base_typed_string-0.2.0/scripts/check_release.py +259 -0
- base_typed_string-0.2.0/scripts/smoke_installed.py +86 -0
- base_typed_string-0.2.0/scripts/verify_distribution.py +189 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/setup.cfg +4 -4
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string/__init__.py +22 -15
- base_typed_string-0.2.0/src/base_typed_string/_base_constrained_typed_string/__init__.py +5 -0
- base_typed_string-0.2.0/src/base_typed_string/_base_constrained_typed_string/_base.py +130 -0
- base_typed_string-0.2.0/src/base_typed_string/_base_constrained_typed_string/_constraints.py +303 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string/_base_typed_string.py +74 -91
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string/_exceptions.py +18 -10
- base_typed_string-0.2.0/src/base_typed_string/_pydantic_support.py +94 -0
- base_typed_string-0.2.0/src/base_typed_string/_version.py +1 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0/src/base_typed_string.egg-info}/PKG-INFO +797 -569
- base_typed_string-0.2.0/src/base_typed_string.egg-info/SOURCES.txt +44 -0
- base_typed_string-0.2.0/src/base_typed_string.egg-info/dependency_links.txt +1 -0
- base_typed_string-0.2.0/tests/__init__.py +0 -0
- base_typed_string-0.2.0/tests/test_constrained_configuration.py +344 -0
- base_typed_string-0.2.0/tests/test_constrained_constructor.py +251 -0
- base_typed_string-0.2.0/tests/test_constrained_pickle_support.py +57 -0
- base_typed_string-0.2.0/tests/test_constrained_pydantic_support.py +319 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/test_constructor.py +98 -86
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/test_internal_invariants.py +92 -49
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/test_pickle_support.py +62 -53
- base_typed_string-0.2.0/tests/test_public_api.py +56 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/test_pydantic_support.py +164 -132
- base_typed_string-0.2.0/tests/test_release_contract.py +88 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/test_runtime_behavior.py +150 -143
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/tests/testing_assertions.py +23 -23
- base_typed_string-0.2.0/tests/testing_types.py +37 -0
- base_typed_string-0.1.2/src/base_typed_string.egg-info/SOURCES.txt +0 -19
- base_typed_string-0.1.2/tests/testing_types.py +0 -20
- /base_typed_string-0.1.2/src/base_typed_string.egg-info/dependency_links.txt → /base_typed_string-0.2.0/scripts/__init__.py +0 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string/py.typed +0 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string.egg-info/requires.txt +0 -0
- {base_typed_string-0.1.2 → base_typed_string-0.2.0}/src/base_typed_string.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2026-07-22
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added the public callable `BaseConstrainedTypedString` class alongside
|
|
15
|
+
`BaseTypedString`.
|
|
16
|
+
- Added declarative `min_length`, `max_length`, and Python `re.search` pattern
|
|
17
|
+
constraints that work without Pydantic.
|
|
18
|
+
- Added fail-fast class configuration checks, immutable-on-use constraint
|
|
19
|
+
declarations, constraint-safe inheritance, and precompiled regular expressions.
|
|
20
|
+
- Added exact-subtype Pydantic v2 validation, plain-string serialization, and
|
|
21
|
+
validation and serialization JSON Schema constraints.
|
|
22
|
+
- Added `BaseTypedStringConstraintConfigurationError` and
|
|
23
|
+
`BaseTypedStringConstraintViolationError`.
|
|
24
|
+
- Added direct, inheritance, metaclass compatibility, pickle, Pydantic, schema,
|
|
25
|
+
optional-dependency, and adversarial regression coverage.
|
|
26
|
+
- Added complete examples for direct and Pydantic constrained-string usage.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Hardened `BaseTypedString` construction, representation, pickle support, and
|
|
31
|
+
Pydantic serialization to use the stored string payload rather than an
|
|
32
|
+
overridable `__str__` result.
|
|
33
|
+
- Pydantic model-level string normalization can no longer silently alter typed
|
|
34
|
+
strings; typed-string inputs remain strict and unmodified.
|
|
35
|
+
- Pydantic serialization now rejects invalid unvalidated model state instead of
|
|
36
|
+
coercing an unrelated object to `str`.
|
|
37
|
+
- Package documentation now treats `BaseTypedString` as the unconstrained brand
|
|
38
|
+
and `BaseConstrainedTypedString` as the intrinsic-invariant form.
|
|
39
|
+
- The minimum supported versions remain Python 3.10 and Pydantic 2.6; Python 3.14
|
|
40
|
+
is now explicitly classified and tested.
|
|
41
|
+
- The project version now has one source of truth in
|
|
42
|
+
`base_typed_string._version`.
|
|
43
|
+
|
|
44
|
+
### Migration notes
|
|
45
|
+
|
|
46
|
+
- Replace private backing classes plus
|
|
47
|
+
`Annotated[..., StringConstraints(...), AfterValidator(...)]` aliases with one
|
|
48
|
+
public `BaseConstrainedTypedString` subclass.
|
|
49
|
+
- `pattern` retains Python `re.search` semantics; it is not implicitly a full
|
|
50
|
+
match.
|
|
51
|
+
- Removing an old private backing class can make previously stored pickle payloads
|
|
52
|
+
unresolvable. Migrate those payloads before deleting the old import path.
|
|
53
|
+
- Applications that relied on Pydantic model-level stripping or case conversion
|
|
54
|
+
for `BaseTypedString` fields must normalize explicitly before construction.
|
|
55
|
+
|
|
56
|
+
[Unreleased]: https://github.com/eldenizfamilyanskicode/base-typed-string/compare/v0.2.0...HEAD
|
|
57
|
+
[0.2.0]: https://github.com/eldenizfamilyanskicode/base-typed-string/compare/v0.1.2...v0.2.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Eldeniz Guseinli
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eldeniz Guseinli
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
9
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|