Skip to content

Commit 1e5f56b

Browse files
authored
BREAKING CHANGE: drop support for python 3.7 (#2436)
Python 3.7 will be end-of-life on the 27th of June 2023 and the next release of RDFLib will be a new major version. This changes the minimum supported version of Python to 3.8.1 as some of the dependencies we use are not too fond of python 3.8.0. This change also removes all accommodations for older python versions.
1 parent d21a451 commit 1e5f56b

File tree

15 files changed

+34
-115
lines changed

15 files changed

+34
-115
lines changed

.github/workflows/validate.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,37 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
28+
python-version: ["3.8", "3.9", "3.10", "3.11"]
2929
os: [ubuntu-latest, macos-latest, windows-latest]
3030
# This is used for injecting additional tests for a specific python
3131
# version and OS.
3232
suffix: [""]
3333
include:
34-
- python-version: "3.7"
34+
- python-version: "3.8"
3535
os: ubuntu-latest
3636
extensive-tests: true
3737
TOXENV_SUFFIX: "-docs"
38-
- python-version: "3.7"
38+
- python-version: "3.8"
3939
os: ubuntu-latest
4040
extensive-tests: true
4141
suffix: "-min"
4242
TOXENV_SUFFIX: "-min"
43-
- python-version: "3.8"
43+
- python-version: "3.9"
4444
os: ubuntu-latest
4545
TOX_EXTRA_COMMAND: "- isort --check-only --diff ."
4646
TOXENV_SUFFIX: "-docs"
47-
- python-version: "3.9"
47+
- python-version: "3.10"
4848
os: ubuntu-latest
4949
TOX_EXTRA_COMMAND: "- black --check --diff ./rdflib"
5050
TOXENV_SUFFIX: "-lxml"
51-
- python-version: "3.10"
51+
- python-version: "3.11"
5252
os: ubuntu-latest
5353
TOX_EXTRA_COMMAND: "flake8 --exit-zero rdflib"
5454
TOXENV_SUFFIX: "-docs"
5555
PREPARATION: "sudo apt-get install -y firejail"
5656
extensive-tests: true
5757
TOX_TEST_HARNESS: "firejail --net=none --"
5858
TOX_PYTEST_EXTRA_ARGS: "-m 'not webtest'"
59-
- python-version: "3.11"
60-
os: ubuntu-latest
61-
TOXENV_SUFFIX: "-docs"
6259
steps:
6360
- uses: actions/checkout@v3
6461
- name: Cache XDG_CACHE_HOME

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Help with maintenance of all of the RDFLib family of packages is always welcome
4343

4444
## Versions & Releases
4545

46-
* `7.0.0a0` current `main` branch
46+
* `7.0.0a0` current `main` branch and supports Python 3.8.1+ only.
4747
* `6.x.y` current release and support Python 3.7+ only. Many improvements over 5.0.0
4848
* see [Releases](https://github.com/RDFLib/rdflib/releases)
4949
* `5.x.y` supports Python 2.7 and 3.4+ and is [mostly backwards compatible with 4.2.2](https://rdflib.readthedocs.io/en/stable/upgrade4to5.html).

docs/conf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def find_version(filename):
256256

257257
# Example configuration for intersphinx: refer to the Python standard library.
258258
intersphinx_mapping = {
259-
"python": ("https://docs.python.org/3.7", None),
259+
"python": ("https://docs.python.org/3.8", None),
260260
}
261261

262262
html_experimental_html5_writer = True
@@ -331,9 +331,6 @@ def find_version(filename):
331331
]
332332
)
333333

334-
if sys.version_info < (3, 8):
335-
nitpick_ignore.extend([("py:class", "importlib_metadata.EntryPoint")])
336-
337334

338335
def autodoc_skip_member_handler(
339336
app: sphinx.application.Sphinx,

docs/developers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ flag them as expecting to fail.
437437
Compatibility
438438
-------------
439439

440+
RDFlib 7.0.0 release and later only support Python 3.8.1 and newer.
441+
440442
RDFlib 6.0.0 release and later only support Python 3.7 and newer.
441443

442444
RDFLib 5.0.0 maintained compatibility with Python versions 2.7, 3.4, 3.5, 3.6, 3.7.

docs/gettingstarted.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ methods that search triples and return them in arbitrary order.
5151

5252
RDFLib graphs also redefine certain built-in Python methods in order
5353
to behave in a predictable way. They do this by `emulating container types
54-
<https://docs.python.org/3.7/reference/datamodel.html#emulating-container-types>`_ and
54+
<https://docs.python.org/3.8/reference/datamodel.html#emulating-container-types>`_ and
5555
are best thought of as a set of 3-item tuples ("triples", in RDF-speak):
5656

5757
.. code-block:: text

docs/upgrade6to7.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
Upgrading 6 to 7
55
============================================
66

7+
Python version
8+
----------------------------------------------------
9+
10+
RDFLib 7 requires Python 3.8.1 or later.
11+
712
New behaviour for ``publicID`` in ``parse`` methods.
813
----------------------------------------------------
914

examples/secure_with_audit.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,8 @@ def main() -> None:
6161
),
6262
)
6363

64-
if sys.version_info < (3, 8):
65-
logging.warn("This example requires Python 3.8 or higher")
66-
return None
67-
6864
# Install the audit hook
69-
#
70-
# note on type error: This is needed because we are running mypy with python
71-
# 3.7 mode, so mypy thinks the previous condition will always be true.
72-
sys.addaudithook(audit_hook) # type: ignore[unreachable]
65+
sys.addaudithook(audit_hook)
7366

7467
graph = Graph()
7568

poetry.lock

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

pyproject.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ license = "BSD-3-Clause"
1111
classifiers=[
1212
"Programming Language :: Python",
1313
"Programming Language :: Python :: 3",
14-
"Programming Language :: Python :: 3.7",
1514
"Programming Language :: Python :: 3.8",
1615
"Programming Language :: Python :: 3.9",
1716
"Programming Language :: Python :: 3.10",
@@ -39,10 +38,9 @@ rdfs2dot = 'rdflib.tools.rdfs2dot:main'
3938
rdfgraphisomorphism = 'rdflib.tools.graphisomorphism:main'
4039

4140
[tool.poetry.dependencies]
42-
python = "^3.7"
41+
python = "^3.8.1"
4342
isodate = "^0.6.0"
4443
pyparsing = ">=2.1.0,<4"
45-
importlib-metadata = {version = ">=4,<7", python = ">=3.7,<3.8"}
4644
berkeleydb = {version = "^18.1.0", optional = true}
4745
networkx = {version = "^2.0.0", optional = true}
4846
html5lib = {version = "^1.0", optional = true}
@@ -69,9 +67,9 @@ sphinx-autodoc-typehints = "^1.17.1"
6967
typing-extensions = "^4.5.0"
7068

7169
[tool.poetry.group.flake8.dependencies]
72-
flake8 = {version = ">=4.0.1", python = ">=3.8"} # flakeheaven is incompatible with flake8 >=5.0 (https://github.com/flakeheaven/flakeheaven/issues/132)
73-
flakeheaven = {version = "^3.2.1", python = ">=3.8"}
74-
pep8-naming = {version = "^0.13.2", python = ">=3.8"}
70+
flake8 = {version = ">=4.0.1"} # flakeheaven is incompatible with flake8 >=5.0 (https://github.com/flakeheaven/flakeheaven/issues/132)
71+
flakeheaven = {version = "^3.2.1"}
72+
pep8-naming = {version = "^0.13.2"}
7573

7674
[tool.poetry.extras]
7775
berkeleydb = ["berkeleydb"]
@@ -204,7 +202,7 @@ skip = [
204202

205203
[tool.mypy]
206204
files = ['rdflib', 'test', 'devtools', 'examples']
207-
python_version = "3.7"
205+
python_version = "3.8"
208206
warn_unused_configs = true
209207
ignore_missing_imports = true
210208
disallow_subclassing_any = false

rdflib/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@
4444
"""
4545
import logging
4646
import sys
47-
48-
if sys.version_info < (3, 8):
49-
# importlib is only available in Python 3.8+; for 3.7 we must do this:
50-
import importlib_metadata as metadata
51-
else:
52-
from importlib import metadata
47+
from importlib import metadata
5348

5449
_DISTRIBUTION_METADATA = metadata.metadata("rdflib")
5550

0 commit comments

Comments
 (0)