Skip to content

Commit 579081b

Browse files
authored
Merge branch 'ets-labs:master' into type-provider
2 parents 5cb538d + 46646b1 commit 579081b

File tree

93 files changed

+1720
-210143
lines changed

Some content is hidden

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

93 files changed

+1720
-210143
lines changed

.coveragerc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: rmk135

.github/workflows/publishing.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
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
@@ -31,7 +31,7 @@ jobs:
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:
@@ -45,8 +45,10 @@ jobs:
4545
- uses: actions/checkout@v3
4646
- uses: actions/setup-python@v4
4747
with:
48-
python-version: 3.11
49-
- run: python setup.py sdist
48+
python-version: 3.13
49+
- run: |
50+
python -m pip install --upgrade build
51+
python -m build --sdist
5052
- uses: actions/upload-artifact@v3
5153
with:
5254
path: ./dist/*
@@ -57,13 +59,13 @@ jobs:
5759
runs-on: ${{ matrix.os }}
5860
strategy:
5961
matrix:
60-
os: [ubuntu-22.04, windows-2019, macos-11]
62+
os: [ubuntu-22.04, windows-2019, macos-14]
6163
env:
62-
CIBW_SKIP: cp27-win*
64+
CIBW_SKIP: cp27-*
6365
steps:
6466
- uses: actions/checkout@v3
6567
- name: Build wheels
66-
uses: pypa/cibuildwheel@v2.11.3
68+
uses: pypa/cibuildwheel@v2.20.0
6769
- uses: actions/upload-artifact@v3
6870
with:
6971
path: ./wheelhouse/*.whl
@@ -72,13 +74,15 @@ jobs:
7274
name: Build wheels (ubuntu-22.04-aarch64)
7375
needs: [tests, linters]
7476
runs-on: ubuntu-22.04
77+
env:
78+
CIBW_SKIP: cp27-*
7579
steps:
7680
- uses: actions/checkout@v3
7781
- name: Set up QEMU
7882
if: runner.os == 'Linux'
7983
uses: docker/setup-qemu-action@v2
8084
- name: Build wheels
81-
uses: pypa/cibuildwheel@v2.11.3
85+
uses: pypa/cibuildwheel@v2.20.0
8286
env:
8387
CIBW_ARCHS_LINUX: aarch64
8488
- uses: actions/upload-artifact@v3
@@ -110,9 +114,9 @@ jobs:
110114
- uses: actions/checkout@v3
111115
- uses: actions/setup-python@v4
112116
with:
113-
python-version: 3.11
114-
- run: pip install -r requirements-doc.txt
117+
python-version: 3.13
115118
- run: pip install awscli
119+
- run: pip install -r requirements-doc.txt
116120
- run: pip install -e .
117121
- run: (cd docs && make clean html)
118122
- run: |

.github/workflows/tests-and-linters.yml

Lines changed: 18 additions & 7 deletions
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:

.gitignore

Lines changed: 7 additions & 7 deletions
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/

.pylintrc

Lines changed: 0 additions & 49 deletions
This file was deleted.

CONTRIBUTORS.rst

Lines changed: 2 additions & 0 deletions
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)

LICENSE.rst

Lines changed: 1 addition & 1 deletion
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

Makefile

Lines changed: 10 additions & 22 deletions
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

docs/_static/custom.css

Lines changed: 9 additions & 0 deletions
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+
}

docs/_static/disqus.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/_static/sponsor.html

Lines changed: 1 addition & 0 deletions
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>

docs/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
extensions = [
3434
"alabaster",
3535
"sphinx.ext.autodoc",
36-
"sphinxcontrib.disqus",
36+
"sphinx_disqus.disqus",
3737
]
3838

3939
# Add any paths that contain templates here, relative to this directory.
@@ -52,7 +52,7 @@
5252

5353
# General information about the project.
5454
project = "Dependency Injector"
55-
copyright = "2022, Roman Mogylatov"
55+
copyright = "2024, Roman Mogylatov"
5656
author = "Roman Mogylatov"
5757

5858
# The version info for the project you"re documenting, acts as replacement for
@@ -147,6 +147,9 @@
147147
# relative to this directory. They are copied after the builtin static files,
148148
# so a file named "default.css" will overwrite the builtin "default.css".
149149
html_static_path = ["_static"]
150+
html_css_files = [
151+
"custom.css",
152+
]
150153

151154
# Add any extra paths that contain custom files (such as robots.txt or
152155
# .htaccess) here, relative to this directory. These files are copied
@@ -306,4 +309,5 @@
306309
"description": "Dependency injection framework for Python by Roman Mogylatov",
307310
"code_font_size": "10pt",
308311
"analytics_id": "UA-67012059-1",
312+
"donate_url": "https://github.com/sponsors/rmk135",
309313
}

docs/examples/aiohttp.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ Sources
7878

7979
Explore the sources on the `Github <https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/aiohttp>`_.
8080

81+
.. include:: ../sponsor.rst
82+
8183
.. disqus::

docs/examples/application-multiple-containers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,6 @@ Run the application
8484

8585
You can find the source code and instructions for running on the `Github <https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/application-multiple-containers>`_.
8686

87+
.. include:: ../sponsor.rst
88+
8789
.. disqus::

docs/examples/application-single-container.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@ Run the application
9090

9191
You can find the source code and instructions for running on the `Github <https://github.com/ets-labs/python-dependency-injector/tree/master/examples/miniapps/application-single-container>`_.
9292

93+
.. include:: ../sponsor.rst
94+
9395
.. disqus::

docs/examples/boto3.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ Listing of ``boto3_session_example.py``:
1717
.. literalinclude:: ../../examples/miniapps/boto3-session/boto3_session_example.py
1818
:language: python
1919

20+
.. include:: ../sponsor.rst
21+
2022
.. disqus::

0 commit comments

Comments
 (0)