Skip to content

Commit b52ce21

Browse files
authored
Merge branch 'develop' into annotated
2 parents 91c90cf + 29ae3e1 commit b52ce21

File tree

109 files changed

+2054
-210418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2054
-210418
lines changed

Diff for: .coveragerc

-10
This file was deleted.

Diff for: .github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: rmk135

Diff for: .github/workflows/publishing.yml

+25-37
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ jobs:
1010

1111
tests:
1212
name: Run tests
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.11
18+
python-version: 3.13
1919
- run: pip install tox
2020
- run: tox
2121
env:
22-
TOXENV: 3.11
22+
TOXENV: 3.13
2323

2424
linters:
2525
name: Run linters
26-
runs-on: ubuntu-22.04
26+
runs-on: ubuntu-24.04
2727
strategy:
2828
matrix:
2929
toxenv: [flake8, pydocstyle, mypy, pylint]
3030
steps:
3131
- uses: actions/checkout@v3
3232
- uses: actions/setup-python@v4
3333
with:
34-
python-version: 3.11
34+
python-version: 3.13
3535
- run: pip install tox
3636
- run: tox
3737
env:
@@ -40,15 +40,18 @@ jobs:
4040
build-sdist:
4141
name: Build source tarball
4242
needs: [tests, linters]
43-
runs-on: ubuntu-22.04
43+
runs-on: ubuntu-24.04
4444
steps:
4545
- uses: actions/checkout@v3
4646
- uses: actions/setup-python@v4
4747
with:
48-
python-version: 3.11
49-
- run: python setup.py sdist
50-
- uses: actions/upload-artifact@v3
48+
python-version: 3.13
49+
- run: |
50+
python -m pip install --upgrade build
51+
python -m build --sdist
52+
- uses: actions/upload-artifact@v4
5153
with:
54+
name: cibw-sdist
5255
path: ./dist/*
5356

5457
build-wheels:
@@ -57,43 +60,28 @@ jobs:
5760
runs-on: ${{ matrix.os }}
5861
strategy:
5962
matrix:
60-
os: [ubuntu-22.04, windows-2019, macos-11]
63+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2019, macos-14]
6164
env:
62-
CIBW_SKIP: cp27-win*
65+
CIBW_SKIP: cp27-*
6366
steps:
6467
- uses: actions/checkout@v3
6568
- name: Build wheels
66-
uses: pypa/[email protected]
67-
- uses: actions/upload-artifact@v3
68-
with:
69-
path: ./wheelhouse/*.whl
70-
71-
build-wheels-linux-aarch64:
72-
name: Build wheels (ubuntu-22.04-aarch64)
73-
needs: [tests, linters]
74-
runs-on: ubuntu-22.04
75-
steps:
76-
- uses: actions/checkout@v3
77-
- name: Set up QEMU
78-
if: runner.os == 'Linux'
79-
uses: docker/setup-qemu-action@v2
80-
- name: Build wheels
81-
uses: pypa/[email protected]
82-
env:
83-
CIBW_ARCHS_LINUX: aarch64
84-
- uses: actions/upload-artifact@v3
69+
uses: pypa/[email protected]
70+
- uses: actions/upload-artifact@v4
8571
with:
72+
name: cibw-wheels-x86-${{ matrix.os }}-${{ strategy.job-index }}
8673
path: ./wheelhouse/*.whl
8774

8875
publish:
8976
name: Publish on PyPI
90-
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
91-
runs-on: ubuntu-22.04
77+
needs: [build-sdist, build-wheels]
78+
runs-on: ubuntu-24.04
9279
steps:
93-
- uses: actions/download-artifact@v3
80+
- uses: actions/download-artifact@v4
9481
with:
95-
name: artifact
82+
pattern: cibw-*
9683
path: dist
84+
merge-multiple: true
9785
- uses: pypa/gh-action-pypi-publish@release/v1
9886
with:
9987
user: __token__
@@ -105,14 +93,14 @@ jobs:
10593
publish-docs:
10694
name: Publish docs
10795
needs: [publish]
108-
runs-on: ubuntu-22.04
96+
runs-on: ubuntu-24.04
10997
steps:
11098
- uses: actions/checkout@v3
11199
- uses: actions/setup-python@v4
112100
with:
113-
python-version: 3.11
114-
- run: pip install -r requirements-doc.txt
101+
python-version: 3.13
115102
- run: pip install awscli
103+
- run: pip install -r requirements-doc.txt
116104
- run: pip install -e .
117105
- run: (cd docs && make clean html)
118106
- run: |

Diff for: .github/workflows/tests-and-linters.yml

+18-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-20.04
1010
strategy:
1111
matrix:
12-
python-version: [2.7, 3.5, 3.6, 3.7, pypy2.7, pypy3.9]
12+
python-version: [3.7]
1313
steps:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-python@v4
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
python-version: [3.8, 3.9, "3.10", 3.11]
28+
python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13]
2929
steps:
3030
- uses: actions/checkout@v3
3131
- uses: actions/setup-python@v4
@@ -36,21 +36,32 @@ jobs:
3636
env:
3737
TOXENV: ${{ matrix.python-version }}
3838

39+
test-different-pydantic-versions:
40+
name: Run tests with different pydantic versions
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- uses: actions/setup-python@v4
45+
with:
46+
python-version: "3.12"
47+
- run: pip install tox
48+
- run: tox -e pydantic-v1,pydantic-v2
49+
3950
test-coverage:
4051
name: Run tests with coverage
4152
runs-on: ubuntu-latest
4253
env:
4354
DEPENDENCY_INJECTOR_DEBUG_MODE: 1
55+
PIP_VERBOSE: 1
4456
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
4557
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4658
steps:
4759
- uses: actions/checkout@v3
4860
- uses: actions/setup-python@v4
4961
with:
50-
python-version: 3.11
51-
- run: pip install tox cython
52-
- run: make cythonize
53-
- run: tox
62+
python-version: 3.12
63+
- run: pip install tox 'cython>=3,<4'
64+
- run: tox -vv
5465
env:
5566
TOXENV: coveralls
5667

@@ -64,7 +75,7 @@ jobs:
6475
- uses: actions/checkout@v3
6576
- uses: actions/setup-python@v4
6677
with:
67-
python-version: 3.11
78+
python-version: 3.13
6879
- run: pip install tox
6980
- run: tox
7081
env:

Diff for: .gitignore

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ venv*/
6363
# Vim Rope
6464
.ropeproject/
6565

66-
# C extensions
67-
src/dependency_injector/*.h
68-
src/dependency_injector/*.so
69-
src/dependency_injector/containers/*.h
70-
src/dependency_injector/containers/*.so
71-
src/dependency_injector/providers/*.h
72-
src/dependency_injector/providers/*.so
66+
# Cython artifacts
67+
src/**/*.c
68+
src/**/*.h
69+
src/**/*.so
70+
src/**/*.html
7371

7472
# Workspace for samples
7573
.workspace/
74+
75+
.vscode/

Diff for: .pylintrc

-49
This file was deleted.

Diff for: CONTRIBUTORS.rst

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ Dependency Injector Contributors
2020
+ Ngo Thanh Loi (Leonn) (loingo95)
2121
+ Thiago Hiromi (thiromi)
2222
+ Felipe Rubio (krouw)
23+
+ Anton Petrov (anton-petrov)
24+
+ ZipFile (ZipFile)

Diff for: LICENSE.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022, Roman Mogylatov
1+
Copyright (c) 2024, Roman Mogylatov
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

Diff for: Makefile

+10-22
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
VERSION := $(shell python setup.py --version)
22

3-
CYTHON_SRC := $(shell find src/dependency_injector -name '*.pyx')
4-
5-
CYTHON_DIRECTIVES = -Xlanguage_level=2
6-
7-
ifdef DEPENDENCY_INJECTOR_DEBUG_MODE
8-
CYTHON_DIRECTIVES += -Xprofile=True
9-
CYTHON_DIRECTIVES += -Xlinetrace=True
10-
endif
11-
3+
export COVERAGE_RCFILE := pyproject.toml
124

135
clean:
146
# Clean sources
@@ -25,21 +17,17 @@ clean:
2517
find examples -name '*.py[co]' -delete
2618
find examples -name '__pycache__' -delete
2719

28-
cythonize:
29-
# Compile Cython to C
30-
cython -a $(CYTHON_DIRECTIVES) $(CYTHON_SRC)
20+
build: clean
21+
# Compile C extensions
22+
python setup.py build_ext --inplace
3123
# Move all Cython html reports
3224
mkdir -p reports/cython/
3325
find src -name '*.html' -exec mv {} reports/cython/ \;
3426

35-
build: clean cythonize
36-
# Compile C extensions
37-
python setup.py build_ext --inplace
38-
3927
docs-live:
4028
sphinx-autobuild docs docs/_build/html
4129

42-
install: uninstall clean cythonize
30+
install: uninstall clean build
4331
pip install -ve .
4432

4533
uninstall:
@@ -48,9 +36,9 @@ uninstall:
4836
test:
4937
# Unit tests with coverage report
5038
coverage erase
51-
coverage run --rcfile=./.coveragerc -m pytest -c tests/.configs/pytest.ini
52-
coverage report --rcfile=./.coveragerc
53-
coverage html --rcfile=./.coveragerc
39+
coverage run -m pytest -c tests/.configs/pytest.ini
40+
coverage report
41+
coverage html
5442

5543
check:
5644
flake8 src/dependency_injector/
@@ -61,9 +49,9 @@ check:
6149

6250
mypy tests/typing
6351

64-
test-publish: cythonize
52+
test-publish: build
6553
# Create distributions
66-
python setup.py sdist
54+
python -m build --sdist
6755
# Upload distributions to PyPI
6856
twine upload --repository testpypi dist/dependency-injector-$(VERSION)*
6957

Diff for: docs/_static/custom.css

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.no-border {
2+
border: 0 !important;
3+
box-shadow: none !important;
4+
-webkit-box-shadow: none !important;
5+
}
6+
.no-border td {
7+
border: 0px !important;
8+
padding: 0px 10px 0px 0px !important;
9+
}

Diff for: docs/_static/disqus.js

-11
This file was deleted.

Diff for: docs/_static/sponsor.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<iframe src="https://github.com/sponsors/rmk135/button" title="Sponsor Dependency Injector" height="32" width="114" style="border: 0; border-radius: 6px;"></iframe>

0 commit comments

Comments
 (0)