erikrose / parsimonious

The fastest pure-Python PEG parser I can muster
MIT License
1.8k stars 126 forks source link

deprecation warnings in python 3.x #189

Closed lonnen closed 2 years ago

lonnen commented 2 years ago

There are six warnings in a run of the tests. They should be addressed:

===================================== warnings summary =====================================
parsimonious/tests/test_grammar.py::GrammarTests::test_callability_custom_rules
parsimonious/tests/test_grammar.py::GrammarTests::test_callability_custom_rules
parsimonious/tests/test_grammar.py::GrammarTests::test_callability_custom_rules
parsimonious/tests/test_grammar.py::GrammarTests::test_complex_custom_rules
parsimonious/tests/test_grammar.py::GrammarTests::test_simple_custom_rules
parsimonious/tests/test_grammar.py::GrammarTests::test_unconnected_custom_rules
  /Users/lonnen/repos/parsimonious/parsimonious/expressions.py:71: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
    num_args = len(getargspec(callable).args)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 74 passed, 2 skipped, 6 warnings in 0.50s =========================
lonnen commented 2 years ago

working branch: https://github.com/lonnen/parsimonious/tree/189-resolve-warnings

Commit 67d92ef5b1f81ca1b43ab467fcd8822e2a6277f9 resolves the warnings captured during test runs, such that there is no longer a warnings summary or warnings listen in the overall test summary.

There remains an unresolved warning outside of the test suite:

/Users/lonnen/repos/parsimonious/.tox/py310/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.

This is related to a planned and upcoming change in setuptools, though pytest-runner is the source of the warning in this environment. It has a deprecation notice that recommends avoiding setup_requires and test_requires in setup.py. Since Parsimonious no longer supports python 2.x, we can remove pytest-runner and the associated fields of setup.py. tox.ini contains the necessary information to setup and run the test environment for Python 3.x versions. While we're there we may as well also remove the import multiprocess hack for python 2.6.

lonnen commented 2 years ago

resolved by: 9a0d2e4fb6dad90d52f95aaed028e119514b9264 edc91860f6d76b0bce179bc3a692cbbecc2684b6