Skip to content

Commit

Permalink
Pinned JSON-ld dep to <6.0 to avoid the tombstone release (so not to …
Browse files Browse the repository at this point in the history
…force rdflib 6.0)

Updated minimum Black version to 21.8b0 to fix a black bug
Re-black and isort all source files
Fixed detection of import error when loading json-ld module in RDF loader
Fixed Black bug with new version of black
  • Loading branch information
ashleysommer committed Sep 12, 2021
1 parent dfa3adf commit 3720c68
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 82 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Python PEP 440 Versioning](https://www.python.org/dev/peps/pep-0440/).

## [0.16.2] - 2021-09-13

## Notice
This is the **last version of PySHACL to support RDFLib 5.0.0**, subsequent releases of PySHACL will depend on RDFLib v6.0.0.
As a direct result of that, this is also the **last version of PySHACL to support Python v3.6**.

### Changed
- Pinned JSON-ld dep to <6.0 to avoid the tombstone release (so not to force rdflib 6.0)
- Updated minimum Black version to 21.8b0 to fix a black bug
- Re-black and isort all source files

### Fixed
- Fixed detection of import error when loading json-ld module in RDF loader
- Fixed Black bug with new version of black


## [0.16.1] - 2021-08-20

### Added
Expand Down Expand Up @@ -788,7 +804,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.16.1...HEAD
[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.16.2...HEAD
[0.16.2]: https://github.com/RDFLib/pySHACL/compare/v0.16.1...v0.16.2
[0.16.1]: https://github.com/RDFLib/pySHACL/compare/v0.16.0...v0.16.1
[0.16.0]: https://github.com/RDFLib/pySHACL/compare/v0.15.0...v0.16.0
[0.15.0]: https://github.com/RDFLib/pySHACL/compare/v0.14.5...v0.15.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.16.1
version: 0.16.2
doi: 10.5281/zenodo.4750840
license: Apache-2.0
date-released: 2021-07-20
Expand Down
159 changes: 88 additions & 71 deletions poetry.lock

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyshacl"
version = "0.16.1"
version = "0.16.2"
# Don't forget to change the version number in __init__.py and CITATION.cff along with this one
description = "Python SHACL Validator"
license = "Apache-2.0"
Expand All @@ -22,6 +22,12 @@ classifiers = [
"Natural Language :: English",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent"
]
Expand Down Expand Up @@ -50,18 +56,19 @@ include = [
python = "^3.6.2" # Compatible python versions must be declared here
rdflib = ">=5.0.0,<7"
owlrl = "^5.2.1"
rdflib-jsonld = ">=0.4.0,<0.6"
pyduktape2 = {version="^0.4.1", python=">=3.6", optional=true}
flake8 = {version="^3.8.0", python=">=3.6", optional=true}
isort = {version="^5.7.0", python=">=3.6", optional=true}
black = {version="21.6b0", python=">=3.6", optional=true}
black = {version="21.8b0", python=">=3.6", optional=true}

[tool.poetry.dev-dependencies]
coverage = "^4.5"
pytest = "^5.0"
pytest-cov = "^2.8.1"
flake8 = {version="^3.8.0", python=">=3.6", optional=true}
isort = {version="^5.7.0", python=">=3.6", optional=true}
black = {version="21.6b0", python=">=3.6", optional=true}
black = {version="21.8b0", python=">=3.6", optional=true}
mypy = {version="^0.800", python=">=3.6", optional=true}


Expand All @@ -78,7 +85,7 @@ from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}

[tool.black]
required-version = "21.6b0"
required-version = "21.8b0"
line-length = "119"
skip-string-normalization = true
target-version = ['py36']
Expand Down
2 changes: 1 addition & 1 deletion pyshacl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


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

__all__ = ['validate', 'Validator', '__version__', 'Shape', 'ShapesGraph']
3 changes: 2 additions & 1 deletion pyshacl/extras/js/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self, shapes_graph: 'ShapesGraph', node):
for m in msgs_iter:
if not isinstance(m, Literal):
raise ConstraintLoadError(
"JSConstraint sh:message must be a RDF Literal.", "https://www.w3.org/TR/shacl-js/#js-constraints",
"JSConstraint sh:message must be a RDF Literal.",
"https://www.w3.org/TR/shacl-js/#js-constraints",
)
if not isinstance(m.value, str):
raise ConstraintLoadError(
Expand Down
2 changes: 1 addition & 1 deletion pyshacl/rdfutil/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import rdflib_jsonld # noqa: F401

has_json_ld = True
except IndexError:
except ImportError:
has_json_ld = False

is_windows = platform.system() == "Windows"
Expand Down
6 changes: 4 additions & 2 deletions pyshacl/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ def gather_rules(shacl_graph: 'ShapesGraph', iterate_rules=False) -> Dict['Shape
overlaps = triple_rule_nodes.intersection(js_rule_nodes)
if len(overlaps) > 0:
raise RuleLoadError(
"A SHACL Rule cannot be both a TripleRule and a JSRule.", "https://www.w3.org/TR/shacl-af/#rules-syntax",
"A SHACL Rule cannot be both a TripleRule and a JSRule.",
"https://www.w3.org/TR/shacl-af/#rules-syntax",
)
overlaps = sparql_rule_nodes.intersection(js_rule_nodes)
if len(overlaps) > 0:
raise RuleLoadError(
"A SHACL Rule cannot be both a SPARQLRule and a JSRule.", "https://www.w3.org/TR/shacl-af/#rules-syntax",
"A SHACL Rule cannot be both a SPARQLRule and a JSRule.",
"https://www.w3.org/TR/shacl-af/#rules-syntax",
)
used_rules = shacl_graph.subject_objects(SH_rule)
ret_rules = defaultdict(list)
Expand Down

0 comments on commit 3720c68

Please sign in to comment.