Skip to content

Commit

Permalink
Resolve DeprecationWarning by pkg_resources by switching to importlib…
Browse files Browse the repository at this point in the history
…_metadata

"Creating a LegacyVersion has been deprecated and will be removed in the next major release"
  • Loading branch information
juhoinkinen committed Feb 21, 2022
1 parent 9dc8e6e commit bfb7a1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def read(fname):
'pytest-flask',
'pytest-flake8',
'bumpversion',
'autopep8'
'autopep8',
'importlib_metadata'
]
},
entry_points={
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import random
import re
import os.path
import pkg_resources
import importlib_metadata
import json
from click.testing import CliRunner
import annif.cli
Expand Down Expand Up @@ -806,5 +806,5 @@ def test_version_option():
annif.cli.cli, ['--version'])
assert not result.exception
assert result.exit_code == 0
version = pkg_resources.require('annif')[0].version
version = importlib_metadata.version('annif')
assert result.output.strip() == version.strip()

0 comments on commit bfb7a1a

Please sign in to comment.