Skip to content

Commit

Permalink
Merge branch 'develop' into method-calling-mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Sep 20, 2024
2 parents b281f61 + 9f42d9e commit 6860af7
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 65 deletions.
77 changes: 40 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ jobs:
python-version:
# - 2.7
# - 3.5
- 3.6
- 3.7
# - 3.6
# - 3.7
- 3.8
- 3.9
- "3.10"
- 3.11
- 3.12
- 3.13-dev
# - pypy-2.7
- pypy-3.8
- pypy-3.9
Expand Down Expand Up @@ -93,13 +94,14 @@ jobs:
python-version:
# - 2.7
# - 3.5
- 3.6
- 3.7
# - 3.6
# - 3.7
- 3.8
- 3.9
- "3.10"
- 3.11
- 3.12
- 3.13-dev
# - pypy-2.7
- pypy-3.8
- pypy-3.9
Expand Down Expand Up @@ -155,13 +157,14 @@ jobs:
- windows-latest
python-version:
# - 3.5
- 3.6
- 3.7
# - 3.6
# - 3.7
- 3.8
- 3.9
- "3.10"
- 3.11
- 3.12
- 3.13-dev
# - pypy-2.7
- pypy-3.8
- pypy-3.9
Expand Down Expand Up @@ -259,7 +262,7 @@ jobs:
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v2
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21.1
with:
output-dir: dist
env:
Expand All @@ -272,33 +275,33 @@ jobs:
name: dist
path: dist/*.whl

coveralls:
name: Generate code coverage report
if: ${{ false }} # disable for now
needs:
- test_linux
- test_macos
# - test_windows_py27
- test_windows
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install coverage package
run: python -m pip install -U coverage
- name: Download partial coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
- name: Combine coverage
run: python -m coverage combine
- name: Report coverage
run: python -m coverage report
- name: Export coverage to XML
run: python -m coverage xml
- name: Upload coverage statistics to Coveralls
uses: AndreMiras/coveralls-python-action@develop
# coveralls:
# name: Generate code coverage report
# if: ${{ false }} # disable for now
# needs:
# - test_linux
# - test_macos
# # - test_windows_py27
# - test_windows
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Setup Python 3.9
# uses: actions/setup-python@v4
# with:
# python-version: 3.9
# - name: Install coverage package
# run: python -m pip install -U coverage
# - name: Download partial coverage reports
# uses: actions/download-artifact@v3
# with:
# name: coverage
# - name: Combine coverage
# run: python -m coverage combine
# - name: Report coverage
# run: python -m coverage report
# - name: Export coverage to XML
# run: python -m coverage xml
# - name: Upload coverage statistics to Coveralls
# uses: AndreMiras/coveralls-python-action@develop
15 changes: 7 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: BSD License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
project_urls =
Expand All @@ -33,7 +32,7 @@ project_urls =

[options]
zip_safe = false
python_requires = >= 3.6
python_requires = >= 3.8
packages = find:
package_dir =
=src
Expand Down Expand Up @@ -70,19 +69,19 @@ norecursedirs = .tox venv

[tox:tox]
envlist =
py{36,37,38,39,310,311,312}
py{36,37,38,39,310,311,312}-{without,install,disable}-extensions,
py{38,39,310,311,312,313,314}
py{38,39,310,311,312,313,314}-{without,install,disable}-extensions,
pypy-without-extensions

[gh-actions]
python =
3.6: py36, py36-without-extensions, py36-install-extensions, py36-disable-extensions
3.7: py37, py37-without-extensions, py37-install-extensions, py37-disable-extensions
3.8: py38, py38-without-extensions, py38-install-extensions, py38-disable-extensions
3.9: py39, py39-without-extensions, py39-install-extensions, py39-disable-extensions
3.10: py310, py310-without-extensions, py310-install-extensions, py310-disable-extensions
3.11: py311, py311-without-extensions, py311-install-extensions, py311-disable-extensions
3.12: py312, py312-without-extensions, py312-install-extensions, py312-disable-extensions
3.13: py313, py313-without-extensions, py313-install-extensions, py313-disable-extensions
3.14: py314, py314-without-extensions, py314-install-extensions, py314-disable-extensions
pypy-3.8: pypy-without-extensions
pypy-3.9: pypy-without-extensions
pypy-3.10: pypy-without-extensions
Expand All @@ -92,7 +91,7 @@ deps =
coverage
pytest
install_command =
py311,py311-{without,install,disable}-extensions: python -m pip install --no-binary coverage {opts} {packages}
python -m pip install --no-binary coverage {opts} {packages}
commands =
python -m coverage run --rcfile {toxinidir}/setup.cfg -m pytest -v {posargs} {toxinidir}/tests
setenv =
Expand Down
18 changes: 10 additions & 8 deletions tests/test_outer_classmethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,20 @@ def test_class_call_function(self):
# first argument with the actual arguments following that. This
# was only finally fixed in Python 3.9. For more details see:
# https://bugs.python.org/issue19072
# Starting with Python 3.13 the old behavior is back.
# For more details see https://github.com/python/cpython/issues/89519

_args = (1, 2)
_kwargs = {'one': 1, 'two': 2}

@wrapt.decorator
def _decorator(wrapped, instance, args, kwargs):
if PYXY < (3, 9):
self.assertEqual(instance, None)
self.assertEqual(args, (Class,)+_args)
else:
if (3, 9) <= PYXY < (3, 13):
self.assertEqual(instance, Class)
self.assertEqual(args, _args)
else:
self.assertEqual(instance, None)
self.assertEqual(args, (Class,)+_args)

self.assertEqual(kwargs, _kwargs)
self.assertEqual(wrapped.__module__, _function.__module__)
Expand Down Expand Up @@ -176,12 +178,12 @@ def test_instance_call_function(self):

@wrapt.decorator
def _decorator(wrapped, instance, args, kwargs):
if PYXY < (3, 9):
self.assertEqual(instance, None)
self.assertEqual(args, (Class,)+_args)
else:
if (3, 9) <= PYXY < (3, 13):
self.assertEqual(instance, Class)
self.assertEqual(args, _args)
else:
self.assertEqual(instance, None)
self.assertEqual(args, (Class,)+_args)

self.assertEqual(kwargs, _kwargs)
self.assertEqual(wrapped.__module__, _function.__module__)
Expand Down
26 changes: 14 additions & 12 deletions tests/test_synchronized_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,36 +165,38 @@ def test_synchronized_outer_classmethod(self):
# function to the class before calling and just calls it direct,
# explicitly passing the class as first argument. For more
# details see: https://bugs.python.org/issue19072
# Starting with Python 3.13 the old behavior is back.
# For more details see https://github.com/python/cpython/issues/89519

if PYXY < (3, 9):
_lock0 = getattr(C4.function2, '_synchronized_lock', None)
else:
if (3, 9) <= PYXY < (3, 13):
_lock0 = getattr(C4, '_synchronized_lock', None)
else:
_lock0 = getattr(C4.function2, '_synchronized_lock', None)
self.assertEqual(_lock0, None)

c4.function2()

if PYXY < (3, 9):
_lock1 = getattr(C4.function2, '_synchronized_lock', None)
else:
if (3, 9) <= PYXY < (3, 13):
_lock1 = getattr(C4, '_synchronized_lock', None)
else:
_lock1 = getattr(C4.function2, '_synchronized_lock', None)
self.assertNotEqual(_lock1, None)

C4.function2()

if PYXY < (3, 9):
_lock2 = getattr(C4.function2, '_synchronized_lock', None)
else:
if (3, 9) <= PYXY < (3, 13):
_lock2 = getattr(C4, '_synchronized_lock', None)
else:
_lock2 = getattr(C4.function2, '_synchronized_lock', None)
self.assertNotEqual(_lock2, None)
self.assertEqual(_lock2, _lock1)

C4.function2()

if PYXY < (3, 9):
_lock3 = getattr(C4.function2, '_synchronized_lock', None)
else:
if (3, 9) <= PYXY < (3, 13):
_lock3 = getattr(C4, '_synchronized_lock', None)
else:
_lock3 = getattr(C4.function2, '_synchronized_lock', None)
self.assertNotEqual(_lock3, None)
self.assertEqual(_lock3, _lock2)

Expand Down

0 comments on commit 6860af7

Please sign in to comment.