django-api-versioning 0.1.4__tar.gz → 0.3.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.
- django_api_versioning-0.3.0/CHANGELOG.md +135 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/MANIFEST.in +5 -4
- django_api_versioning-0.3.0/PKG-INFO +593 -0
- django_api_versioning-0.3.0/README.md +547 -0
- django_api_versioning-0.3.0/django_api_versioning/__init__.py +4 -0
- django_api_versioning-0.3.0/django_api_versioning/channels.py +63 -0
- django_api_versioning-0.3.0/django_api_versioning/decorators.py +133 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/django_api_versioning/exceptions.py +9 -5
- django_api_versioning-0.3.0/django_api_versioning/lifecycle.py +82 -0
- django_api_versioning-0.3.0/django_api_versioning/management/commands/check_versions.py +39 -0
- django_api_versioning-0.3.0/django_api_versioning/management/commands/migrate_endpoints.py +78 -0
- django_api_versioning-0.3.0/django_api_versioning/registry.py +142 -0
- django_api_versioning-0.3.0/django_api_versioning/reverse.py +65 -0
- django_api_versioning-0.3.0/django_api_versioning/settings.py +152 -0
- django_api_versioning-0.3.0/django_api_versioning/testing.py +75 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/django_api_versioning/urls.py +2 -0
- django_api_versioning-0.3.0/django_api_versioning.egg-info/PKG-INFO +593 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/django_api_versioning.egg-info/SOURCES.txt +18 -2
- django_api_versioning-0.3.0/django_api_versioning.egg-info/requires.txt +14 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/django_api_versioning.egg-info/top_level.txt +1 -1
- django_api_versioning-0.3.0/pyproject.toml +127 -0
- django_api_versioning-0.3.0/pytest.ini +5 -0
- django_api_versioning-0.3.0/requirements-dev.txt +13 -0
- django_api_versioning-0.3.0/requirements.txt +1 -0
- django_api_versioning-0.3.0/tests/__init__.py +0 -0
- django_api_versioning-0.3.0/tests/conftest.py +14 -0
- django_api_versioning-0.3.0/tests/settings.py +25 -0
- django_api_versioning-0.3.0/tests/test_channels.py +28 -0
- django_api_versioning-0.3.0/tests/test_channels_extra.py +33 -0
- django_api_versioning-0.3.0/tests/test_decorators.py +160 -0
- django_api_versioning-0.3.0/tests/test_exceptions.py +39 -0
- django_api_versioning-0.3.0/tests/test_lifecycle.py +107 -0
- django_api_versioning-0.3.0/tests/test_management_commands.py +33 -0
- django_api_versioning-0.3.0/tests/test_registry.py +403 -0
- django_api_versioning-0.3.0/tests/test_reverse.py +75 -0
- django_api_versioning-0.3.0/tests/test_segment_model.py +101 -0
- django_api_versioning-0.3.0/tests/test_settings.py +96 -0
- django_api_versioning-0.3.0/tests/test_testing_utils.py +22 -0
- django_api_versioning-0.3.0/tests/test_urls.py +51 -0
- django-api-versioning-0.1.4/.pre-commit-config.yaml +0 -44
- django-api-versioning-0.1.4/PKG-INFO +0 -301
- django-api-versioning-0.1.4/README.md +0 -277
- django-api-versioning-0.1.4/django_api_versioning/decorators.py +0 -100
- django-api-versioning-0.1.4/django_api_versioning/registry.py +0 -33
- django-api-versioning-0.1.4/django_api_versioning/settings.py +0 -75
- django-api-versioning-0.1.4/django_api_versioning.egg-info/PKG-INFO +0 -301
- django-api-versioning-0.1.4/django_api_versioning.egg-info/requires.txt +0 -13
- django-api-versioning-0.1.4/pyproject.toml +0 -16
- django-api-versioning-0.1.4/pytest.ini +0 -4
- django-api-versioning-0.1.4/requirements-dev.txt +0 -11
- django-api-versioning-0.1.4/requirements.txt +0 -1
- django-api-versioning-0.1.4/setup.py +0 -54
- django-api-versioning-0.1.4/tests/test_decorators.py +0 -122
- django-api-versioning-0.1.4/tests/test_exceptions.py +0 -19
- django-api-versioning-0.1.4/tests/test_registry.py +0 -83
- django-api-versioning-0.1.4/tests/test_settings.py +0 -147
- django-api-versioning-0.1.4/tests/test_urls.py +0 -33
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/LICENSE +0 -0
- {django-api-versioning-0.1.4/django_api_versioning → django_api_versioning-0.3.0/django_api_versioning/management}/__init__.py +0 -0
- {django-api-versioning-0.1.4/tests → django_api_versioning-0.3.0/django_api_versioning/management/commands}/__init__.py +0 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/django_api_versioning.egg-info/dependency_links.txt +0 -0
- {django-api-versioning-0.1.4 → django_api_versioning-0.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
# Changelog
|
|
3
|
+
|
|
4
|
+
All notable changes to this project will be documented in this file.
|
|
5
|
+
|
|
6
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [0.3.0] - 2026-10-31
|
|
12
|
+
|
|
13
|
+
This release replaces the forward/backward inheritance flags model with a **segment-based model**.
|
|
14
|
+
|
|
15
|
+
Each `@endpoint` declaration defines a change point for its route. Its view serves its declared version and subsequent versions up to the next declaration, or `API_MAX_VERSION` if no later declaration exists. Earlier versions can also be covered through backward inheritance, without overriding versions already assigned to another declaration.
|
|
16
|
+
|
|
17
|
+
This makes version resolution predictable and eliminates the route-collapsing behavior that could occur in 0.2.0.
|
|
18
|
+
|
|
19
|
+
> ⚠️ **Breaking:** `API_FORWARD_INHERITANCE` has been removed, and the default behavior and semantics of `forward` and `backward` have changed. See [Migration](#migration).
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Segment-based endpoint resolution.** Each declaration defines a forward segment, ending immediately before the next declaration on the same route.
|
|
24
|
+
- **Backward extension.** By default, a declaration can cover unclaimed versions between the previous declaration and its own version.
|
|
25
|
+
- **Resolution logging.** An `INFO` log message is emitted when a later declaration shortens an earlier declaration's forward segment.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **Forward inheritance is now enabled by default.** `forward` defaults to `True`, so a declaration serves its own version through the next declaration or `API_MAX_VERSION`.
|
|
30
|
+
- **Backward inheritance is now non-destructive.** `backward=True` (the default) fills only unclaimed versions before the declaration. It cannot override another declaration's forward segment.
|
|
31
|
+
- **`forward=False` pins a declaration to its own version.** The declaration serves only its explicitly assigned version.
|
|
32
|
+
- **Registration order no longer affects resolution.** Segments are calculated from the complete set of declarations rather than their registration order.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **Versioned route collapse.** Multiple declarations on the same route no longer cause all versions to resolve to the last registered view.
|
|
37
|
+
- **Backward inheritance overriding existing segments.** A later declaration no longer overwrites versions already covered by an earlier declaration's forward segment.
|
|
38
|
+
- **Silent routing changes.** When a new declaration shortens an existing declaration's forward segment, an informational log message is emitted.
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
|
|
42
|
+
- **`API_FORWARD_INHERITANCE` setting.** Forward inheritance is now the default behavior and is controlled per endpoint through `forward`.
|
|
43
|
+
- **`ForwardTypeError` exception.** This exception is no longer part of the public API.
|
|
44
|
+
|
|
45
|
+
### Migration
|
|
46
|
+
|
|
47
|
+
The following table summarizes the changes when upgrading from 0.2.0 to 0.3.0.
|
|
48
|
+
|
|
49
|
+
| 0.2.0 | 0.3.0 |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `API_FORWARD_INHERITANCE = True` | Remove the setting. Forward inheritance is now enabled by default. |
|
|
52
|
+
| `API_FORWARD_INHERITANCE = False` | Add `forward=False` to declarations that should serve only their explicitly assigned version. |
|
|
53
|
+
| `@endpoint("x/", version=2)` | Same syntax. Now serves v2 through the next declaration or `API_MAX_VERSION`. |
|
|
54
|
+
| `@endpoint("x/", version=2, forward=True)` | Same syntax. `forward=True` is now the default. |
|
|
55
|
+
| `@endpoint("x/", version=2, forward=False)` | Same syntax. Serves v2 only. |
|
|
56
|
+
| `@endpoint("x/", version=2, backward=True)` | Same syntax. Fills unclaimed earlier versions without overriding existing segments. |
|
|
57
|
+
| `@endpoint("x/", version=2, backward=False)` | Same syntax. Serves v2 onward; earlier versions are not filled by this declaration. |
|
|
58
|
+
|
|
59
|
+
**Important behavior change:** Consider two declarations on the same route:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
@endpoint("orders/", version=2)
|
|
63
|
+
class OrderListV2:
|
|
64
|
+
...
|
|
65
|
+
|
|
66
|
+
@endpoint("orders/", version=5)
|
|
67
|
+
class OrderListV5:
|
|
68
|
+
...
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
With `API_MAX_VERSION = 7`, the resulting resolution is:
|
|
72
|
+
|
|
73
|
+
| Version | 0.2.0 | 0.3.0 |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| v1 | OrderListV5 | OrderListV2 |
|
|
76
|
+
| v2 | OrderListV2 | OrderListV2 |
|
|
77
|
+
| v3 | OrderListV5 | OrderListV2 |
|
|
78
|
+
| v4 | OrderListV5 | OrderListV2 |
|
|
79
|
+
| v5 | OrderListV5 | OrderListV5 |
|
|
80
|
+
| v6 | OrderListV2 | OrderListV5 |
|
|
81
|
+
| v7 | OrderListV2 | OrderListV5 |
|
|
82
|
+
|
|
83
|
+
In 0.3.0, the earlier declaration retains its forward segment, while the later declaration takes over from its own version onward.
|
|
84
|
+
|
|
85
|
+
If you relied on the 0.2.0 default behavior with `API_FORWARD_INHERITANCE = False`, add `forward=False` to every declaration that must remain restricted to its own version.
|
|
86
|
+
|
|
87
|
+
### Internal
|
|
88
|
+
|
|
89
|
+
- Added tests covering forward defaults, backward defaults, endpoint pinning, previous declaration precedence, and registration-order independence.
|
|
90
|
+
- Replaced the previous registration-order-based resolution test with tests covering the segment model.
|
|
91
|
+
|
|
92
|
+
## [0.2.0] - 2026-10-28
|
|
93
|
+
|
|
94
|
+
The release that introduces **forward inheritance**. Routes declared for
|
|
95
|
+
0.1.x keep working unchanged unless you opt in by setting
|
|
96
|
+
`API_FORWARD_INHERITANCE = True` or passing `forward=True` to a single
|
|
97
|
+
endpoint.
|
|
98
|
+
|
|
99
|
+
> ⚠️ **Breaking:** Python 3.9 and Django 3.2 / 4.2 are no longer
|
|
100
|
+
> supported. See the *Changed* section below.
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
|
|
104
|
+
- **Forward endpoint inheritance.** An endpoint declared with
|
|
105
|
+
`version=N` is registered for versions `N+1` through `API_MAX_VERSION`
|
|
106
|
+
when `API_FORWARD_INHERITANCE = True`. The per-endpoint `forward`
|
|
107
|
+
argument overrides the global setting in either direction. Opt out
|
|
108
|
+
for a single endpoint with `forward=False`. See the *Forward
|
|
109
|
+
inheritance* section in the README.
|
|
110
|
+
- **`py.typed` marker (PEP 561).** Type hints ship with the package, so
|
|
111
|
+
`mypy` and `pyright` pick them up automatically in downstream
|
|
112
|
+
projects.
|
|
113
|
+
|
|
114
|
+
### Changed
|
|
115
|
+
|
|
116
|
+
- **Python support raised from 3.9 to 3.10–3.15.** Python 3.9 reached
|
|
117
|
+
end-of-life in October 2025 and received no security updates
|
|
118
|
+
afterwards.
|
|
119
|
+
- **Django support raised from 3.2 to 5.2–6.1.** Django 3.2 and 4.2
|
|
120
|
+
reached end-of-life in April 2024 and April 2026 respectively;
|
|
121
|
+
5.2 LTS is supported until April 2028.
|
|
122
|
+
|
|
123
|
+
### Removed
|
|
124
|
+
|
|
125
|
+
- The class-based-view wrapper introduced in 0.1.x. The wrapper replaced
|
|
126
|
+
the original class with a function, which silently dropped
|
|
127
|
+
`view_class` metadata on the URL pattern. This broke
|
|
128
|
+
`resolve().func.view_class` and some DRF integrations (authentication
|
|
129
|
+
class discovery, schema generation). Decorated CBVs now return the
|
|
130
|
+
original class unchanged.
|
|
131
|
+
|
|
132
|
+
## [0.1.4] - 2025-02-22
|
|
133
|
+
|
|
134
|
+
- Initial release: decorator-based URL versioning, backward compatibility,
|
|
135
|
+
Django and DRF support.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
include README.md
|
|
2
2
|
include LICENSE
|
|
3
|
-
include .
|
|
4
|
-
recursive-include django_api_versioning *.py
|
|
5
|
-
recursive-include tests *.py
|
|
3
|
+
include CHANGELOG.md
|
|
6
4
|
include requirements.txt
|
|
7
5
|
include requirements-dev.txt
|
|
8
|
-
include pytest.ini
|
|
6
|
+
include pytest.ini
|
|
7
|
+
recursive-include django_api_versioning *.py
|
|
8
|
+
recursive-include django_api_versioning py.typed
|
|
9
|
+
recursive-include tests *.py
|