mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-06 21:33:31 +03:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6a04d79bdd | ||
|
84e7ac7bf0 | ||
|
cb559c8b6a | ||
|
7c5d0b21d8 | ||
|
d460e37128 | ||
|
cd1c227662 | ||
|
beb1f30a48 | ||
|
11cf80c6d0 | ||
|
d635708a2a |
37
.github/workflows/publishing.yml
vendored
37
.github/workflows/publishing.yml
vendored
|
@ -62,20 +62,26 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2019, macos-14]
|
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2019, macos-14]
|
||||||
env:
|
env:
|
||||||
CIBW_SKIP: cp27-*
|
CIBW_ENABLE: pypy
|
||||||
|
CIBW_ENVIRONMENT: >-
|
||||||
|
PIP_CONFIG_SETTINGS="build_ext=-j4"
|
||||||
|
DEPENDENCY_INJECTOR_LIMITED_API="1"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: pypa/cibuildwheel@v2.20.0
|
uses: pypa/cibuildwheel@v2.23.3
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: cibw-wheels-x86-${{ matrix.os }}-${{ strategy.job-index }}
|
name: cibw-wheels-x86-${{ matrix.os }}-${{ strategy.job-index }}
|
||||||
path: ./wheelhouse/*.whl
|
path: ./wheelhouse/*.whl
|
||||||
|
|
||||||
publish:
|
test-publish:
|
||||||
name: Publish on PyPI
|
name: Upload release to TestPyPI
|
||||||
needs: [build-sdist, build-wheels]
|
needs: [build-sdist, build-wheels]
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-latest
|
||||||
|
environment: test-pypi
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -84,11 +90,22 @@ jobs:
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
with:
|
||||||
user: __token__
|
repository-url: https://test.pypi.org/legacy/
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
# For publishing to Test PyPI, uncomment next two lines:
|
publish:
|
||||||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
name: Upload release to PyPI
|
||||||
# repository_url: https://test.pypi.org/legacy/
|
needs: [build-sdist, build-wheels, test-publish]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: pypi
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: cibw-*
|
||||||
|
path: dist
|
||||||
|
merge-multiple: true
|
||||||
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
|
||||||
publish-docs:
|
publish-docs:
|
||||||
name: Publish docs
|
name: Publish docs
|
||||||
|
|
2
.github/workflows/tests-and-linters.yml
vendored
2
.github/workflows/tests-and-linters.yml
vendored
|
@ -44,7 +44,7 @@ jobs:
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.12
|
python-version: 3.12
|
||||||
- run: pip install tox 'cython>=3,<4'
|
- run: pip install tox
|
||||||
- run: tox -vv
|
- run: tox -vv
|
||||||
env:
|
env:
|
||||||
TOXENV: coveralls
|
TOXENV: coveralls
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -15,6 +15,7 @@ lib64/
|
||||||
parts/
|
parts/
|
||||||
sdist/
|
sdist/
|
||||||
var/
|
var/
|
||||||
|
wheelhouse/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
recursive-include src/dependency_injector *.py* *.c
|
recursive-include src/dependency_injector *.py* *.c py.typed
|
||||||
recursive-include tests *.py
|
recursive-include tests *.py
|
||||||
include README.rst
|
include README.rst
|
||||||
include CONTRIBUTORS.rst
|
include CONTRIBUTORS.rst
|
||||||
include LICENSE.rst
|
include LICENSE.rst
|
||||||
include requirements.txt
|
|
||||||
include setup.py
|
include setup.py
|
||||||
include tox.ini
|
include tox.ini
|
||||||
include py.typed
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools", "Cython"]
|
requires = ["setuptools", "Cython>=3.1.1"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
|
@ -102,6 +102,7 @@ max-public-methods = 30
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = ["tests/unit/"]
|
testpaths = ["tests/unit/"]
|
||||||
asyncio_mode = "auto"
|
asyncio_mode = "auto"
|
||||||
|
asyncio_default_fixture_loop_scope = "function"
|
||||||
markers = [
|
markers = [
|
||||||
"pydantic: Tests with Pydantic as a dependency",
|
"pydantic: Tests with Pydantic as a dependency",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
cython==3.1.0
|
cython==3.1.1
|
||||||
setuptools
|
setuptools
|
||||||
pytest
|
pytest
|
||||||
pytest-asyncio
|
pytest-asyncio
|
||||||
|
@ -13,7 +13,8 @@ mypy
|
||||||
pyyaml
|
pyyaml
|
||||||
httpx
|
httpx
|
||||||
fastapi
|
fastapi
|
||||||
pydantic==1.10.17
|
pydantic
|
||||||
|
pydantic-settings
|
||||||
numpy
|
numpy
|
||||||
scipy
|
scipy
|
||||||
boto3
|
boto3
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -1,13 +1,17 @@
|
||||||
"""`Dependency injector` setup script."""
|
"""`Dependency injector` setup script."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
from Cython.Compiler import Options
|
from Cython.Compiler import Options
|
||||||
from setuptools import Extension, setup
|
from setuptools import Extension, setup
|
||||||
|
|
||||||
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
|
debug = os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1"
|
||||||
limited_api = os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
|
limited_api = (
|
||||||
|
os.environ.get("DEPENDENCY_INJECTOR_LIMITED_API") == "1"
|
||||||
|
and sys.implementation.name == "cpython"
|
||||||
|
)
|
||||||
defined_macros = []
|
defined_macros = []
|
||||||
options = {}
|
options = {}
|
||||||
compiler_directives = {
|
compiler_directives = {
|
||||||
|
@ -31,7 +35,7 @@ if debug:
|
||||||
if limited_api:
|
if limited_api:
|
||||||
options.setdefault("bdist_wheel", {})
|
options.setdefault("bdist_wheel", {})
|
||||||
options["bdist_wheel"]["py_limited_api"] = "cp38"
|
options["bdist_wheel"]["py_limited_api"] = "cp38"
|
||||||
defined_macros.append(("Py_LIMITED_API", 0x03080000))
|
defined_macros.append(("Py_LIMITED_API", "0x03080000"))
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
options=options,
|
options=options,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Top-level package."""
|
"""Top-level package."""
|
||||||
|
|
||||||
__version__ = "4.46.0"
|
__version__ = "4.47.0a3"
|
||||||
"""Version number.
|
"""Version number.
|
||||||
|
|
||||||
:type: str
|
:type: str
|
||||||
|
|
19
tox.ini
19
tox.ini
|
@ -1,7 +1,7 @@
|
||||||
[tox]
|
[tox]
|
||||||
parallel_show_output = true
|
parallel_show_output = true
|
||||||
envlist=
|
envlist=
|
||||||
coveralls, pylint, flake8, pydocstyle, pydantic-v1, pydantic-v2, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10
|
coveralls, pylint, flake8, pydocstyle, pydantic-v1, pydantic-v2, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.9, pypy3.10, pypy3.11
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps=
|
deps=
|
||||||
|
@ -20,7 +20,6 @@ deps=
|
||||||
extras=
|
extras=
|
||||||
yaml
|
yaml
|
||||||
commands = pytest
|
commands = pytest
|
||||||
python_files = test_*_py3*.py
|
|
||||||
setenv =
|
setenv =
|
||||||
COVERAGE_RCFILE = pyproject.toml
|
COVERAGE_RCFILE = pyproject.toml
|
||||||
|
|
||||||
|
@ -61,22 +60,6 @@ commands=
|
||||||
coverage report
|
coverage report
|
||||||
coveralls
|
coveralls
|
||||||
|
|
||||||
[testenv:pypy3.9]
|
|
||||||
deps=
|
|
||||||
pytest
|
|
||||||
pytest-asyncio
|
|
||||||
httpx
|
|
||||||
flask
|
|
||||||
pydantic-settings
|
|
||||||
werkzeug
|
|
||||||
fastapi
|
|
||||||
boto3
|
|
||||||
mypy_boto3_s3
|
|
||||||
extras=
|
|
||||||
yaml
|
|
||||||
commands = pytest
|
|
||||||
|
|
||||||
|
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
deps=
|
deps=
|
||||||
pylint
|
pylint
|
||||||
|
|
Loading…
Reference in New Issue
Block a user