Skip to content

Commit 4cc4ca9

Browse files
authored
Drop Python 3.4 support (#518)
* Update gitignore * Drop Python 3.4 support * Update change log * Fix typo in changelog
1 parent 284dee6 commit 4cc4ca9

File tree

8 files changed

+167
-203
lines changed

8 files changed

+167
-203
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-18.04
1010
strategy:
1111
matrix:
12-
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
12+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- uses: actions/setup-python@v2

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ reports/
3636
.cache
3737
nosetests.xml
3838
coverage.xml
39+
.hypothesis/
3940

4041
# Translations
4142
*.mo
@@ -54,7 +55,7 @@ target/
5455
.idea/
5556

5657
# Virtualenv
57-
venv/
58+
venv*/
5859

5960
# SQLite
6061
*.db

docs/main/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Develop
1313
``container.wire(modules=["yourapp.module1"])``.
1414
- Add container wiring configuration ``wiring_config = containers.WiringConfiguration()``.
1515
- Add support of ``with`` statement for ``container.override_providers()`` method.
16+
- Drop support of Python 3.4. There are no immediate breaking changes, but Dependency Injector
17+
will no longer be tested on Python 3.4 and any bugs will not be fixed.
1618
- Update documentation and fix typos.
1719

1820
4.36.2

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"Programming Language :: Python :: 2",
9797
"Programming Language :: Python :: 2.7",
9898
"Programming Language :: Python :: 3",
99-
"Programming Language :: Python :: 3.4",
10099
"Programming Language :: Python :: 3.5",
101100
"Programming Language :: Python :: 3.6",
102101
"Programming Language :: Python :: 3.7",

src/dependency_injector/providers.c

Lines changed: 158 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dependency_injector/providers.pyx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4743,32 +4743,23 @@ def traverse(*providers, types=None):
47434743

47444744

47454745
def isawaitable(obj):
4746-
"""Check if object is a coroutine function.
4747-
4748-
Return False for any object in Python 3.4 or below.
4749-
"""
4746+
"""Check if object is a coroutine function."""
47504747
try:
47514748
return inspect.isawaitable(obj)
47524749
except AttributeError:
47534750
return False
47544751

47554752

47564753
def iscoroutinefunction(obj):
4757-
"""Check if object is a coroutine function.
4758-
4759-
Return False for any object in Python 3.4 or below.
4760-
"""
4754+
"""Check if object is a coroutine function."""
47614755
try:
47624756
return inspect.iscoroutinefunction(obj)
47634757
except AttributeError:
47644758
return False
47654759

47664760

47674761
def isasyncgenfunction(obj):
4768-
"""Check if object is an asynchronous generator function.
4769-
4770-
Return False for any object in Python 3.4 or below.
4771-
"""
4762+
"""Check if object is an asynchronous generator function."""
47724763
try:
47734764
return inspect.isasyncgenfunction(obj)
47744765
except AttributeError:

tests/unit/providers/test_configuration_py2_py3.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ def tearDown(self):
795795
os.unlink(self.config_file_1)
796796
os.unlink(self.config_file_2)
797797

798-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
799798
def test(self):
800799
self.config.from_yaml(self.config_file_1)
801800

@@ -805,7 +804,6 @@ def test(self):
805804
self.assertEqual(self.config.section2(), {"value2": 2})
806805
self.assertEqual(self.config.section2.value2(), 2)
807806

808-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
809807
def test_merge(self):
810808
self.config.from_yaml(self.config_file_1)
811809
self.config.from_yaml(self.config_file_2)
@@ -833,45 +831,37 @@ def test_merge(self):
833831
self.assertEqual(self.config.section3(), {"value3": 3})
834832
self.assertEqual(self.config.section3.value3(), 3)
835833

836-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
837834
def test_file_does_not_exist(self):
838835
self.config.from_yaml("./does_not_exist.yml")
839836
self.assertEqual(self.config(), {})
840837

841-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
842838
def test_file_does_not_exist_strict_mode(self):
843839
self.config = providers.Configuration(strict=True)
844840
with self.assertRaises(IOError):
845841
self.config.from_yaml("./does_not_exist.yml")
846842

847-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
848843
def test_option_file_does_not_exist(self):
849844
self.config.option.from_yaml("./does_not_exist.yml")
850845
self.assertIsNone(self.config.option())
851846

852-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
853847
def test_option_file_does_not_exist_strict_mode(self):
854848
self.config = providers.Configuration(strict=True)
855849
with self.assertRaises(IOError):
856850
self.config.option.from_yaml("./does_not_exist.yml")
857851

858-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
859852
def test_required_file_does_not_exist(self):
860853
with self.assertRaises(IOError):
861854
self.config.from_yaml("./does_not_exist.yml", required=True)
862855

863-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
864856
def test_required_option_file_does_not_exist(self):
865857
with self.assertRaises(IOError):
866858
self.config.option.from_yaml("./does_not_exist.yml", required=True)
867859

868-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
869860
def test_not_required_file_does_not_exist_strict_mode(self):
870861
self.config = providers.Configuration(strict=True)
871862
self.config.from_yaml("./does_not_exist.yml", required=False)
872863
self.assertEqual(self.config(), {})
873864

874-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
875865
def test_not_required_option_file_does_not_exist_strict_mode(self):
876866
self.config = providers.Configuration(strict=True)
877867
self.config.option.from_yaml("./does_not_exist.yml", required=False)
@@ -943,7 +933,6 @@ def tearDown(self):
943933
os.environ.pop("CONFIG_TEST_PATH", None)
944934
os.unlink(self.config_file)
945935

946-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
947936
def test_env_variable_interpolation(self):
948937
self.config.from_yaml(self.config_file)
949938

@@ -966,7 +955,6 @@ def test_env_variable_interpolation(self):
966955
self.assertEqual(self.config.section1.value1(), "test-value")
967956
self.assertEqual(self.config.section1.value2(), "test-path/path")
968957

969-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
970958
def test_missing_envs_not_required(self):
971959
del os.environ["CONFIG_TEST_ENV"]
972960
del os.environ["CONFIG_TEST_PATH"]
@@ -992,7 +980,6 @@ def test_missing_envs_not_required(self):
992980
self.assertIsNone(self.config.section1.value1())
993981
self.assertEqual(self.config.section1.value2(), "/path")
994982

995-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
996983
def test_missing_envs_required(self):
997984
with open(self.config_file, "w") as config_file:
998985
config_file.write(
@@ -1008,7 +995,6 @@ def test_missing_envs_required(self):
1008995
"Missing required environment variable \"UNDEFINED\"",
1009996
)
1010997

1011-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
1012998
def test_missing_envs_strict_mode(self):
1013999
with open(self.config_file, "w") as config_file:
10141000
config_file.write(
@@ -1025,7 +1011,6 @@ def test_missing_envs_strict_mode(self):
10251011
"Missing required environment variable \"UNDEFINED\"",
10261012
)
10271013

1028-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
10291014
def test_option_missing_envs_not_required(self):
10301015
del os.environ["CONFIG_TEST_ENV"]
10311016
del os.environ["CONFIG_TEST_PATH"]
@@ -1051,7 +1036,6 @@ def test_option_missing_envs_not_required(self):
10511036
self.assertIsNone(self.config.option.section1.value1())
10521037
self.assertEqual(self.config.option.section1.value2(), "/path")
10531038

1054-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
10551039
def test_option_missing_envs_required(self):
10561040
with open(self.config_file, "w") as config_file:
10571041
config_file.write(
@@ -1067,7 +1051,6 @@ def test_option_missing_envs_required(self):
10671051
"Missing required environment variable \"UNDEFINED\"",
10681052
)
10691053

1070-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
10711054
def test_option_missing_envs_strict_mode(self):
10721055
with open(self.config_file, "w") as config_file:
10731056
config_file.write(
@@ -1084,7 +1067,6 @@ def test_option_missing_envs_strict_mode(self):
10841067
"Missing required environment variable \"UNDEFINED\"",
10851068
)
10861069

1087-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
10881070
def test_default_values(self):
10891071
os.environ["DEFINED"] = "defined"
10901072
self.addCleanup(os.environ.pop, "DEFINED")
@@ -1108,7 +1090,6 @@ def test_default_values(self):
11081090
},
11091091
)
11101092

1111-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
11121093
def test_option_env_variable_interpolation(self):
11131094
self.config.option.from_yaml(self.config_file)
11141095

@@ -1131,7 +1112,6 @@ def test_option_env_variable_interpolation(self):
11311112
self.assertEqual(self.config.option.section1.value1(), "test-value")
11321113
self.assertEqual(self.config.option.section1.value2(), "test-path/path")
11331114

1134-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
11351115
def test_env_variable_interpolation_custom_loader(self):
11361116
self.config.from_yaml(self.config_file, loader=yaml.UnsafeLoader)
11371117

@@ -1145,7 +1125,6 @@ def test_env_variable_interpolation_custom_loader(self):
11451125
self.assertEqual(self.config.section1.value1(), "test-value")
11461126
self.assertEqual(self.config.section1.value2(), "test-path/path")
11471127

1148-
@unittest.skipIf(sys.version_info[:2] == (3, 4), "PyYAML does not support Python 3.4")
11491128
def test_option_env_variable_interpolation_custom_loader(self):
11501129
self.config.option.from_yaml(self.config_file, loader=yaml.UnsafeLoader)
11511130

tox.ini

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist=
3-
coveralls, pylint, flake8, pydocstyle, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3
3+
coveralls, pylint, flake8, pydocstyle, 2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3
44

55
[testenv]
66
deps=
@@ -43,14 +43,6 @@ extras=
4343
commands=
4444
python -m unittest discover -s tests/unit -p test_*_py2_py3.py
4545

46-
[testenv:3.4]
47-
deps=
48-
contextvars
49-
extras=
50-
flask
51-
commands=
52-
python -m unittest discover -s tests/unit -p test_*_py3.py
53-
5446
[testenv:3.5]
5547
deps=
5648
contextvars

0 commit comments

Comments
 (0)