capper 0.4.0__tar.gz → 0.4.1__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.
- {capper-0.4.0 → capper-0.4.1}/PKG-INFO +3 -3
- {capper-0.4.0 → capper-0.4.1}/README.md +2 -2
- {capper-0.4.0 → capper-0.4.1}/capper/__init__.py +1 -1
- capper-0.4.1/capper/_deprecations.py +29 -0
- capper-0.4.1/capper/tests/test_deprecations.py +26 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_edge_cases.py +2 -2
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/PKG-INFO +3 -3
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/SOURCES.txt +2 -0
- {capper-0.4.0 → capper-0.4.1}/pyproject.toml +1 -1
- {capper-0.4.0 → capper-0.4.1}/capper/barcode.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/base.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/cli.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/color.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/commerce.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/date_time.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/examples/user_factory.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/file.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/finance.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/geo.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/internet.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/misc.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/person.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/phone.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/registry.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/strategies.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/__init__.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/benchmark_core.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/conftest.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_cli.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_docs_examples.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_hypothesis_strategies.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_polyfactory_integration.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_thread_safety.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/tests/test_types.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper/text.py +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/dependency_links.txt +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/entry_points.txt +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/requires.txt +0 -0
- {capper-0.4.0 → capper-0.4.1}/capper.egg-info/top_level.txt +0 -0
- {capper-0.4.0 → capper-0.4.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capper
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Semantic, typed wrappers for Faker with automatic Polyfactory integration
|
|
5
5
|
Author-email: Odos Matthews <odosmatthews@gmail.com>
|
|
6
6
|
Project-URL: Documentation, https://github.com/eddiethedean/capper#readme
|
|
@@ -160,7 +160,7 @@ Use `-n`/`--count` for the number of rows and `-s`/`--seed` for reproducible out
|
|
|
160
160
|
|
|
161
161
|
## Compatibility
|
|
162
162
|
|
|
163
|
-
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
163
|
+
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, the versioning policy, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
164
164
|
|
|
165
165
|
## What's new in 0.4.0
|
|
166
166
|
|
|
@@ -208,7 +208,7 @@ Releases are built and published to PyPI via [GitHub Actions](https://github.com
|
|
|
208
208
|
|
|
209
209
|
1. Update [CHANGELOG.md](CHANGELOG.md): move Unreleased entries into a new version section and date it.
|
|
210
210
|
2. Add a `PYPI_API_TOKEN` secret (PyPI API token) to the repo.
|
|
211
|
-
3. Create a GitHub release (tag e.g. `v0.4.
|
|
211
|
+
3. Create a GitHub release (tag e.g. `v0.4.1`). The workflow runs tests, builds the package, and uploads to PyPI.
|
|
212
212
|
|
|
213
213
|
To build and upload manually: `pip install build twine`, `python -m build`, `twine upload dist/*`.
|
|
214
214
|
|
|
@@ -132,7 +132,7 @@ Use `-n`/`--count` for the number of rows and `-s`/`--seed` for reproducible out
|
|
|
132
132
|
|
|
133
133
|
## Compatibility
|
|
134
134
|
|
|
135
|
-
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
135
|
+
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, the versioning policy, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
136
136
|
|
|
137
137
|
## What's new in 0.4.0
|
|
138
138
|
|
|
@@ -180,7 +180,7 @@ Releases are built and published to PyPI via [GitHub Actions](https://github.com
|
|
|
180
180
|
|
|
181
181
|
1. Update [CHANGELOG.md](CHANGELOG.md): move Unreleased entries into a new version section and date it.
|
|
182
182
|
2. Add a `PYPI_API_TOKEN` secret (PyPI API token) to the repo.
|
|
183
|
-
3. Create a GitHub release (tag e.g. `v0.4.
|
|
183
|
+
3. Create a GitHub release (tag e.g. `v0.4.1`). The workflow runs tests, builds the package, and uploads to PyPI.
|
|
184
184
|
|
|
185
185
|
To build and upload manually: `pip install build twine`, `python -m build`, `twine upload dist/*`.
|
|
186
186
|
|
|
@@ -11,7 +11,7 @@ try:
|
|
|
11
11
|
|
|
12
12
|
__version__ = _version("capper")
|
|
13
13
|
except Exception: # Package not installed (e.g. dev tree) or metadata missing
|
|
14
|
-
__version__ = "0.4.
|
|
14
|
+
__version__ = "0.4.1"
|
|
15
15
|
|
|
16
16
|
from .barcode import EAN8, EAN13
|
|
17
17
|
from .base import FakerType, faker, seed, use_faker
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Internal helpers for deprecation warnings.
|
|
2
|
+
|
|
3
|
+
Use warn_deprecated() to emit consistent DeprecationWarning messages.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from warnings import warn
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def warn_deprecated(
|
|
12
|
+
name: str,
|
|
13
|
+
*,
|
|
14
|
+
removal_version: str,
|
|
15
|
+
alternative: str | None = None,
|
|
16
|
+
stacklevel: int = 2,
|
|
17
|
+
) -> None:
|
|
18
|
+
"""Emit a standardized DeprecationWarning for a Capper API.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
name: Fully qualified name of the deprecated API.
|
|
22
|
+
removal_version: Target version where the API is expected to be removed.
|
|
23
|
+
alternative: Optional string describing the preferred replacement.
|
|
24
|
+
stacklevel: Passed through to warnings.warn to point at the caller.
|
|
25
|
+
"""
|
|
26
|
+
message = f"{name} is deprecated and will be removed in {removal_version}."
|
|
27
|
+
if alternative:
|
|
28
|
+
message += f" Use {alternative} instead."
|
|
29
|
+
warn(message, DeprecationWarning, stacklevel=stacklevel)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Tests for the internal deprecation helper."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from warnings import catch_warnings, simplefilter
|
|
6
|
+
|
|
7
|
+
from capper._deprecations import warn_deprecated
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_warn_deprecated_emits_standard_message() -> None:
|
|
11
|
+
"""warn_deprecated() emits a DeprecationWarning with the expected text."""
|
|
12
|
+
with catch_warnings(record=True) as caught:
|
|
13
|
+
simplefilter("always", DeprecationWarning)
|
|
14
|
+
warn_deprecated(
|
|
15
|
+
"capper.some_api",
|
|
16
|
+
removal_version="0.6.0",
|
|
17
|
+
alternative="capper.new_api",
|
|
18
|
+
stacklevel=1,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
assert caught, "Expected at least one DeprecationWarning"
|
|
22
|
+
warning = caught[0]
|
|
23
|
+
assert issubclass(warning.category, DeprecationWarning)
|
|
24
|
+
message = str(warning.message)
|
|
25
|
+
assert "capper.some_api is deprecated and will be removed in 0.6.0." in message
|
|
26
|
+
assert "Use capper.new_api instead." in message
|
|
@@ -10,13 +10,13 @@ from capper.base import FakerType
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def test_version_fallback_when_metadata_missing() -> None:
|
|
13
|
-
"""When importlib.metadata.version raises, __version__ falls back to 0.4.
|
|
13
|
+
"""When importlib.metadata.version raises, __version__ falls back to 0.4.1."""
|
|
14
14
|
with patch("importlib.metadata.version", side_effect=Exception("no metadata")):
|
|
15
15
|
if "capper" in sys.modules:
|
|
16
16
|
del sys.modules["capper"]
|
|
17
17
|
import capper as capper_mod
|
|
18
18
|
|
|
19
|
-
assert capper_mod.__version__ == "0.4.
|
|
19
|
+
assert capper_mod.__version__ == "0.4.1"
|
|
20
20
|
# Reimport so later tests see the real version
|
|
21
21
|
if "capper" in sys.modules:
|
|
22
22
|
del sys.modules["capper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capper
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Semantic, typed wrappers for Faker with automatic Polyfactory integration
|
|
5
5
|
Author-email: Odos Matthews <odosmatthews@gmail.com>
|
|
6
6
|
Project-URL: Documentation, https://github.com/eddiethedean/capper#readme
|
|
@@ -160,7 +160,7 @@ Use `-n`/`--count` for the number of rows and `-s`/`--seed` for reproducible out
|
|
|
160
160
|
|
|
161
161
|
## Compatibility
|
|
162
162
|
|
|
163
|
-
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
163
|
+
Capper targets **Python 3.10+**, **Faker >= 20.0**, and **Polyfactory >= 2.0**. For version ranges, upgrade guidance, the versioning policy, and the deprecation policy, see [Compatibility](docs/compatibility.md).
|
|
164
164
|
|
|
165
165
|
## What's new in 0.4.0
|
|
166
166
|
|
|
@@ -208,7 +208,7 @@ Releases are built and published to PyPI via [GitHub Actions](https://github.com
|
|
|
208
208
|
|
|
209
209
|
1. Update [CHANGELOG.md](CHANGELOG.md): move Unreleased entries into a new version section and date it.
|
|
210
210
|
2. Add a `PYPI_API_TOKEN` secret (PyPI API token) to the repo.
|
|
211
|
-
3. Create a GitHub release (tag e.g. `v0.4.
|
|
211
|
+
3. Create a GitHub release (tag e.g. `v0.4.1`). The workflow runs tests, builds the package, and uploads to PyPI.
|
|
212
212
|
|
|
213
213
|
To build and upload manually: `pip install build twine`, `python -m build`, `twine upload dist/*`.
|
|
214
214
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
3
|
capper/__init__.py
|
|
4
|
+
capper/_deprecations.py
|
|
4
5
|
capper/barcode.py
|
|
5
6
|
capper/base.py
|
|
6
7
|
capper/cli.py
|
|
@@ -28,6 +29,7 @@ capper/tests/__init__.py
|
|
|
28
29
|
capper/tests/benchmark_core.py
|
|
29
30
|
capper/tests/conftest.py
|
|
30
31
|
capper/tests/test_cli.py
|
|
32
|
+
capper/tests/test_deprecations.py
|
|
31
33
|
capper/tests/test_docs_examples.py
|
|
32
34
|
capper/tests/test_edge_cases.py
|
|
33
35
|
capper/tests/test_hypothesis_strategies.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|