Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The distutils package has been deprecated in Python 3.10 and will go away in Python 3.12. Remove an unsightly deprecation warning by migrating away from distutils now. Switch from distutils.version.LooseVersion to packaging.version.Version. No other code changes appear to be necessary. Include a unit test to verify that pySHACL imports without raising any warnings.
- Loading branch information
1 parent
3d67789
commit 14e9738
Showing
3 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
https://github.com/RDFLib/pySHACL/issues/146 | ||
""" | ||
|
||
import warnings | ||
|
||
|
||
def test_146() -> None: | ||
# Ensure that importing pyshacl triggers no warnings. | ||
with warnings.catch_warnings(record=True) as warning_context: | ||
# Cause all warnings to always be triggered. | ||
warnings.simplefilter("always") | ||
# Import pyshacl, which should not trigger any warnings | ||
import pyshacl | ||
# Verify some things | ||
assert len(warning_context) == 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
test_146() |