Skip to content

Commit

Permalink
Fix pkg_resources deprecation (#409)
Browse files Browse the repository at this point in the history
* Convert deprecation warning to error in tests

* Switch to importlib_metadata to get version number
  • Loading branch information
beroda authored Apr 3, 2023
1 parent d9f8e05 commit af3dbfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 2 additions & 6 deletions chaospy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
import logging
import os
import pkg_resources
import importlib_metadata

from numpoly import *

Expand All @@ -29,11 +29,7 @@
from chaospy.external import *
from chaospy.recurrence import *

try:
__version__ = pkg_resources.get_distribution("chaospy").version
except pkg_resources.DistributionNotFound: # pragma: no cover
__version__ = None

__version__ = importlib_metadata.version("chaospy")

def configure_logging():
"""Configure logging for Chaospy."""
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ dev = [
"build",
"twine",
]

[tool.pytest.ini_options]
filterwarnings = [
"error::DeprecationWarning",
"ignore:elementwise:DeprecationWarning"
]

0 comments on commit af3dbfe

Please sign in to comment.