alanhamlett/pip-update-requirements

Support for Python 3.12

lancelote opened this issue · 0 comments

With Python 3.12.0rc1

% pur -r requirements.txt 
Error: Traceback (most recent call last):
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/__init__.py", line 132, in pur
    update_requirements(
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/__init__.py", line 201, in update_requirements
    _update_requirements(
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/__init__.py", line 264, in _update_requirements
    for line, req, spec_ver, latest_ver in requirements:
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/__init__.py", line 344, in _get_requirements_and_latest
    session = PipSession(
              ^^^^^^^^^^^
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/packages/pip/_internal/network/session.py", line 282, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/packages/pip/_internal/network/session.py", line 157, in user_agent
    setuptools_dist = get_default_environment().get_distribution("setuptools")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/packages/pip/_internal/metadata/__init__.py", line 24, in get_default_environment
    from .pkg_resources import Environment
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/packages/pip/_internal/metadata/pkg_resources.py", line 9, in <module>
    from pip._vendor import pkg_resources
  File "/Users/User/git/leetcode/.venv/lib/python3.12/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 2164, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?