praiskup / argparse-manpage

Automatically build man-pages for your Python project
Apache License 2.0
40 stars 21 forks source link

4.3: `argparse-manpage` uses deprecated `pkg_resources` module #98

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

pytest already shows

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-argparse-manpage-4.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-argparse-manpage-4.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/argparse-manpage-4.3
configfile: pytest.ini
collected 21 items

tests/test_basic.py ...                                                                                                                                                               [ 14%]
tests/test_examples.py ..s.s.s.s.s.s.                                                                                                                                                 [ 80%]
tests/test_script.py ....                                                                                                                                                             [100%]

===================================================================================== warnings summary ======================================================================================
tests/argparse_testlib.py:7
  /home/tkloczko/rpmbuild/BUILD/argparse-manpage-4.3/tests/argparse_testlib.py:7: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import parse_version

../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871
  /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
SKIPPED [6] tests/argparse_testlib.py:26: Too old Python version for testing PIP installation (Python 3.10 required, have 3.8.17)
========================================================================= 15 passed, 6 skipped, 6 warnings in 3.03s =========================================================================
[tkloczko@pers-jacek argparse-manpage-4.3]$ grep -r pkg_resources
examples/copr/copr_cli/main.py:import pkg_resources
examples/copr/copr_cli/main.py:        # pkg_resources magic doesn't work during 'setup.py build', but it
examples/copr/copr_cli/main.py:    return pkg_resources.require('copr-cli')[0].version
tests/argparse_testlib.py:from pkg_resources import parse_version
praiskup commented 1 year ago

Thank you very much for the report, this is being tracked in #86.