Skip to content

Commit

Permalink
Merge pull request #216 from RDFLib/drop_37
Browse files Browse the repository at this point in the history
Drop Python 3.7, drop RDFLib 6.2, update Black and Ruff, bump importlib-metadata
  • Loading branch information
ashleysommer authored Nov 23, 2023
2 parents accd55e + 4a15072 commit c18e8b9
Show file tree
Hide file tree
Showing 9 changed files with 362 additions and 432 deletions.
75 changes: 52 additions & 23 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
---
kind: pipeline
name: python-3-7
type: docker
platform:
os: linux
arch: amd64

steps:
- name: test-3-7
image: python:3.7
environment:
TOX_WORK_DIR: /tmp/.tox
volumes:
- name: tox_cache
path: /tmp/.tox
commands:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e py37

volumes:
- name: tox_cache
temp: {}

---
kind: pipeline
Expand Down Expand Up @@ -100,6 +77,10 @@ steps:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e py39

volumes:
- name: tox_cache
temp: {}

---
kind: pipeline
name: python-3-10
Expand Down Expand Up @@ -141,6 +122,10 @@ steps:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e lint

volumes:
- name: tox_cache
temp: {}

---
kind: pipeline
name: python-3-11
Expand Down Expand Up @@ -184,3 +169,47 @@ steps:
volumes:
- name: tox_cache
temp: {}

---
kind: pipeline
name: python-3-12
type: docker
platform:
os: linux
arch: amd64

steps:
- name: test-3-12
image: python:3.12
environment:
TOX_WORK_DIR: /tmp/.tox
volumes:
- name: tox_cache
path: /tmp/.tox
commands:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e py312
- name: type-checking-3-12
image: python:3.12
environment:
TOX_WORK_DIR: /tmp/.tox
volumes:
- name: tox_cache
path: /tmp/.tox
commands:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e type-checking
- name: lint-3-12
image: python:3.12
environment:
TOX_WORK_DIR: /tmp/.tox
volumes:
- name: tox_cache
path: /tmp/.tox
commands:
- pip3 install --upgrade "tox>=4.0.8"
- tox -e lint

volumes:
- name: tox_cache
temp: {}
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Python PEP 440 Versioning](https://www.python.org/d
## [Unreleased]
- Nothing yet...

## [0.25.0] - 2023-11-23
### Changed
- Dropped support for Python 3.7
- Note, for compatibility with RDFLib 7.0, we specify a minimum Python version of v3.8.1
- https://github.com/RDFLib/rdflib/blob/3bee979cd0e5b6efc57296b4fc43dd8ede8cf375/CHANGELOG.md?plain=1#L53
- Add preliminary support for Python 3.12
- Dropped support for RDFLib v6.2.0 and earlier
- Only RDFLib v6.3.2 and v7.0 are supported by PySHACL v0.25.0+
- Bumped to updated version of Black and Ruff
- Reformatted everything according to py38 codestyle
### Fixed
- Do not hard-pin to importlib-metadata. Fixes #214

## [0.24.1] - 2023-11-23
## Note - The 0.24.x series is the last to support Python 3.7
### RDFLib v7.0.0 and some other dependencies already don't support 3.7, so PySHACL will drop it from 0.25+
Expand Down Expand Up @@ -1078,7 +1091,8 @@ just leaves the files open. Now it is up to the command-line client to close the

- Initial version, limited functionality

[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.24.1...HEAD
[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.25.0...HEAD
[0.25.0]: https://github.com/RDFLib/pySHACL/compare/v0.24.1...v0.25.0
[0.24.1]: https://github.com/RDFLib/pySHACL/compare/v0.24.0...v0.24.1
[0.24.0]: https://github.com/RDFLib/pySHACL/compare/v0.23.0...v0.24.0
[0.23.0]: https://github.com/RDFLib/pySHACL/compare/v0.22.2...v0.23.0
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors:
given-names: "Nicholas"
orcid: "http://orcid.org/0000-0002-8742-7730"
title: "pySHACL"
version: 0.24.1
version: 0.25.0
doi: 10.5281/zenodo.4750840
license: Apache-2.0
date-released: 2022-01-13
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /home/pyshacl
RUN addgroup -g 1000 -S pyshacl &&\
adduser --disabled-password --gecos "" --home "$(pwd)" --ingroup "pyshacl" --no-create-home --uid 1000 pyshacl
WORKDIR /app
LABEL org.opencontainers.image.version="0.24.1"
LABEL org.opencontainers.image.version="0.25.0"
COPY . .
RUN chown -R pyshacl:pyshacl /home/pyshacl /app && chmod -R 775 /home/pyshacl /app
USER pyshacl
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ usage: pyshacl [-h] [-s [SHACL]] [-e [ONT]] [-i {none,rdfs,owlrl,both}] [-m]
[-ef {auto,turtle,xml,json-ld,nt,n3}] [-V] [-o [OUTPUT]]
DataGraph

PySHACL 0.24.1 command line tool.
PySHACL 0.25.0 command line tool.

positional arguments:
DataGraph The file containing the Target Data Graph.
Expand Down
657 changes: 272 additions & 385 deletions poetry.lock

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
requires = ["poetry-core>=1.8.1,<2"]
build-backend = "poetry.core.masonry.api"

[project]
name = "pyshacl"
# Black and Ruff both now read target-version from [project.requires-python]
requires-python = ">=3.8.1"

[tool.poetry]
name = "pyshacl"
version = "0.24.1"
version = "0.25.0"
# Don't forget to change the version number in __init__.py, Dockerfile, and CITATION.cff along with this one
description = "Python SHACL Validator"
license = "Apache-2.0"
Expand All @@ -24,11 +29,11 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent"
]
Expand All @@ -54,26 +59,24 @@ include = [
]

[tool.poetry.dependencies]
python = "^3.7.0" # Compatible python versions must be declared here
rdflib = [
{version=">=6.3.2,<8.0", python = ">=3.8.1"},
{version=">=6.2.0,<=6.3.2", python = "<3.8.1"}
]
python = "^3.8.1" # Poetry doesn't read from [project.requires-python]
# Note, 3.8.0 is not supported, only 3.8.1 or above. See:
# https://github.com/RDFLib/rdflib/blob/3bee979cd0e5b6efc57296b4fc43dd8ede8cf375/CHANGELOG.md?plain=1#L53
rdflib = {version=">=6.3.2,<8.0", python = ">=3.8.1"}
html5lib = ">=1.1,<2"
owlrl = ">=6.0.2,<7"
prettytable = [
{version=">=3.5.0,<3.8.0", python = "<3.8"},
{version=">=3.5.0", python = ">=3.8,<3.12"},
{version=">=3.7.0", python = ">=3.12"}
]
packaging = ">=21.3"
importlib-metadata = {version="4.13", python = "<3.11"}
importlib-metadata = {version=">6", python = "<3.12"}
pyduktape2 = {version="^0.4.6", optional=true}
sanic = {version=">=22.12, <23", optional=true} #For the HTTP service
sanic-ext = {version=">=23.3, <23.6", optional=true} #For the HTTP service
sanic-cors = {version="2.2.0", optional=true} #For the HTTP service
ruff = {version="^0.0.267", optional=true}
black = {version="23.3.0", optional=true}
ruff = {version="^0.1.5", optional=true}
black = {version="23.11.0", optional=true}
mypy = [
{version=">=0.812,<0.900", optional=true, python = "<3.10"},
{version=">=0.900,<0.1000", optional=true, python = ">=3.10"}
Expand All @@ -87,7 +90,8 @@ pytest-cov = {version="^2.8.1", optional=true}
pytest = "^7.2"
coverage = {version=">6,<7,!=6.0.*,!=6.1,!=6.1.1", optional=true}
pytest-cov = {version="^2.8.1", optional=true}
ruff = {version="^0.0.267", optional=true}
ruff = {version="^0.1.5", optional=true}
black = {version="23.11.0", optional=true}
mypy = [
{version=">=0.812,<0.900", optional=true, python = "<3.10"},
{version=">=0.900,<0.1000", optional=true, python = ">=3.10"}
Expand All @@ -113,10 +117,9 @@ from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}

[tool.black]
required-version = "23.3.0"
required-version = "23.11.0"
line-length = "119"
skip-string-normalization = true
target-version = ['py37']
include = '\.pyi?$'
exclude = '''
(
Expand Down Expand Up @@ -184,9 +187,6 @@ line-length = 119
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py37"

[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
Expand All @@ -204,7 +204,7 @@ testpaths = [
legacy_tox_ini = """
[tox]
skipsdist = true
envlist = py38, py39, py310, py311, lint, type-checking
envlist = py38, py39, py310, py311, py312, lint, type-checking
toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
Expand Down
2 changes: 1 addition & 1 deletion pyshacl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .validate import Validator, validate

# version compliant with https://www.python.org/dev/peps/pep-0440/
__version__ = '0.24.1'
__version__ = '0.25.0'
# Don't forget to change the version number in pyproject.toml, Dockerfile, and CITATION.cff along with this one

__all__ = ['validate', 'Validator', '__version__', 'Shape', 'ShapesGraph']
2 changes: 1 addition & 1 deletion pyshacl/extras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sys import version_info as python_version
from warnings import warn

if python_version[:2] < (3, 11):
if python_version[:2] < (3, 12):
from importlib_metadata import PackageNotFoundError, metadata
else:
from importlib.metadata import PackageNotFoundError, metadata # type: ignore[assignment]
Expand Down

0 comments on commit c18e8b9

Please sign in to comment.