mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-10-31 16:07:51 +03:00 
			
		
		
		
	Merge branch 'release/4.29.1' into master
This commit is contained in:
		
						commit
						b3bcf60ced
					
				
							
								
								
									
										14
									
								
								.github/workflows/publishing.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/publishing.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -9,7 +9,7 @@ jobs: | ||||||
| 
 | 
 | ||||||
|   tests: |   tests: | ||||||
|     name: Run tests |     name: Run tests | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-18.04 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions/setup-python@v2 |       - uses: actions/setup-python@v2 | ||||||
|  | @ -22,7 +22,7 @@ jobs: | ||||||
| 
 | 
 | ||||||
|   linters: |   linters: | ||||||
|     name: Run linters |     name: Run linters | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-18.04 | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         toxenv: [flake8, pydocstyle, mypy, pylint] |         toxenv: [flake8, pydocstyle, mypy, pylint] | ||||||
|  | @ -39,7 +39,7 @@ jobs: | ||||||
|   build-sdist: |   build-sdist: | ||||||
|     name: Build source tarball |     name: Build source tarball | ||||||
|     needs: [tests, linters] |     needs: [tests, linters] | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-18.04 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions/setup-python@v2 |       - uses: actions/setup-python@v2 | ||||||
|  | @ -56,7 +56,7 @@ jobs: | ||||||
|     runs-on: ${{ matrix.os }} |     runs-on: ${{ matrix.os }} | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-18.04, windows-latest, macos-latest] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions/setup-python@v2 |       - uses: actions/setup-python@v2 | ||||||
|  | @ -75,7 +75,7 @@ jobs: | ||||||
|   build-wheels-linux-aarch64: |   build-wheels-linux-aarch64: | ||||||
|     name: Build wheels (ubuntu-latest-aarch64) |     name: Build wheels (ubuntu-latest-aarch64) | ||||||
|     needs: [tests, linters] |     needs: [tests, linters] | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-18.04 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - name: Set up QEMU |       - name: Set up QEMU | ||||||
|  | @ -92,7 +92,7 @@ jobs: | ||||||
|   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-latest |     runs-on: ubuntu-18.04 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/download-artifact@v2 |       - uses: actions/download-artifact@v2 | ||||||
|         with: |         with: | ||||||
|  | @ -106,7 +106,7 @@ jobs: | ||||||
|   publish-docs: |   publish-docs: | ||||||
|     name: Publish docs |     name: Publish docs | ||||||
|     needs: [publish] |     needs: [publish] | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-18.04 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions/setup-python@v2 |       - uses: actions/setup-python@v2 | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							|  | @ -48,14 +48,14 @@ uninstall: | ||||||
| test-py2: build | test-py2: build | ||||||
| 	# Unit tests with coverage report | 	# Unit tests with coverage report | ||||||
| 	coverage erase | 	coverage erase | ||||||
| 	coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py2_py3.py | 	coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*_py2_py3.py | ||||||
| 	coverage report --rcfile=./.coveragerc | 	coverage report --rcfile=./.coveragerc | ||||||
| 	coverage html --rcfile=./.coveragerc | 	coverage html --rcfile=./.coveragerc | ||||||
| 
 | 
 | ||||||
| test: build | test: build | ||||||
| 	# Unit tests with coverage report | 	# Unit tests with coverage report | ||||||
| 	coverage erase | 	coverage erase | ||||||
| 	coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*py3*.py | 	coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*py3*.py | ||||||
| 	coverage report --rcfile=./.coveragerc | 	coverage report --rcfile=./.coveragerc | ||||||
| 	coverage html --rcfile=./.coveragerc | 	coverage html --rcfile=./.coveragerc | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,6 +14,7 @@ follows `Semantic versioning`_ | ||||||
|   Thanks to `@GitterRemote <https://github.com/GitterRemote>`_ for reporting the issue. |   Thanks to `@GitterRemote <https://github.com/GitterRemote>`_ for reporting the issue. | ||||||
| - Add docs and example for ``Factory.add_attributes()`` method. | - Add docs and example for ``Factory.add_attributes()`` method. | ||||||
| - Remove legacy css file. | - Remove legacy css file. | ||||||
|  | - Remove ``unittest2`` test dependency. | ||||||
| 
 | 
 | ||||||
| 4.29.0 | 4.29.0 | ||||||
| ------ | ------ | ||||||
|  |  | ||||||
|  | @ -1,6 +1,5 @@ | ||||||
| cython==0.29.21 | cython==0.29.21 | ||||||
| tox | tox | ||||||
| unittest2 |  | ||||||
| coverage | coverage | ||||||
| flake8 | flake8 | ||||||
| pydocstyle | pydocstyle | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| """Dependency injector declarative container unit tests.""" | """Dependency injector declarative container unit tests.""" | ||||||
| 
 | 
 | ||||||
| import collections | import collections | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     containers, |     containers, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector dynamic container unit tests for async resources.""" | """Dependency injector dynamic container unit tests for async resources.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| # Runtime import to get asyncutils module | # Runtime import to get asyncutils module | ||||||
| import os | import os | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector dynamic container unit tests.""" | """Dependency injector dynamic container unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     containers, |     containers, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector Flask extension unit tests.""" | """Dependency injector Flask extension unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| from flask import Flask, url_for | from flask import Flask, url_for | ||||||
| from flask.views import MethodView | from flask.views import MethodView | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector base providers unit tests.""" | """Dependency injector base providers unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     containers, |     containers, | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     providers, |     providers, | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ import os | ||||||
| import sys | import sys | ||||||
| import tempfile | import tempfile | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import containers, providers, errors | from dependency_injector import containers, providers, errors | ||||||
| try: | try: | ||||||
|  | @ -106,6 +106,7 @@ class ConfigTests(unittest.TestCase): | ||||||
| 
 | 
 | ||||||
|         self.assertEqual(value, decimal.Decimal('123.123')) |         self.assertEqual(value, decimal.Decimal('123.123')) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert') | ||||||
|     def test_required(self): |     def test_required(self): | ||||||
|         provider = providers.Callable( |         provider = providers.Callable( | ||||||
|             lambda value: value, |             lambda value: value, | ||||||
|  | @ -218,11 +219,13 @@ class ConfigTests(unittest.TestCase): | ||||||
|     def test_value_of_undefined_option(self): |     def test_value_of_undefined_option(self): | ||||||
|         self.assertIsNone(self.config.a()) |         self.assertIsNone(self.config.a()) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert') | ||||||
|     def test_value_of_undefined_option_in_strict_mode(self): |     def test_value_of_undefined_option_in_strict_mode(self): | ||||||
|         self.config = providers.Configuration(strict=True) |         self.config = providers.Configuration(strict=True) | ||||||
|         with self.assertRaisesRegex(errors.Error, 'Undefined configuration option "config.a"'): |         with self.assertRaisesRegex(errors.Error, 'Undefined configuration option "config.a"'): | ||||||
|             self.config.a() |             self.config.a() | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert') | ||||||
|     def test_value_of_undefined_option_with_root_none_in_strict_mode(self): |     def test_value_of_undefined_option_with_root_none_in_strict_mode(self): | ||||||
|         self.config = providers.Configuration(strict=True) |         self.config = providers.Configuration(strict=True) | ||||||
|         self.config.override(None) |         self.config.override(None) | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import copy | import copy | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import containers, providers, errors | from dependency_injector import containers, providers, errors | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import asyncio | import asyncio | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     providers, |     providers, | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import providers | from dependency_injector import providers | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     providers, |     providers, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector injections unit tests.""" | """Dependency injector injections unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import providers | from dependency_injector import providers | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import providers | from dependency_injector import providers | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector provided instance provider unit tests.""" | """Dependency injector provided instance provider unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import containers, providers | from dependency_injector import containers, providers | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import asyncio | import asyncio | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import containers, providers, resources, errors | from dependency_injector import containers, providers, resources, errors | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ import functools | ||||||
| import itertools | import itertools | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import providers, errors | from dependency_injector import providers, errors | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     providers, |     providers, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector provider utils unit tests.""" | """Dependency injector provider utils unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import ( | from dependency_injector import ( | ||||||
|     providers, |     providers, | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| """Dependency injector common unit tests.""" | """Dependency injector common unit tests.""" | ||||||
| 
 | 
 | ||||||
| import unittest2 as unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from dependency_injector import __version__ | from dependency_injector import __version__ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								tox.ini
									
									
									
									
									
								
							|  | @ -4,7 +4,6 @@ envlist= | ||||||
| 
 | 
 | ||||||
| [testenv] | [testenv] | ||||||
| deps= | deps= | ||||||
|     unittest2 |  | ||||||
|     # TODO: Hotfix, remove when fixed https://github.com/aio-libs/aiohttp/issues/5107 |     # TODO: Hotfix, remove when fixed https://github.com/aio-libs/aiohttp/issues/5107 | ||||||
|     typing_extensions |     typing_extensions | ||||||
|     httpx |     httpx | ||||||
|  | @ -15,7 +14,7 @@ extras= | ||||||
|     flask |     flask | ||||||
|     aiohttp |     aiohttp | ||||||
| commands= | commands= | ||||||
|     unit2 discover -s tests/unit -p test_*_py3*.py |     python -m unittest discover -s tests/unit -p test_*_py3*.py | ||||||
| 
 | 
 | ||||||
| [testenv:coveralls] | [testenv:coveralls] | ||||||
| passenv = GITHUB_* COVERALLS_* | passenv = GITHUB_* COVERALLS_* | ||||||
|  | @ -28,44 +27,40 @@ deps= | ||||||
|     coveralls |     coveralls | ||||||
| commands= | commands= | ||||||
|     coverage erase |     coverage erase | ||||||
|     coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py3*.py |     coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*_py3*.py | ||||||
|     coverage report --rcfile=./.coveragerc |     coverage report --rcfile=./.coveragerc | ||||||
|     coveralls |     coveralls | ||||||
| 
 | 
 | ||||||
| [testenv:2.7] | [testenv:2.7] | ||||||
| deps= | deps= | ||||||
|     unittest2 |  | ||||||
| extras= | extras= | ||||||
|     yaml |     yaml | ||||||
|     flask |     flask | ||||||
| commands= | commands= | ||||||
|     unit2 discover -s tests/unit -p test_*_py2_py3.py |     python -m unittest discover -s tests/unit -p test_*_py2_py3.py | ||||||
| 
 | 
 | ||||||
| [testenv:3.4] | [testenv:3.4] | ||||||
| deps= | deps= | ||||||
|     unittest2 |  | ||||||
| extras= | extras= | ||||||
|     flask |     flask | ||||||
| commands= | commands= | ||||||
|     unit2 discover -s tests/unit -p test_*_py3.py |     python -m unittest discover -s tests/unit -p test_*_py3.py | ||||||
| 
 | 
 | ||||||
| [testenv:3.5] | [testenv:3.5] | ||||||
| deps= | deps= | ||||||
|     unittest2 |  | ||||||
| extras= | extras= | ||||||
|     yaml |     yaml | ||||||
|     flask |     flask | ||||||
| commands= | commands= | ||||||
|     unit2 discover -s tests/unit -p test_*_py3.py |     python -m unittest discover -s tests/unit -p test_*_py3.py | ||||||
| 
 | 
 | ||||||
| [testenv:pypy2] | [testenv:pypy2] | ||||||
| deps= | deps= | ||||||
|     unittest2 |  | ||||||
| extras= | extras= | ||||||
|     yaml |     yaml | ||||||
|     flask |     flask | ||||||
| commands= | commands= | ||||||
|     unit2 discover -s tests/unit -p test_*_py2_py3.py |     python -m unittest discover -s tests/unit -p test_*_py2_py3.py | ||||||
| 
 | 
 | ||||||
| [testenv:pylint] | [testenv:pylint] | ||||||
| deps= | deps= | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user