oop-ext 2.3.3__tar.gz → 2.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.
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.github/workflows/deploy.yml +18 -6
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.github/workflows/test.yml +6 -21
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.pre-commit-config.yaml +7 -7
- {oop_ext-2.3.3 → oop_ext-2.4.1}/CHANGELOG.rst +17 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/PKG-INFO +19 -11
- {oop_ext-2.3.3 → oop_ext-2.4.1}/README.rst +1 -11
- oop_ext-2.4.1/RELEASING.rst +62 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/setup.py +4 -2
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_cached_method.py +9 -9
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_immutable.py +16 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_types.py +2 -2
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_weak_ref.py +9 -10
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/cached_method.py +1 -1
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_callback.py +13 -15
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_priority_callback.py +2 -2
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_shortcuts.py +4 -4
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_tests/test_callback.py +2 -2
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_tests/test_typed_callback.py +18 -36
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_typed_callback.py +13 -16
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/compat.py +1 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/decorators.py +1 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/immutable.py +11 -9
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/odict.py +1 -1
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/types_.py +1 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/weak_ref.py +7 -7
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/interface/_interface.py +30 -18
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/interface/_tests/test_interface.py +91 -47
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/PKG-INFO +19 -11
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/SOURCES.txt +2 -0
- oop_ext-2.4.1/src/oop_ext.egg-info/scm_file_list.json +79 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.codecov.yml +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.editorconfig +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.gitattributes +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.github/dependabot.yml +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.gitignore +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.isort.cfg +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.project +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.pydevproject +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/.readthedocs.yml +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/CONTRIBUTING.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/LICENSE +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/api.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/callbacks.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/changelog.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/conf.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/contributing.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/img/logo.png +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/index.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/installation.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/interfaces.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/readme.rst +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/docs/requirements.txt +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/environment.devenv.yml +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/mypy.ini +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/pyproject.toml +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/setup.cfg +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/sonar-project.properties +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/_type_checker_fixture.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/conftest.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_decorators.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_is_frozen.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_odict.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/_tests/test_singleton.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_callbacks.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_tests/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_tests/test_priority_callback.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/_tests/test_single_call_callback.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/callback/single_call_callback.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/exceptions.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/is_frozen.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/foundation/singleton.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/interface/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/interface/_adaptable_interface.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/interface/_tests/__init__.py +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext/py.typed +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/dependency_links.txt +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/not-zip-safe +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/requires.txt +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/src/oop_ext.egg-info/top_level.txt +0 -0
- {oop_ext-2.3.3 → oop_ext-2.4.1}/tox.ini +0 -0
|
@@ -20,10 +20,10 @@ jobs:
|
|
|
20
20
|
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
|
|
21
21
|
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@v7
|
|
24
24
|
|
|
25
25
|
- name: Build and Check Package
|
|
26
|
-
uses: hynek/build-and-inspect-python-package@v2.
|
|
26
|
+
uses: hynek/build-and-inspect-python-package@v2.18.0
|
|
27
27
|
with:
|
|
28
28
|
attest-build-provenance-github: 'true'
|
|
29
29
|
|
|
@@ -35,24 +35,36 @@ jobs:
|
|
|
35
35
|
permissions:
|
|
36
36
|
id-token: write # For PyPI trusted publishers.
|
|
37
37
|
contents: write # For tag and release notes.
|
|
38
|
+
pull-requests: write # For merging the release PR.
|
|
38
39
|
|
|
39
40
|
steps:
|
|
40
|
-
- uses: actions/checkout@
|
|
41
|
+
- uses: actions/checkout@v7
|
|
41
42
|
|
|
42
43
|
- name: Download Package
|
|
43
|
-
uses: actions/download-artifact@
|
|
44
|
+
uses: actions/download-artifact@v8
|
|
44
45
|
with:
|
|
45
46
|
name: Packages
|
|
46
47
|
path: dist
|
|
47
48
|
|
|
48
49
|
- name: Publish package to PyPI
|
|
49
|
-
uses: pypa/gh-action-pypi-publish@v1.
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@v1.14.0
|
|
50
51
|
with:
|
|
51
52
|
attestations: true
|
|
52
53
|
|
|
53
54
|
- name: GitHub Release
|
|
54
|
-
uses: softprops/action-gh-release@
|
|
55
|
+
uses: softprops/action-gh-release@v3
|
|
55
56
|
with:
|
|
56
57
|
files: dist/*
|
|
57
58
|
tag_name: v${{ github.event.inputs.version }}
|
|
58
59
|
target_commitish: ${{ github.sha }}
|
|
60
|
+
|
|
61
|
+
- name: Merge Release PR
|
|
62
|
+
if: startsWith(github.ref_name, 'release-')
|
|
63
|
+
env:
|
|
64
|
+
GH_TOKEN: ${{ github.token }}
|
|
65
|
+
# Only merges if the PR head is still the commit that was just released.
|
|
66
|
+
run: >-
|
|
67
|
+
gh pr merge ${{ github.ref_name }}
|
|
68
|
+
--repo ${{ github.repository }}
|
|
69
|
+
--merge
|
|
70
|
+
--match-head-commit ${{ github.sha }}
|
|
@@ -20,9 +20,9 @@ jobs:
|
|
|
20
20
|
id-token: write
|
|
21
21
|
attestations: write
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
23
|
+
- uses: actions/checkout@v7
|
|
24
24
|
- name: Build and Check Package
|
|
25
|
-
uses: hynek/build-and-inspect-python-package@v2.
|
|
25
|
+
uses: hynek/build-and-inspect-python-package@v2.18.0
|
|
26
26
|
with:
|
|
27
27
|
# Disabling because this is failing currently, see #466.
|
|
28
28
|
attest-build-provenance-github: 'false'
|
|
@@ -36,20 +36,20 @@ jobs:
|
|
|
36
36
|
strategy:
|
|
37
37
|
fail-fast: false
|
|
38
38
|
matrix:
|
|
39
|
-
python: ["3.
|
|
39
|
+
python: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
40
40
|
os: [ubuntu-latest, windows-latest]
|
|
41
41
|
|
|
42
42
|
steps:
|
|
43
|
-
- uses: actions/checkout@
|
|
43
|
+
- uses: actions/checkout@v7
|
|
44
44
|
|
|
45
45
|
- name: Download Package
|
|
46
|
-
uses: actions/download-artifact@
|
|
46
|
+
uses: actions/download-artifact@v8
|
|
47
47
|
with:
|
|
48
48
|
name: Packages
|
|
49
49
|
path: dist
|
|
50
50
|
|
|
51
51
|
- name: Set up Python
|
|
52
|
-
uses: actions/setup-python@
|
|
52
|
+
uses: actions/setup-python@v6
|
|
53
53
|
with:
|
|
54
54
|
python-version: ${{ matrix.python }}
|
|
55
55
|
|
|
@@ -62,18 +62,3 @@ jobs:
|
|
|
62
62
|
shell: bash
|
|
63
63
|
run: |
|
|
64
64
|
tox run -e py --installpkg `find dist/*.tar.gz`
|
|
65
|
-
|
|
66
|
-
sonarcloud:
|
|
67
|
-
|
|
68
|
-
runs-on: ubuntu-latest
|
|
69
|
-
|
|
70
|
-
steps:
|
|
71
|
-
- uses: actions/checkout@v4.2.2
|
|
72
|
-
with:
|
|
73
|
-
# Disabling shallow clone is recommended for improving relevancy of reporting
|
|
74
|
-
fetch-depth: 0
|
|
75
|
-
- name: SonarCloud Scan
|
|
76
|
-
uses: sonarsource/sonarcloud-github-action@master
|
|
77
|
-
env:
|
|
78
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
repos:
|
|
2
|
-
- repo: https://github.com/psf/black
|
|
3
|
-
rev:
|
|
2
|
+
- repo: https://github.com/psf/black-pre-commit-mirror
|
|
3
|
+
rev: 26.10.1
|
|
4
4
|
hooks:
|
|
5
5
|
- id: black
|
|
6
6
|
args: [--safe, --quiet]
|
|
7
7
|
language_version: python3
|
|
8
8
|
- repo: https://github.com/asottile/blacken-docs
|
|
9
|
-
rev: 1.
|
|
9
|
+
rev: 1.21.0
|
|
10
10
|
hooks:
|
|
11
11
|
- id: blacken-docs
|
|
12
12
|
additional_dependencies: [black==24.10.0]
|
|
13
13
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
14
|
-
rev:
|
|
14
|
+
rev: v6.0.0
|
|
15
15
|
hooks:
|
|
16
16
|
- id: trailing-whitespace
|
|
17
17
|
- id: end-of-file-fixer
|
|
18
18
|
- id: debug-statements
|
|
19
19
|
- repo: https://github.com/pycqa/isort
|
|
20
|
-
rev:
|
|
20
|
+
rev: 10.0.0b3
|
|
21
21
|
hooks:
|
|
22
22
|
- id: isort
|
|
23
23
|
name: isort
|
|
@@ -26,12 +26,12 @@ repos:
|
|
|
26
26
|
hooks:
|
|
27
27
|
- id: rst
|
|
28
28
|
name: rst
|
|
29
|
-
entry: rst-lint
|
|
29
|
+
entry: rst-lint
|
|
30
30
|
files: ^(CHANGELOG.rst|README.rst)$
|
|
31
31
|
language: python
|
|
32
32
|
additional_dependencies: [pygments, restructuredtext_lint]
|
|
33
33
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
34
|
-
rev:
|
|
34
|
+
rev: v2.4.1
|
|
35
35
|
hooks:
|
|
36
36
|
- id: mypy
|
|
37
37
|
files: ^(src/)
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
2.4.1
|
|
2
|
+
-----
|
|
3
|
+
|
|
4
|
+
**Release**: 2026-11-30
|
|
5
|
+
|
|
6
|
+
* Fixed interfaces with class-level annotations requiring implementations to have an ``__annotate_func__`` method on Python 3.14+.
|
|
7
|
+
|
|
8
|
+
2.4.0
|
|
9
|
+
-----
|
|
10
|
+
|
|
11
|
+
**Release**: 2026-11-30
|
|
12
|
+
|
|
13
|
+
* Added support for Python 3.14 and 3.15.
|
|
14
|
+
* Dropped support for Python 3.10.
|
|
15
|
+
* Fixed interface checks keeping classes created at runtime, and everything they reference, alive forever (`#202 <https://github.com/ESSS/oop-ext/issues/202>`__).
|
|
16
|
+
* Fixed import error when ``typing_extensions`` is not installed.
|
|
17
|
+
|
|
1
18
|
2.3.3
|
|
2
19
|
-----
|
|
3
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oop-ext
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: OOP Extensions is a set of utilities for object oriented programming not found on Python's standard library.
|
|
5
5
|
Home-page: http://github.com/ESSS/oop-ext
|
|
6
6
|
Author: ESSS
|
|
@@ -10,11 +10,12 @@ Keywords: oop_ext
|
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
|
+
Requires-Python: >=3.11
|
|
18
19
|
Description-Content-Type: text/x-rst
|
|
19
20
|
License-File: LICENSE
|
|
20
21
|
Requires-Dist: attrs
|
|
@@ -165,19 +166,26 @@ contribution to oop_ext, see the `contributing guidelines`_.
|
|
|
165
166
|
|
|
166
167
|
Release
|
|
167
168
|
-------
|
|
168
|
-
A reminder for the maintainers on how to make a new release.
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
See the `release instructions <https://github.com/ESSS/oop-ext/blob/master/RELEASING.rst>`__.
|
|
171
171
|
|
|
172
|
-
1. Create a ``release-VERSION`` branch from ``upstream/master``.
|
|
173
|
-
2. Update ``CHANGELOG.rst``.
|
|
174
|
-
3. Push the branch to ``upstream``.
|
|
175
|
-
4. Once all tests pass, start the ``deploy`` workflow manually or via::
|
|
176
172
|
|
|
177
|
-
|
|
173
|
+
2.4.1
|
|
174
|
+
-----
|
|
175
|
+
|
|
176
|
+
**Release**: 2026-11-30
|
|
177
|
+
|
|
178
|
+
* Fixed interfaces with class-level annotations requiring implementations to have an ``__annotate_func__`` method on Python 3.14+.
|
|
179
|
+
|
|
180
|
+
2.4.0
|
|
181
|
+
-----
|
|
178
182
|
|
|
179
|
-
|
|
183
|
+
**Release**: 2026-11-30
|
|
180
184
|
|
|
185
|
+
* Added support for Python 3.14 and 3.15.
|
|
186
|
+
* Dropped support for Python 3.10.
|
|
187
|
+
* Fixed interface checks keeping classes created at runtime, and everything they reference, alive forever (`#202 <https://github.com/ESSS/oop-ext/issues/202>`__).
|
|
188
|
+
* Fixed import error when ``typing_extensions`` is not installed.
|
|
181
189
|
|
|
182
190
|
2.3.3
|
|
183
191
|
-----
|
|
@@ -119,15 +119,5 @@ contribution to oop_ext, see the `contributing guidelines`_.
|
|
|
119
119
|
|
|
120
120
|
Release
|
|
121
121
|
-------
|
|
122
|
-
A reminder for the maintainers on how to make a new release.
|
|
123
122
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
1. Create a ``release-VERSION`` branch from ``upstream/master``.
|
|
127
|
-
2. Update ``CHANGELOG.rst``.
|
|
128
|
-
3. Push the branch to ``upstream``.
|
|
129
|
-
4. Once all tests pass, start the ``deploy`` workflow manually or via::
|
|
130
|
-
|
|
131
|
-
gh workflow run deploy.yml --repo ESSS/oop-ext --ref release-VERSION -f version=VERSION
|
|
132
|
-
|
|
133
|
-
5. Merge the PR.
|
|
123
|
+
See the `release instructions <https://github.com/ESSS/oop-ext/blob/master/RELEASING.rst>`__.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
=========
|
|
2
|
+
Releasing
|
|
3
|
+
=========
|
|
4
|
+
|
|
5
|
+
A reminder for the maintainers on how to make a new release.
|
|
6
|
+
|
|
7
|
+
Releases are published by the ``deploy`` workflow, which builds the package, uploads it to
|
|
8
|
+
`PyPI <https://pypi.org/project/oop-ext/>`__, creates the ``vVERSION`` tag and GitHub release, and
|
|
9
|
+
finally merges the release PR.
|
|
10
|
+
|
|
11
|
+
Choosing the version
|
|
12
|
+
--------------------
|
|
13
|
+
|
|
14
|
+
``VERSION`` follows `semantic versioning <https://semver.org>`__ as ``X.Y.Z`` (e.g. ``2.4.0``),
|
|
15
|
+
without the ``v`` prefix used by the tags:
|
|
16
|
+
|
|
17
|
+
* **Patch** (``Z``): bug fixes only.
|
|
18
|
+
* **Minor** (``Y``): new features, or dropping support for a Python version.
|
|
19
|
+
* **Major** (``X``): breaking API changes.
|
|
20
|
+
|
|
21
|
+
Steps
|
|
22
|
+
-----
|
|
23
|
+
|
|
24
|
+
1. Create a ``release-VERSION`` branch from an up-to-date ``master``. The ``release-`` prefix is
|
|
25
|
+
required: it is how the ``deploy`` workflow finds the PR to merge.
|
|
26
|
+
|
|
27
|
+
2. In ``CHANGELOG.rst``, rename the ``UNRELEASED`` section to the version and add the release
|
|
28
|
+
date, keeping the title underline as long as the title:
|
|
29
|
+
|
|
30
|
+
.. code-block:: rst
|
|
31
|
+
|
|
32
|
+
2.4.0
|
|
33
|
+
-----
|
|
34
|
+
|
|
35
|
+
**Release**: 2026-11-30
|
|
36
|
+
|
|
37
|
+
3. Commit as ``Release VERSION``, push the branch, and open a PR against ``master``.
|
|
38
|
+
|
|
39
|
+
4. Get the PR **approved** and wait for all checks to pass. ``master`` requires an approving
|
|
40
|
+
review, and the ``deploy`` workflow cannot merge the PR without it.
|
|
41
|
+
|
|
42
|
+
5. Start the ``deploy`` workflow from the release branch, manually or via::
|
|
43
|
+
|
|
44
|
+
gh workflow run deploy.yml --repo ESSS/oop-ext --ref release-VERSION -f version=VERSION
|
|
45
|
+
|
|
46
|
+
This cannot be undone: PyPI never accepts the same version twice, even after deleting it.
|
|
47
|
+
The tag and release point at the head of the release branch, and the PR is merged only if
|
|
48
|
+
its head is still that same commit, so do not push to the branch while the workflow runs.
|
|
49
|
+
|
|
50
|
+
6. Check the result::
|
|
51
|
+
|
|
52
|
+
gh run watch --repo ESSS/oop-ext --exit-status
|
|
53
|
+
gh release view vVERSION --repo ESSS/oop-ext
|
|
54
|
+
|
|
55
|
+
PyPI should list the new version, and the GitHub release should have the wheel, the source
|
|
56
|
+
archive and their attestations attached.
|
|
57
|
+
|
|
58
|
+
If only the final merge step failed (e.g. the PR was not approved), the release itself is
|
|
59
|
+
already published: just merge the PR by hand.
|
|
60
|
+
|
|
61
|
+
7. Update the ``oop-ext`` requirement in downstream projects (e.g. ``barril``) if they need
|
|
62
|
+
anything from the new release.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
"""The setup script."""
|
|
4
|
+
|
|
4
5
|
import io
|
|
5
6
|
from setuptools import find_packages
|
|
6
7
|
from setuptools import setup
|
|
@@ -31,10 +32,11 @@ setup(
|
|
|
31
32
|
"Development Status :: 5 - Production/Stable",
|
|
32
33
|
"Intended Audience :: Developers",
|
|
33
34
|
"License :: OSI Approved :: MIT License",
|
|
34
|
-
"Programming Language :: Python :: 3.10",
|
|
35
35
|
"Programming Language :: Python :: 3.11",
|
|
36
36
|
"Programming Language :: Python :: 3.12",
|
|
37
37
|
"Programming Language :: Python :: 3.13",
|
|
38
|
+
"Programming Language :: Python :: 3.14",
|
|
39
|
+
"Programming Language :: Python :: 3.15",
|
|
38
40
|
],
|
|
39
41
|
description="OOP Extensions is a set of utilities for object oriented programming not found on Python's standard library.",
|
|
40
42
|
extras_require=extras_require,
|
|
@@ -43,7 +45,7 @@ setup(
|
|
|
43
45
|
long_description_content_type="text/x-rst",
|
|
44
46
|
long_description=readme + "\n\n" + history,
|
|
45
47
|
include_package_data=True,
|
|
46
|
-
python_requires=">=3.
|
|
48
|
+
python_requires=">=3.11",
|
|
47
49
|
keywords="oop_ext",
|
|
48
50
|
name="oop-ext",
|
|
49
51
|
packages=find_packages(where="src"),
|
|
@@ -107,27 +107,27 @@ def testCacheMethodAttributeBasedCachedMethod() -> None:
|
|
|
107
107
|
return "%s %d" % (par, self.id)
|
|
108
108
|
|
|
109
109
|
alpha = TestObject()
|
|
110
|
-
alpha.Foo = AttributeBasedCachedMethod( # type:ignore[assignment]
|
|
110
|
+
alpha.Foo = AttributeBasedCachedMethod( # type: ignore[assignment]
|
|
111
111
|
alpha.Foo, "id", cache_size=3
|
|
112
112
|
)
|
|
113
|
-
alpha.Foo("test1") # type:ignore[misc]
|
|
114
|
-
alpha.Foo("test1") # type:ignore[misc]
|
|
113
|
+
alpha.Foo("test1") # type: ignore[misc]
|
|
114
|
+
alpha.Foo("test1") # type: ignore[misc]
|
|
115
115
|
|
|
116
116
|
assert alpha.n_calls == 1
|
|
117
117
|
|
|
118
|
-
alpha.Foo("test2") # type:ignore[misc]
|
|
118
|
+
alpha.Foo("test2") # type: ignore[misc]
|
|
119
119
|
assert alpha.n_calls == 2
|
|
120
|
-
assert len(alpha.Foo._results) == 2 # type:ignore[attr-defined]
|
|
120
|
+
assert len(alpha.Foo._results) == 2 # type: ignore[attr-defined]
|
|
121
121
|
|
|
122
122
|
alpha.id = 3
|
|
123
|
-
alpha.Foo("test2") # type:ignore[misc]
|
|
123
|
+
alpha.Foo("test2") # type: ignore[misc]
|
|
124
124
|
assert alpha.n_calls == 3
|
|
125
125
|
|
|
126
|
-
assert len(alpha.Foo._results) == 3 # type:ignore[attr-defined]
|
|
126
|
+
assert len(alpha.Foo._results) == 3 # type: ignore[attr-defined]
|
|
127
127
|
|
|
128
|
-
alpha.Foo("test3") # type:ignore[misc]
|
|
128
|
+
alpha.Foo("test3") # type: ignore[misc]
|
|
129
129
|
assert alpha.n_calls == 4
|
|
130
|
-
assert len(alpha.Foo._results) == 3 # type:ignore[attr-defined]
|
|
130
|
+
assert len(alpha.Foo._results) == 3 # type: ignore[attr-defined]
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
@pytest.fixture
|
|
@@ -5,6 +5,7 @@ from copy import deepcopy
|
|
|
5
5
|
from oop_ext.foundation.immutable import AsImmutable
|
|
6
6
|
from oop_ext.foundation.immutable import IdentityHashableRef
|
|
7
7
|
from oop_ext.foundation.immutable import ImmutableDict
|
|
8
|
+
from oop_ext.foundation.immutable import RegisterAsImmutable
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
def testImmutable() -> None:
|
|
@@ -106,3 +107,18 @@ def testIdentityHashableRef() -> None:
|
|
|
106
107
|
assert IdentityHashableRef(a) not in dict_b
|
|
107
108
|
assert IdentityHashableRef(b) in dict_b
|
|
108
109
|
assert dict_b[IdentityHashableRef(b)] == 7
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def testRegisterAsImmutableCopyReturnsSameInstance() -> None:
|
|
113
|
+
"""Shallow copies of registered immutable types are the original instance."""
|
|
114
|
+
|
|
115
|
+
class Point:
|
|
116
|
+
pass
|
|
117
|
+
|
|
118
|
+
RegisterAsImmutable(Point)
|
|
119
|
+
p = Point()
|
|
120
|
+
assert copy(p) is p
|
|
121
|
+
assert AsImmutable(p) is p
|
|
122
|
+
|
|
123
|
+
ref = IdentityHashableRef(p)
|
|
124
|
+
assert copy(ref) is ref
|
|
@@ -26,10 +26,10 @@ def testNull() -> None:
|
|
|
26
26
|
n.method1().attr1
|
|
27
27
|
|
|
28
28
|
n.attr1 = "value"
|
|
29
|
-
n.attr1.attr2 = "value" # type:ignore[attr-defined]
|
|
29
|
+
n.attr1.attr2 = "value" # type: ignore[attr-defined]
|
|
30
30
|
|
|
31
31
|
del n.attr1
|
|
32
|
-
del n.attr1.attr2.attr3 # type:ignore[attr-defined]
|
|
32
|
+
del n.attr1.attr2.attr3 # type: ignore[attr-defined]
|
|
33
33
|
|
|
34
34
|
# Iteration
|
|
35
35
|
for _ in n:
|
|
@@ -346,22 +346,21 @@ def testCustomAssertEqual() -> None:
|
|
|
346
346
|
def testRefcount() -> None:
|
|
347
347
|
_, c, _ = SetupTestAttributes()
|
|
348
348
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
) # 2: one in self, and one as argument to getrefcount()
|
|
349
|
+
# Relative to a baseline because Python 3.14 no longer counts the argument reference.
|
|
350
|
+
base = sys.getrefcount(c)
|
|
352
351
|
cf = c.f
|
|
353
|
-
CustomAssertEqual(sys.getrefcount(c),
|
|
352
|
+
CustomAssertEqual(sys.getrefcount(c), base + 1)
|
|
354
353
|
rf = WeakMethodRef(c.f)
|
|
355
354
|
pf = WeakMethodProxy(c.f)
|
|
356
|
-
CustomAssertEqual(sys.getrefcount(c),
|
|
355
|
+
CustomAssertEqual(sys.getrefcount(c), base + 1)
|
|
357
356
|
del cf
|
|
358
|
-
CustomAssertEqual(sys.getrefcount(c),
|
|
357
|
+
CustomAssertEqual(sys.getrefcount(c), base)
|
|
359
358
|
rf2 = WeakMethodRef(c.f)
|
|
360
|
-
CustomAssertEqual(sys.getrefcount(c),
|
|
359
|
+
CustomAssertEqual(sys.getrefcount(c), base)
|
|
361
360
|
del rf
|
|
362
361
|
del rf2
|
|
363
362
|
del pf
|
|
364
|
-
CustomAssertEqual(sys.getrefcount(c),
|
|
363
|
+
CustomAssertEqual(sys.getrefcount(c), base)
|
|
365
364
|
|
|
366
365
|
|
|
367
366
|
def testDies() -> None:
|
|
@@ -510,13 +509,13 @@ def testWeakList() -> None:
|
|
|
510
509
|
def m1() -> None:
|
|
511
510
|
"Never called"
|
|
512
511
|
|
|
513
|
-
weak_list.append(m1) # type:ignore[arg-type]
|
|
512
|
+
weak_list.append(m1) # type: ignore[arg-type]
|
|
514
513
|
assert 1 == len(weak_list[:])
|
|
515
514
|
del m1
|
|
516
515
|
assert 0 == len(weak_list[:])
|
|
517
516
|
|
|
518
517
|
s = _Stub()
|
|
519
|
-
weak_list.append(s.Method) # type:ignore[arg-type]
|
|
518
|
+
weak_list.append(s.Method) # type: ignore[arg-type]
|
|
520
519
|
assert 1 == len(weak_list[:])
|
|
521
520
|
ref_s = weakref.ref(s)
|
|
522
521
|
del s
|
|
@@ -148,7 +148,7 @@ class LastResultCachedMethod(AbstractCachedMethod, Generic[ResultType]):
|
|
|
148
148
|
def _GetCacheResult(self, key: Hashable, result: ResultType) -> ResultType:
|
|
149
149
|
# This could return None (_result is Optional), but not doing an assert
|
|
150
150
|
# here to avoid breaking code.
|
|
151
|
-
return self._result # type:ignore[return-value]
|
|
151
|
+
return self._result # type: ignore[return-value]
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
class AttributeBasedCachedMethod(CachedMethod, Generic[ResultType]):
|
|
@@ -49,12 +49,12 @@ We can unregister functions using :meth:`Unregister <Callback.Unregister>`, chec
|
|
|
49
49
|
is registered with :meth:`Contains <Callback.Contains>`, and unregister all connected functions
|
|
50
50
|
with :meth:`UnregisterAll <Callback.UnregisterAll>`.
|
|
51
51
|
"""
|
|
52
|
+
|
|
52
53
|
import types
|
|
53
54
|
from typing import Any
|
|
54
55
|
from typing import Optional
|
|
55
56
|
from typing import Tuple
|
|
56
57
|
from typing import Union
|
|
57
|
-
from typing import cast
|
|
58
58
|
|
|
59
59
|
import attr
|
|
60
60
|
import functools
|
|
@@ -188,20 +188,19 @@ class Callback:
|
|
|
188
188
|
is garbage collected, a new function may end up having the same key.
|
|
189
189
|
"""
|
|
190
190
|
if func.__class__ == _CallbackWrapper:
|
|
191
|
-
func = cast(_CallbackWrapper, func)
|
|
192
191
|
func = func.OriginalMethod()
|
|
193
192
|
|
|
194
193
|
try:
|
|
195
|
-
if func.__self__ is not None: # type:ignore[union-attr]
|
|
194
|
+
if func.__self__ is not None: # type: ignore[union-attr]
|
|
196
195
|
# bound method
|
|
197
196
|
return (
|
|
198
|
-
id(func.__self__), # type:ignore[union-attr]
|
|
199
|
-
id(func.__func__), # type:ignore[union-attr]
|
|
200
|
-
id(func.__self__.__class__), # type:ignore[union-attr]
|
|
197
|
+
id(func.__self__), # type: ignore[union-attr]
|
|
198
|
+
id(func.__func__), # type: ignore[union-attr]
|
|
199
|
+
id(func.__self__.__class__), # type: ignore[union-attr]
|
|
201
200
|
)
|
|
202
201
|
else:
|
|
203
202
|
return (
|
|
204
|
-
id(func.__func__), # type:ignore[union-attr]
|
|
203
|
+
id(func.__func__), # type: ignore[union-attr]
|
|
205
204
|
id(GetClassForUnboundMethod(func)),
|
|
206
205
|
)
|
|
207
206
|
|
|
@@ -223,7 +222,6 @@ class Callback:
|
|
|
223
222
|
# at this point, but if it's a WeakMethodProxy, register the original method (we'll make a
|
|
224
223
|
# weak reference later anyways).
|
|
225
224
|
if func.__class__ == WeakMethodProxy:
|
|
226
|
-
func = cast(WeakMethodProxy, func)
|
|
227
225
|
func = func.GetWrappedFunction()
|
|
228
226
|
|
|
229
227
|
if _IsCallableObject(func):
|
|
@@ -240,20 +238,20 @@ class Callback:
|
|
|
240
238
|
|
|
241
239
|
try:
|
|
242
240
|
if (
|
|
243
|
-
func.__self__ is not None # type:ignore[union-attr]
|
|
244
|
-
and func.__func__ is not None # type:ignore[union-attr]
|
|
241
|
+
func.__self__ is not None # type: ignore[union-attr]
|
|
242
|
+
and func.__func__ is not None # type: ignore[union-attr]
|
|
245
243
|
):
|
|
246
244
|
# bound method
|
|
247
245
|
return (
|
|
248
|
-
weakref.ref(func.__self__), # type:ignore[union-attr]
|
|
249
|
-
func.__func__, # type:ignore[union-attr]
|
|
250
|
-
func.__self__.__class__, # type:ignore[union-attr]
|
|
246
|
+
weakref.ref(func.__self__), # type: ignore[union-attr]
|
|
247
|
+
func.__func__, # type: ignore[union-attr]
|
|
248
|
+
func.__self__.__class__, # type: ignore[union-attr]
|
|
251
249
|
)
|
|
252
250
|
else:
|
|
253
251
|
# unbound method
|
|
254
252
|
return (
|
|
255
253
|
None,
|
|
256
|
-
func.__func__, # type:ignore[union-attr]
|
|
254
|
+
func.__func__, # type: ignore[union-attr]
|
|
257
255
|
GetClassForUnboundMethod(func),
|
|
258
256
|
)
|
|
259
257
|
except AttributeError:
|
|
@@ -424,7 +422,7 @@ class Callback:
|
|
|
424
422
|
if func_func == real_func:
|
|
425
423
|
return True
|
|
426
424
|
try:
|
|
427
|
-
f = real_func.__func__ # type:ignore[union-attr]
|
|
425
|
+
f = real_func.__func__ # type: ignore[union-attr]
|
|
428
426
|
except AttributeError:
|
|
429
427
|
return False
|
|
430
428
|
else:
|
|
@@ -20,7 +20,7 @@ class PriorityCallback(Callback):
|
|
|
20
20
|
INFO_POS_PRIORITY = 3
|
|
21
21
|
|
|
22
22
|
@Override(Callback._GetInfo)
|
|
23
|
-
def _GetInfo( # type:ignore[misc, override]
|
|
23
|
+
def _GetInfo( # type: ignore[misc, override]
|
|
24
24
|
self, func: Callable, priority: int
|
|
25
25
|
) -> Any:
|
|
26
26
|
"""
|
|
@@ -33,7 +33,7 @@ class PriorityCallback(Callback):
|
|
|
33
33
|
return info + (priority,)
|
|
34
34
|
|
|
35
35
|
@Override(Callback.Register)
|
|
36
|
-
def Register( # type:ignore[misc, override]
|
|
36
|
+
def Register( # type: ignore[misc, override]
|
|
37
37
|
self,
|
|
38
38
|
func: Callable,
|
|
39
39
|
extra_args: tuple[object, ...] = Callback._EXTRA_ARGS_CONSTANT,
|
|
@@ -174,7 +174,7 @@ def _GetWrapped(method: Method | _MethodWrapper | Callable) -> _MethodWrapper |
|
|
|
174
174
|
if isinstance(method, _MethodWrapper):
|
|
175
175
|
return method
|
|
176
176
|
try:
|
|
177
|
-
return method._wrapped_instance # type:ignore[attr-defined, union-attr]
|
|
177
|
+
return method._wrapped_instance # type: ignore[attr-defined, union-attr]
|
|
178
178
|
except AttributeError:
|
|
179
179
|
return None
|
|
180
180
|
|
|
@@ -194,7 +194,7 @@ def WrapForCallback(method: Method | _MethodWrapper | Callable) -> _MethodWrappe
|
|
|
194
194
|
# Note that the other way around does not work at all (i.e.: if a callback is first added
|
|
195
195
|
# to the instance, there's no way we'll find about that when adding it to the class
|
|
196
196
|
# anyways).
|
|
197
|
-
if method.__self__ is None: # type:ignore[union-attr]
|
|
197
|
+
if method.__self__ is None: # type: ignore[union-attr]
|
|
198
198
|
if wrapped._method._obj is None:
|
|
199
199
|
return wrapped
|
|
200
200
|
|
|
@@ -208,10 +208,10 @@ def WrapForCallback(method: Method | _MethodWrapper | Callable) -> _MethodWrappe
|
|
|
208
208
|
return wrapper(*args, **kwargs)
|
|
209
209
|
|
|
210
210
|
call.__name__ = method.__name__
|
|
211
|
-
call._wrapped_instance = wrapper # type:ignore[attr-defined]
|
|
211
|
+
call._wrapped_instance = wrapper # type: ignore[attr-defined]
|
|
212
212
|
|
|
213
213
|
setattr(GetClassForUnboundMethod(method), method.__name__, call)
|
|
214
214
|
else:
|
|
215
215
|
# override the instance method
|
|
216
|
-
setattr(method.__self__, method.__name__, wrapper) # type:ignore[union-attr]
|
|
216
|
+
setattr(method.__self__, method.__name__, wrapper) # type: ignore[union-attr]
|
|
217
217
|
return wrapper
|
|
@@ -53,8 +53,8 @@ def restore_test_classes() -> Generator[None, None, None]:
|
|
|
53
53
|
original_c_foo = C.foo
|
|
54
54
|
|
|
55
55
|
yield
|
|
56
|
-
Stub.call = original_stub_call # type:ignore[assignment]
|
|
57
|
-
C.foo = original_c_foo # type:ignore[assignment]
|
|
56
|
+
Stub.call = original_stub_call # type: ignore[assignment]
|
|
57
|
+
C.foo = original_c_foo # type: ignore[assignment]
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
class Test:
|