oop-ext 2.2.0__tar.gz → 2.3.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.1/.github/workflows/deploy.yml +57 -0
- oop_ext-2.3.1/.github/workflows/test.yml +79 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.pre-commit-config.yaml +4 -4
- {oop_ext-2.2.0 → oop_ext-2.3.1}/CHANGELOG.rst +16 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/PKG-INFO +37 -4
- {oop_ext-2.2.0 → oop_ext-2.3.1}/README.rst +5 -2
- {oop_ext-2.2.0 → oop_ext-2.3.1}/pyproject.toml +0 -1
- {oop_ext-2.2.0 → oop_ext-2.3.1}/setup.py +1 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_weak_ref.py +5 -5
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/immutable.py +2 -2
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/weak_ref.py +15 -14
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/interface/__init__.py +9 -9
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/PKG-INFO +37 -4
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/SOURCES.txt +2 -1
- oop_ext-2.2.0/.github/workflows/main.yml +0 -87
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.codecov.yml +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.editorconfig +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.gitattributes +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.github/dependabot.yml +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.gitignore +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.isort.cfg +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.project +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.pydevproject +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/.readthedocs.yml +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/CONTRIBUTING.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/LICENSE +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/api.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/callbacks.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/changelog.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/conf.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/contributing.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/img/logo.png +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/index.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/installation.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/interfaces.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/readme.rst +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/docs/requirements.txt +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/environment.devenv.yml +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/mypy.ini +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/setup.cfg +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/sonar-project.properties +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/_type_checker_fixture.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/conftest.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_cached_method.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_decorators.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_immutable.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_is_frozen.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_odict.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_singleton.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/_tests/test_types.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/cached_method.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_callbacks.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_priority_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_shortcuts.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_priority_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_single_call_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_typed_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_typed_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/single_call_callback.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/compat.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/decorators.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/exceptions.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/is_frozen.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/odict.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/singleton.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/types_.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/interface/_adaptable_interface.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/interface/_interface.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/interface/_tests/__init__.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/interface/_tests/test_interface.py +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/py.typed +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/dependency_links.txt +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/not-zip-safe +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/requires.txt +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext.egg-info/top_level.txt +0 -0
- {oop_ext-2.2.0 → oop_ext-2.3.1}/tox.ini +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: deploy
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Release version'
|
|
8
|
+
required: true
|
|
9
|
+
default: '1.2.3'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
|
|
13
|
+
package:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
# Required by attest-build-provenance-github.
|
|
16
|
+
permissions:
|
|
17
|
+
id-token: write
|
|
18
|
+
attestations: write
|
|
19
|
+
env:
|
|
20
|
+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Build and Check Package
|
|
26
|
+
uses: hynek/build-and-inspect-python-package@v2.13.0
|
|
27
|
+
with:
|
|
28
|
+
attest-build-provenance-github: 'true'
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
deploy:
|
|
32
|
+
needs: package
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
environment: deploy
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # For PyPI trusted publishers.
|
|
37
|
+
contents: write # For tag and release notes.
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- name: Download Package
|
|
43
|
+
uses: actions/download-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: Packages
|
|
46
|
+
path: dist
|
|
47
|
+
|
|
48
|
+
- name: Publish package to PyPI
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@v1.12.4
|
|
50
|
+
with:
|
|
51
|
+
attestations: true
|
|
52
|
+
|
|
53
|
+
- name: GitHub Release
|
|
54
|
+
uses: softprops/action-gh-release@v2
|
|
55
|
+
with:
|
|
56
|
+
files: dist/*
|
|
57
|
+
tag_name: v${{ github.event.inputs.version }}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
|
|
17
|
+
package:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
permissions:
|
|
20
|
+
id-token: write
|
|
21
|
+
attestations: write
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- name: Build and Check Package
|
|
25
|
+
uses: hynek/build-and-inspect-python-package@v2.13.0
|
|
26
|
+
with:
|
|
27
|
+
# Disabling because this is failing currently, see #466.
|
|
28
|
+
attest-build-provenance-github: 'false'
|
|
29
|
+
|
|
30
|
+
test:
|
|
31
|
+
|
|
32
|
+
needs: [package]
|
|
33
|
+
|
|
34
|
+
runs-on: ${{ matrix.os }}
|
|
35
|
+
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix:
|
|
39
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
40
|
+
os: [ubuntu-latest, windows-latest]
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
|
|
45
|
+
- name: Download Package
|
|
46
|
+
uses: actions/download-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: Packages
|
|
49
|
+
path: dist
|
|
50
|
+
|
|
51
|
+
- name: Set up Python
|
|
52
|
+
uses: actions/setup-python@v5
|
|
53
|
+
with:
|
|
54
|
+
python-version: ${{ matrix.python }}
|
|
55
|
+
|
|
56
|
+
- name: Install tox
|
|
57
|
+
run: |
|
|
58
|
+
python -m pip install --upgrade pip
|
|
59
|
+
pip install tox
|
|
60
|
+
|
|
61
|
+
- name: Test
|
|
62
|
+
shell: bash
|
|
63
|
+
run: |
|
|
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,12 +1,12 @@
|
|
|
1
1
|
repos:
|
|
2
2
|
- repo: https://github.com/psf/black
|
|
3
|
-
rev:
|
|
3
|
+
rev: 25.1.0
|
|
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.19.
|
|
9
|
+
rev: 1.19.1
|
|
10
10
|
hooks:
|
|
11
11
|
- id: blacken-docs
|
|
12
12
|
additional_dependencies: [black==24.10.0]
|
|
@@ -17,7 +17,7 @@ repos:
|
|
|
17
17
|
- id: end-of-file-fixer
|
|
18
18
|
- id: debug-statements
|
|
19
19
|
- repo: https://github.com/pycqa/isort
|
|
20
|
-
rev:
|
|
20
|
+
rev: 6.0.1
|
|
21
21
|
hooks:
|
|
22
22
|
- id: isort
|
|
23
23
|
name: isort
|
|
@@ -31,7 +31,7 @@ repos:
|
|
|
31
31
|
language: python
|
|
32
32
|
additional_dependencies: [pygments, restructuredtext_lint]
|
|
33
33
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
34
|
-
rev: v1.
|
|
34
|
+
rev: v1.17.0
|
|
35
35
|
hooks:
|
|
36
36
|
- id: mypy
|
|
37
37
|
files: ^(src/)
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
2.3.1
|
|
2
|
+
-----
|
|
3
|
+
|
|
4
|
+
**Release**: 2025-08-01
|
|
5
|
+
|
|
6
|
+
* Fix type annotations:
|
|
7
|
+
* ``oop_ext.foundation.weak_ref.IsWeakProxy``.
|
|
8
|
+
* ``oop_ext.foundation.weak_ref.IsWeakRef``.
|
|
9
|
+
* ``oop_ext.foundation.weak_ref.GetWeakProxy``.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
2.3.0
|
|
13
|
+
-----
|
|
14
|
+
|
|
15
|
+
Not released due to a problem during deploy.
|
|
16
|
+
|
|
1
17
|
2.2.0
|
|
2
18
|
-----
|
|
3
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: oop-ext
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.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
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/x-rst
|
|
18
19
|
License-File: LICENSE
|
|
19
20
|
Requires-Dist: attrs
|
|
20
21
|
Provides-Extra: docs
|
|
@@ -29,6 +30,19 @@ Requires-Dist: pytest-mock; extra == "testing"
|
|
|
29
30
|
Requires-Dist: pre-commit; extra == "testing"
|
|
30
31
|
Requires-Dist: tox; extra == "testing"
|
|
31
32
|
Requires-Dist: mypy; extra == "testing"
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: author-email
|
|
35
|
+
Dynamic: classifier
|
|
36
|
+
Dynamic: description
|
|
37
|
+
Dynamic: description-content-type
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: keywords
|
|
40
|
+
Dynamic: license
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: provides-extra
|
|
43
|
+
Dynamic: requires-dist
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
Dynamic: summary
|
|
32
46
|
|
|
33
47
|
======================================================================
|
|
34
48
|
OOP Extensions
|
|
@@ -157,11 +171,30 @@ Note that the VERSION should follow the semantic versioning as ``X.Y.Z`` (e.g. `
|
|
|
157
171
|
|
|
158
172
|
1. Create a ``release-VERSION`` branch from ``upstream/master``.
|
|
159
173
|
2. Update ``CHANGELOG.rst``.
|
|
160
|
-
3. Push
|
|
161
|
-
4. Once all
|
|
174
|
+
3. Push the branch to ``upstream``.
|
|
175
|
+
4. Once all tests pass, start the ``deploy`` workflow manually or via::
|
|
176
|
+
|
|
177
|
+
gh workflow run deploy.yml --repo ESSS/oop-ext --ref release-VERSION -f version=VERSION
|
|
178
|
+
|
|
162
179
|
5. Merge the PR.
|
|
163
180
|
|
|
164
181
|
|
|
182
|
+
2.3.1
|
|
183
|
+
-----
|
|
184
|
+
|
|
185
|
+
**Release**: 2025-08-01
|
|
186
|
+
|
|
187
|
+
* Fix type annotations:
|
|
188
|
+
* ``oop_ext.foundation.weak_ref.IsWeakProxy``.
|
|
189
|
+
* ``oop_ext.foundation.weak_ref.IsWeakRef``.
|
|
190
|
+
* ``oop_ext.foundation.weak_ref.GetWeakProxy``.
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
2.3.0
|
|
194
|
+
-----
|
|
195
|
+
|
|
196
|
+
Not released due to a problem during deploy.
|
|
197
|
+
|
|
165
198
|
2.2.0
|
|
166
199
|
-----
|
|
167
200
|
|
|
@@ -125,6 +125,9 @@ Note that the VERSION should follow the semantic versioning as ``X.Y.Z`` (e.g. `
|
|
|
125
125
|
|
|
126
126
|
1. Create a ``release-VERSION`` branch from ``upstream/master``.
|
|
127
127
|
2. Update ``CHANGELOG.rst``.
|
|
128
|
-
3. Push
|
|
129
|
-
4. Once all
|
|
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
|
+
|
|
130
133
|
5. Merge the PR.
|
|
@@ -92,11 +92,11 @@ def testGeneral() -> None:
|
|
|
92
92
|
assert IsWeakRef(r)
|
|
93
93
|
assert not IsWeakProxy(r)
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
assert callable(
|
|
97
|
-
|
|
98
|
-
assert IsWeakProxy(
|
|
99
|
-
assert not IsWeakRef(
|
|
95
|
+
r_method = GetWeakProxy(b.Method)
|
|
96
|
+
assert callable(r_method)
|
|
97
|
+
r_method()
|
|
98
|
+
assert IsWeakProxy(r_method)
|
|
99
|
+
assert not IsWeakRef(r_method)
|
|
100
100
|
|
|
101
101
|
r = weakref.ref(b)
|
|
102
102
|
b2 = _Stub()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# mypy: disallow-untyped-defs
|
|
2
2
|
"""
|
|
3
|
-
|
|
3
|
+
Defines types and functions to generate immutable structures.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
USER: The cache-manager uses this module to generate a valid KEY for its cache dictionary.
|
|
6
6
|
"""
|
|
7
7
|
from typing import Any
|
|
8
8
|
from typing import Dict
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# mypy: disallow-untyped-defs
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
2
4
|
from types import LambdaType
|
|
3
5
|
from types import MethodType
|
|
4
6
|
from typing import Any
|
|
5
7
|
from typing import Generic
|
|
6
|
-
from typing import List
|
|
7
|
-
from typing import Optional
|
|
8
|
-
from typing import Set
|
|
9
8
|
from typing import TypeVar
|
|
10
9
|
from typing import Union
|
|
11
10
|
from typing import cast
|
|
@@ -16,6 +15,7 @@ import weakref
|
|
|
16
15
|
from collections.abc import Callable
|
|
17
16
|
from collections.abc import Iterable
|
|
18
17
|
from collections.abc import Iterator
|
|
18
|
+
from typing_extensions import TypeGuard
|
|
19
19
|
from weakref import ReferenceType
|
|
20
20
|
|
|
21
21
|
from oop_ext.foundation.decorators import Implements
|
|
@@ -317,16 +317,16 @@ class WeakSet(Generic[T]):
|
|
|
317
317
|
return "\n".join(str(x) for x in self)
|
|
318
318
|
|
|
319
319
|
|
|
320
|
-
def IsWeakProxy(obj:
|
|
320
|
+
def IsWeakProxy(obj: T) -> TypeGuard[weakref.ProxyType[T]]:
|
|
321
321
|
"""
|
|
322
|
-
Returns whether the given object is a weak-proxy
|
|
322
|
+
Returns whether the given object is a weak-proxy.
|
|
323
323
|
"""
|
|
324
324
|
return isinstance(obj, (weakref.ProxyType, WeakMethodProxy))
|
|
325
325
|
|
|
326
326
|
|
|
327
|
-
def IsWeakRef(obj:
|
|
327
|
+
def IsWeakRef(obj: T) -> TypeGuard[weakref.ReferenceType[T]]:
|
|
328
328
|
"""
|
|
329
|
-
Returns
|
|
329
|
+
Returns whether ths given object is a weak-reference.
|
|
330
330
|
"""
|
|
331
331
|
return isinstance(obj, (weakref.ReferenceType, WeakMethodRef)) and not isinstance(
|
|
332
332
|
obj, WeakMethodProxy
|
|
@@ -354,7 +354,7 @@ def GetRealObj(obj: Any) -> Any:
|
|
|
354
354
|
return obj
|
|
355
355
|
|
|
356
356
|
|
|
357
|
-
def GetWeakProxy(obj:
|
|
357
|
+
def GetWeakProxy(obj: T) -> weakref.ProxyType[T]:
|
|
358
358
|
"""
|
|
359
359
|
:param obj: This is the object we want to get as a proxy
|
|
360
360
|
:return:
|
|
@@ -362,17 +362,18 @@ def GetWeakProxy(obj: Any) -> Any:
|
|
|
362
362
|
is returned itself)
|
|
363
363
|
"""
|
|
364
364
|
if obj is None:
|
|
365
|
-
return
|
|
365
|
+
return obj # type:ignore[return-value]
|
|
366
366
|
|
|
367
367
|
if not IsWeakProxy(obj):
|
|
368
368
|
if IsWeakRef(obj):
|
|
369
|
-
|
|
369
|
+
real_obj = obj()
|
|
370
|
+
else:
|
|
371
|
+
real_obj = obj
|
|
370
372
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return WeakMethodProxy(obj)
|
|
373
|
+
if inspect.ismethod(real_obj):
|
|
374
|
+
return WeakMethodProxy(real_obj) # type:ignore[return-value]
|
|
374
375
|
|
|
375
|
-
return weakref.proxy(
|
|
376
|
+
return weakref.proxy(real_obj)
|
|
376
377
|
|
|
377
378
|
return obj
|
|
378
379
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
Interfaces module.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
A Interface describes a behaviour that some objects must implement.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
To declare a interface, just subclass from Interface::
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
class IFoo(interface.Interface):
|
|
9
|
+
...
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
To create a class that implements that interface, use interface.Implements:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
class Foo(object):
|
|
14
|
+
interface.Implements(IFoo)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
If Foo doesn't implement some method from IFoo, an exception is raised at class creation time.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
from ._adaptable_interface import IAdaptable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: oop-ext
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.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
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/x-rst
|
|
18
19
|
License-File: LICENSE
|
|
19
20
|
Requires-Dist: attrs
|
|
20
21
|
Provides-Extra: docs
|
|
@@ -29,6 +30,19 @@ Requires-Dist: pytest-mock; extra == "testing"
|
|
|
29
30
|
Requires-Dist: pre-commit; extra == "testing"
|
|
30
31
|
Requires-Dist: tox; extra == "testing"
|
|
31
32
|
Requires-Dist: mypy; extra == "testing"
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: author-email
|
|
35
|
+
Dynamic: classifier
|
|
36
|
+
Dynamic: description
|
|
37
|
+
Dynamic: description-content-type
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: keywords
|
|
40
|
+
Dynamic: license
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: provides-extra
|
|
43
|
+
Dynamic: requires-dist
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
Dynamic: summary
|
|
32
46
|
|
|
33
47
|
======================================================================
|
|
34
48
|
OOP Extensions
|
|
@@ -157,11 +171,30 @@ Note that the VERSION should follow the semantic versioning as ``X.Y.Z`` (e.g. `
|
|
|
157
171
|
|
|
158
172
|
1. Create a ``release-VERSION`` branch from ``upstream/master``.
|
|
159
173
|
2. Update ``CHANGELOG.rst``.
|
|
160
|
-
3. Push
|
|
161
|
-
4. Once all
|
|
174
|
+
3. Push the branch to ``upstream``.
|
|
175
|
+
4. Once all tests pass, start the ``deploy`` workflow manually or via::
|
|
176
|
+
|
|
177
|
+
gh workflow run deploy.yml --repo ESSS/oop-ext --ref release-VERSION -f version=VERSION
|
|
178
|
+
|
|
162
179
|
5. Merge the PR.
|
|
163
180
|
|
|
164
181
|
|
|
182
|
+
2.3.1
|
|
183
|
+
-----
|
|
184
|
+
|
|
185
|
+
**Release**: 2025-08-01
|
|
186
|
+
|
|
187
|
+
* Fix type annotations:
|
|
188
|
+
* ``oop_ext.foundation.weak_ref.IsWeakProxy``.
|
|
189
|
+
* ``oop_ext.foundation.weak_ref.IsWeakRef``.
|
|
190
|
+
* ``oop_ext.foundation.weak_ref.GetWeakProxy``.
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
2.3.0
|
|
194
|
+
-----
|
|
195
|
+
|
|
196
|
+
Not released due to a problem during deploy.
|
|
197
|
+
|
|
165
198
|
2.2.0
|
|
166
199
|
-----
|
|
167
200
|
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
name: build
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
tags:
|
|
8
|
-
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
9
|
-
|
|
10
|
-
pull_request:
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
|
|
15
|
-
runs-on: ${{ matrix.os }}
|
|
16
|
-
|
|
17
|
-
strategy:
|
|
18
|
-
fail-fast: false
|
|
19
|
-
matrix:
|
|
20
|
-
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
21
|
-
os: [ubuntu-latest, windows-latest]
|
|
22
|
-
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v4.2.1
|
|
25
|
-
- name: Set up Python
|
|
26
|
-
uses: actions/setup-python@v5.2.0
|
|
27
|
-
with:
|
|
28
|
-
python-version: ${{ matrix.python }}
|
|
29
|
-
- name: Install tox
|
|
30
|
-
run: |
|
|
31
|
-
python -m pip install --upgrade pip
|
|
32
|
-
pip install tox
|
|
33
|
-
- name: Test
|
|
34
|
-
run: |
|
|
35
|
-
tox -e py
|
|
36
|
-
- name: Upload coverage reports to Codecov
|
|
37
|
-
uses: codecov/codecov-action@v4.0.1
|
|
38
|
-
with:
|
|
39
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
|
40
|
-
fail_ci_if_error: true
|
|
41
|
-
|
|
42
|
-
deploy:
|
|
43
|
-
|
|
44
|
-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
|
|
45
|
-
|
|
46
|
-
runs-on: ubuntu-latest
|
|
47
|
-
|
|
48
|
-
needs: build
|
|
49
|
-
|
|
50
|
-
steps:
|
|
51
|
-
- uses: actions/checkout@v4.2.1
|
|
52
|
-
- name: Set up Python
|
|
53
|
-
uses: actions/setup-python@v5.2.0
|
|
54
|
-
with:
|
|
55
|
-
python-version: "3.x"
|
|
56
|
-
- name: Install wheel
|
|
57
|
-
run: |
|
|
58
|
-
python -m pip install --upgrade pip
|
|
59
|
-
pip install build
|
|
60
|
-
- name: Build package
|
|
61
|
-
run: |
|
|
62
|
-
python -m build
|
|
63
|
-
- name: Publish package to PyPI
|
|
64
|
-
uses: pypa/gh-action-pypi-publish@v1.10.3
|
|
65
|
-
with:
|
|
66
|
-
user: __token__
|
|
67
|
-
password: ${{ secrets.pypi_token }}
|
|
68
|
-
attestations: true
|
|
69
|
-
- name: GitHub Release
|
|
70
|
-
uses: softprops/action-gh-release@v2.0.8
|
|
71
|
-
with:
|
|
72
|
-
files: dist/*
|
|
73
|
-
|
|
74
|
-
sonarcloud:
|
|
75
|
-
|
|
76
|
-
runs-on: ubuntu-latest
|
|
77
|
-
|
|
78
|
-
steps:
|
|
79
|
-
- uses: actions/checkout@v4.2.1
|
|
80
|
-
with:
|
|
81
|
-
# Disabling shallow clone is recommended for improving relevancy of reporting
|
|
82
|
-
fetch-depth: 0
|
|
83
|
-
- name: SonarCloud Scan
|
|
84
|
-
uses: sonarsource/sonarcloud-github-action@master
|
|
85
|
-
env:
|
|
86
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
87
|
-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
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
|
|
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
|
{oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_priority_callback.py
RENAMED
|
File without changes
|
{oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_single_call_callback.py
RENAMED
|
File without changes
|
{oop_ext-2.2.0 → oop_ext-2.3.1}/src/oop_ext/foundation/callback/_tests/test_typed_callback.py
RENAMED
|
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
|