Python 3.11 Support (#647)

* Update tests

* Enable tests on 3.11

* Fix coverage config in tox.ini

* feat: re cythonize to support python 3.11 (#646)

* feat: re cythonize to support python 3.11

* misc: added tox env for python 3.11

* misc: add classifiers for python 3.11

* fix: skip tests for removed functions

* misc: CI updates for python 3.11

Co-authored-by: Roman Mogylatov <rmogilatov@gmail.com>

* Update tests and linters job

* Update test skip decorators

* Fix tox.ini

* Update 3.10 to be explicit string literal

* Move pypy3 to legacy job

* Fix error in resourse typing test

* Update publishing job

* Update actions and setup-python versions

* Update changelog

* Update pypy

* Update tox.ini with new pypy versions

* Update publishing job

* Update actions/upload-artifact@v3

* Update ubuntu to 22.04 on docs publishing job

* Update actions/download-artifact@v3 and pypa/gh-action-pypi-publish@release/v1

Co-authored-by: Gen Xu <xgbarry@gmail.com>
This commit is contained in:
Roman Mogylatov 2022-12-18 21:09:14 -05:00 committed by GitHub
parent 3858cef657
commit aaff333f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 237 additions and 67 deletions

View File

@ -1,6 +1,7 @@
name: Publishing name: Publishing
on: on:
workflow_dispatch:
push: push:
tags: tags:
- '*' - '*'
@ -9,28 +10,28 @@ jobs:
tests: tests:
name: Run tests name: Run tests
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: pip install tox - run: pip install tox
- run: tox - run: tox
env: env:
TOXENV: "3.10" TOXENV: 3.11
linters: linters:
name: Run linters name: Run linters
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
toxenv: [flake8, pydocstyle, mypy, pylint] toxenv: [flake8, pydocstyle, mypy, pylint]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: pip install tox - run: pip install tox
- run: tox - run: tox
env: env:
@ -39,14 +40,14 @@ jobs:
build-sdist: build-sdist:
name: Build source tarball name: Build source tarball
needs: [tests, linters] needs: [tests, linters]
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: python setup.py sdist - run: python setup.py sdist
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
path: ./dist/* path: ./dist/*
@ -56,47 +57,44 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15] os: [ubuntu-22.04, windows-2019, macos-11]
env: env:
CIBW_SKIP: cp27-win* CIBW_SKIP: cp27-win*
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - name: Build wheels
with: uses: pypa/cibuildwheel@v2.11.3
python-version: "3.10" - uses: actions/upload-artifact@v3
- run: pip install cibuildwheel==2.1.3
- run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with: with:
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl
build-wheels-linux-aarch64: build-wheels-linux-aarch64:
name: Build wheels (ubuntu-latest-aarch64) name: Build wheels (ubuntu-22.04-aarch64)
needs: [tests, linters] needs: [tests, linters]
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 if: runner.os == 'Linux'
- uses: actions/setup-python@v2 uses: docker/setup-qemu-action@v2
with: - name: Build wheels
python-version: "3.10" uses: pypa/cibuildwheel@v2.11.3
- run: pip install cibuildwheel==2.1.3 env:
- run: cibuildwheel --archs aarch64 --output-dir wheelhouse CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v3
with: with:
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl
publish: publish:
name: Publish on PyPI name: Publish on PyPI
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64] needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: with:
name: artifact name: artifact
path: dist path: dist
- uses: pypa/gh-action-pypi-publish@master - uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__ user: __token__
password: ${{ secrets.PYPI_API_TOKEN }} password: ${{ secrets.PYPI_API_TOKEN }}
@ -107,12 +105,12 @@ jobs:
publish-docs: publish-docs:
name: Publish docs name: Publish docs
needs: [publish] needs: [publish]
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: pip install -r requirements-doc.txt - run: pip install -r requirements-doc.txt
- run: pip install awscli - run: pip install awscli
- run: pip install -e . - run: pip install -e .

View File

@ -4,15 +4,31 @@ on: [push, pull_request, workflow_dispatch]
jobs: jobs:
tests-on-legacy-versions:
name: Run tests on legacy versions
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, pypy2.7, pypy3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install tox
- run: tox
env:
TOXENV: ${{ matrix.python-version }}
test-on-different-versions: test-on-different-versions:
name: Run tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10", pypy2, pypy3] python-version: [3.8, 3.9, "3.10", 3.11]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- run: pip install tox - run: pip install tox
@ -28,10 +44,10 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: pip install tox cython - run: pip install tox cython
- run: make cythonize - run: make cythonize
- run: tox - run: tox
@ -45,10 +61,10 @@ jobs:
matrix: matrix:
toxenv: [flake8, pydocstyle, mypy, pylint] toxenv: [flake8, pydocstyle, mypy, pylint]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.11
- run: pip install tox - run: pip install tox
- run: tox - run: tox
env: env:

View File

@ -7,6 +7,14 @@ that were made in every particular version.
From version 0.7.6 *Dependency Injector* framework strictly From version 0.7.6 *Dependency Injector* framework strictly
follows `Semantic versioning`_ follows `Semantic versioning`_
Development version
-------------------
- Add support of Python 3.11.
- Update CI/CD to use Ubuntu 22.04.
- Update CI/CD to ``actions/checkout@v3``, ``actions/setup-python@v4``, ``actions/upload-artifact@v3``, ``pypa/cibuildwheel@v2.11.3``,
and ``actions/download-artifact@v3``.
- Regenerate C sources using Cython 0.29.32.
4.40.0 4.40.0
------ ------
- Add ``Configuration.from_json()`` method to load configuration from a json file. - Add ``Configuration.from_json()`` method to load configuration from a json file.

View File

@ -1,4 +1,4 @@
cython==0.29.30 cython==0.29.32
pytest pytest
pytest-asyncio pytest-asyncio
tox tox

View File

@ -106,6 +106,7 @@ setup(name="dependency-injector",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: PyPy",
"Framework :: AsyncIO", "Framework :: AsyncIO",

View File

@ -1,4 +1,4 @@
/* Generated by Cython 0.29.30 */ /* Generated by Cython 0.29.32 */
#ifndef PY_SSIZE_T_CLEAN #ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
@ -9,8 +9,8 @@
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+. #error Cython requires Python 2.6+ or Python 3.3+.
#else #else
#define CYTHON_ABI "0_29_30" #define CYTHON_ABI "0_29_32"
#define CYTHON_HEX_VERSION 0x001D1EF0 #define CYTHON_HEX_VERSION 0x001D20F0
#define CYTHON_FUTURE_DIVISION 0 #define CYTHON_FUTURE_DIVISION 0
#include <stddef.h> #include <stddef.h>
#ifndef offsetof #ifndef offsetof
@ -49,6 +49,7 @@
#define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#undef CYTHON_USE_TYPE_SLOTS #undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0 #define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_PYTYPE_LOOKUP #undef CYTHON_USE_PYTYPE_LOOKUP
@ -92,6 +93,7 @@
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif
@ -132,10 +134,56 @@
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif #endif
#elif defined(PY_NOGIL)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#ifndef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#else #else
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif

View File

@ -1,4 +1,4 @@
/* Generated by Cython 0.29.30 */ /* Generated by Cython 0.29.32 */
#ifndef PY_SSIZE_T_CLEAN #ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
@ -9,8 +9,8 @@
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+. #error Cython requires Python 2.6+ or Python 3.3+.
#else #else
#define CYTHON_ABI "0_29_30" #define CYTHON_ABI "0_29_32"
#define CYTHON_HEX_VERSION 0x001D1EF0 #define CYTHON_HEX_VERSION 0x001D20F0
#define CYTHON_FUTURE_DIVISION 0 #define CYTHON_FUTURE_DIVISION 0
#include <stddef.h> #include <stddef.h>
#ifndef offsetof #ifndef offsetof
@ -49,6 +49,7 @@
#define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#undef CYTHON_USE_TYPE_SLOTS #undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0 #define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_PYTYPE_LOOKUP #undef CYTHON_USE_PYTYPE_LOOKUP
@ -92,6 +93,7 @@
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif
@ -132,10 +134,56 @@
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif #endif
#elif defined(PY_NOGIL)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#ifndef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#else #else
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif

View File

@ -1,4 +1,4 @@
/* Generated by Cython 0.29.30 */ /* Generated by Cython 0.29.32 */
#ifndef PY_SSIZE_T_CLEAN #ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
@ -9,8 +9,8 @@
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+. #error Cython requires Python 2.6+ or Python 3.3+.
#else #else
#define CYTHON_ABI "0_29_30" #define CYTHON_ABI "0_29_32"
#define CYTHON_HEX_VERSION 0x001D1EF0 #define CYTHON_HEX_VERSION 0x001D20F0
#define CYTHON_FUTURE_DIVISION 0 #define CYTHON_FUTURE_DIVISION 0
#include <stddef.h> #include <stddef.h>
#ifndef offsetof #ifndef offsetof
@ -49,6 +49,7 @@
#define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#undef CYTHON_USE_TYPE_SLOTS #undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0 #define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_PYTYPE_LOOKUP #undef CYTHON_USE_PYTYPE_LOOKUP
@ -92,6 +93,7 @@
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif
@ -132,10 +134,56 @@
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif #endif
#elif defined(PY_NOGIL)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#ifndef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#else #else
#define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS #ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1 #define CYTHON_USE_TYPE_SLOTS 1
#endif #endif

View File

@ -45,7 +45,7 @@ var4: List[int] = provider4()
# Test 5: to check the return type with async function # Test 5: to check the return type with async function
async def init5() -> List[int]: async def init5() -> List[int]:
... return []
provider5 = providers.Resource(init5) provider5 = providers.Resource(init5)

View File

@ -1,6 +1,7 @@
"""AbstractCoroutine provider tests.""" """AbstractCoroutine provider tests."""
import asyncio import asyncio
import sys
from dependency_injector import providers, errors from dependency_injector import providers, errors
from pytest import mark, raises from pytest import mark, raises
@ -12,6 +13,7 @@ def test_inheritance():
assert isinstance(providers.AbstractCoroutine(example), providers.Coroutine) assert isinstance(providers.AbstractCoroutine(example), providers.Coroutine)
@mark.skipif(sys.version_info >= (3, 11), reason="asyncio.coroutine removed in Python 3.11")
@mark.asyncio @mark.asyncio
@mark.filterwarnings("ignore") @mark.filterwarnings("ignore")
async def test_call_overridden_by_coroutine(): async def test_call_overridden_by_coroutine():
@ -26,6 +28,7 @@ async def test_call_overridden_by_coroutine():
assert result == (1, 2, 3, 4) assert result == (1, 2, 3, 4)
@mark.skipif(sys.version_info >= (3, 11), reason="asyncio.coroutine removed in Python 3.11")
@mark.asyncio @mark.asyncio
@mark.filterwarnings("ignore") @mark.filterwarnings("ignore")
async def test_call_overridden_by_delegated_coroutine(): async def test_call_overridden_by_delegated_coroutine():

10
tox.ini
View File

@ -1,6 +1,6 @@
[tox] [tox]
envlist= envlist=
coveralls, pylint, flake8, pydocstyle, 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, pypy2, pypy3 coveralls, pylint, flake8, pydocstyle, 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, pypy2.7, pypy3.9
[testenv] [testenv]
deps= deps=
@ -23,8 +23,8 @@ commands = pytest -c tests/.configs/pytest.ini
python_files = test_*_py3*.py python_files = test_*_py3*.py
[testenv:coveralls] [testenv:coveralls]
passenv = GITHUB_* COVERALLS_* passenv = GITHUB_*, COVERALLS_*
basepython=python3.10 basepython=python3.11
usedevelop=True usedevelop=True
deps= deps=
{[testenv]deps} {[testenv]deps}
@ -55,7 +55,7 @@ extras=
flask flask
commands = pytest -c tests/.configs/pytest-py35.ini commands = pytest -c tests/.configs/pytest-py35.ini
[testenv:pypy2] [testenv:pypy2.7]
deps= deps=
pytest pytest
extras= extras=
@ -63,7 +63,7 @@ extras=
flask flask
commands = pytest -c tests/.configs/pytest-py27.ini commands = pytest -c tests/.configs/pytest-py27.ini
[testenv:pypy3] [testenv:pypy3.9]
deps= deps=
pytest pytest
pytest-asyncio pytest-asyncio