Skip to content

Conversation

@2xyo
Copy link

@2xyo 2xyo commented Jun 4, 2025

pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30.

Before

$ pytest -v tests/tests.py
================================================= test session starts ==================================================
platform linux -- Python 3.12.3, pytest-8.4.0, pluggy-1.6.0 -- /home/yo/exp/.venv-cve/bin/python3
cachedir: .pytest_cache
rootdir: /home/yo/exp/PyCVESearch
configfile: pyproject.toml
collected 0 items / 1 error

======================================================== ERRORS ========================================================
___________________________________________ ERROR collecting tests/tests.py ____________________________________________
ImportError while importing test module '/home/yo/exp/PyCVESearch/tests/tests.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/tests.py:5: in <module>
    from pycvesearch import CVESearch
pycvesearch/__init__.py:4: in <module>
    from .core import CVESearch
pycvesearch/core.py:4: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'
=============================================== short test summary info ================================================
ERROR tests/tests.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================== 1 error in 0.07s ===================================================

$ pip install setuptools
Collecting setuptools
  Using cached setuptools-80.9.0-py3-none-any.whl.metadata (6.6 kB)
Using cached setuptools-80.9.0-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
Successfully installed setuptools-80.9.0

$ pytest -v tests/tests.py
================================================= test session starts ==================================================
platform linux -- Python 3.12.3, pytest-8.4.0, pluggy-1.6.0 -- /home/yo/exp/.venv-cve/bin/python3
cachedir: .pytest_cache
rootdir: /home/yo/exp/PyCVESearch
configfile: pyproject.toml
collected 7 items

tests/tests.py::TestPyCVESearch::test_browse PASSED                                                              [ 14%]
tests/tests.py::TestPyCVESearch::test_cpe22 PASSED                                                               [ 28%]
tests/tests.py::TestPyCVESearch::test_cpe23 PASSED                                                               [ 42%]
tests/tests.py::TestPyCVESearch::test_dbinfo PASSED                                                              [ 57%]
tests/tests.py::TestPyCVESearch::test_id PASSED                                                                  [ 71%]
tests/tests.py::TestPyCVESearch::test_last PASSED                                                                [ 85%]
tests/tests.py::TestPyCVESearch::test_last_50 PASSED                                                             [100%]

=================================================== warnings summary ===================================================
pycvesearch/core.py:4
  /home/yo/exp/PyCVESearch/pycvesearch/core.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
    import pkg_resources

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================= 7 passed, 1 warning in 5.56s =============================================

After

$ pytest -v tests/tests.py
================================================= test session starts ==================================================
platform linux -- Python 3.12.3, pytest-8.4.0, pluggy-1.6.0 -- /home/yo/exp/.venv-cve/bin/python3
cachedir: .pytest_cache
rootdir: /home/yo/exp/PyCVESearch
configfile: pyproject.toml
collected 7 items

tests/tests.py::TestPyCVESearch::test_browse PASSED                                                              [ 14%]
tests/tests.py::TestPyCVESearch::test_cpe22 PASSED                                                               [ 28%]
tests/tests.py::TestPyCVESearch::test_cpe23 PASSED                                                               [ 42%]
tests/tests.py::TestPyCVESearch::test_dbinfo PASSED                                                              [ 57%]
tests/tests.py::TestPyCVESearch::test_id PASSED                                                                  [ 71%]
tests/tests.py::TestPyCVESearch::test_last PASSED                                                                [ 85%]
tests/tests.py::TestPyCVESearch::test_last_50 PASSED                                                             [100%]

================================================== 7 passed in 4.42s ===================================================

pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant