Skip to content

Commit 4bee8a8

Browse files
committed
Restore support for Python 3.8
1 parent 4831a8f commit 4bee8a8

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ jobs:
1919
config:
2020
# [Python version, tox env]
2121
- ["3.10", "lint", "ubuntu-latest"]
22+
- ["3.8", "py38-unit", "ubuntu-latest"]
2223
- ["3.9", "py39-unit", "ubuntu-latest"]
2324
- ["3.10", "py310-unit", "ubuntu-latest"]
2425
- ["3.11", "py311-unit", "ubuntu-latest"]
2526
- ["3.12", "py312-unit", "ubuntu-latest"]
2627
- ["3.13", "py313-unit", "ubuntu-latest"]
28+
- ["3.8", "py38-integration", "ubuntu-latest"]
2729
- ["3.9", "py39-integration", "ubuntu-latest"]
2830
- ["3.10", "py310-integration", "ubuntu-latest"]
2931
- ["3.11", "py311-integration", "ubuntu-latest"]

news/36.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Restore support for Python 3.8.
2+
[ale-rt]

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[build-system]
2-
requires = ["setuptools==75.8.0"]
2+
requires = [
3+
"setuptools==75.8.0; python_version > '3.8'",
4+
"setuptools==74.0.0; python_version == '3.8'"
5+
]
36

47
[tool.towncrier]
58
filename = "CHANGES.rst"

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"Framework :: Plone",
2222
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
2323
"Operating System :: OS Independent",
24+
"Programming Language :: Python :: 3.8",
2425
"Programming Language :: Python :: 3.9",
2526
"Programming Language :: Python :: 3.10",
2627
"Programming Language :: Python :: 3.11",
@@ -44,10 +45,12 @@
4445
package_dir={"": "src"},
4546
include_package_data=True,
4647
zip_safe=False,
47-
python_requires=">=3.9",
48+
python_requires=">=3.8",
4849
install_requires=[
4950
"importlib-metadata; python_version<'3.10'",
51+
"importlib-resources; python_version<'3.9'",
5052
"setuptools",
53+
"setuptools <= 75.0; python_version<'3.9'",
5154
"zope.configuration",
5255
],
5356
)

src/plone/autoinclude/loader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from importlib.metadata import distribution
22
from importlib.metadata import distributions
33
from importlib.metadata import PackageNotFoundError
4-
from importlib.resources import files
54
from zope.configuration.xmlconfig import include
65
from zope.configuration.xmlconfig import includeOverrides
76

@@ -18,6 +17,13 @@
1817
from importlib.metadata import entry_points
1918

2019

20+
try:
21+
from importlib.resources import files
22+
except ImportError: # pragma: no cover
23+
# Python 3.8
24+
from importlib_resources import files
25+
26+
2127
logger = logging.getLogger(__name__)
2228

2329
# Dictionary of project names and packages that we have already imported.

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
minversion = 3.18
55
envlist =
66
lint
7-
py{39,310,311,312,313}-{integration,unit}
7+
py{38,39,310,311,312,313}-{integration,unit}
88
buildout
99
coverage
1010
# Not enabled by default:
@@ -56,15 +56,15 @@ integration_testpaths =
5656
--test-path=test-packages/namespaceexample.native/src \
5757
--test-path=test-packages/namespaceexample.pkgutilns/src
5858

59-
[testenv:py{39,310,311,312,313}-integration]
59+
[testenv:py{38,39,310,311,312,313}-integration]
6060
# Integration tests: run only the tests of the test packages.
6161
# Do not run plone.autoinclude tests.
6262
commands =
6363
zope-testrunner {[testenv]integration_testpaths} []
6464
extras =
6565
test
6666

67-
[testenv:py{39,310,311,312,313}-unit]
67+
[testenv:py{38,39,310,311,312,313}-unit]
6868
usedevelop = true
6969
skip_install = false
7070
deps =
@@ -144,7 +144,8 @@ skip_install = true
144144
setenv =
145145
deps =
146146
pip == 25.0.1
147-
setuptools == 75.8.0
147+
setuptools == 75.8.0; python_version >= '3.9'
148+
setuptools == 74.0.0; python_version < '3.9'
148149
zc.buildout == 4.0.0
149150
commands_pre =
150151
python -m pip list

0 commit comments

Comments
 (0)