Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioneer is not compatible with Python 3.12 #11

Open
LeonReinPMD opened this issue Dec 11, 2023 · 5 comments · May be fixed by #12
Open

Versioneer is not compatible with Python 3.12 #11

LeonReinPMD opened this issue Dec 11, 2023 · 5 comments · May be fixed by #12

Comments

@LeonReinPMD
Copy link

The used Versioneer package uses SafeConfigParser, which was deprecated in Python 3.2 and removed in 3.12.

Please update to the newest version of Versioneer or remove it entirely to be compatible with Python 3.12.

@dechamps
Copy link

Seconded. For reference, here's an example error when attempting to pull si-prefix with Python 3.12:

Collecting si-prefix==1.2.2 (from videojitter)
  Downloading si-prefix-1.2.2.tar.gz (64 kB)
     ---------------------------------------- 64.9/64.9 kB ? eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

PIP STDERR
----------
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      C:\Users\etien\AppData\Local\Temp\pip-install-s5_pges4\si-prefix_a5e1a90705c34c81b28d4b587ba49811\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "C:\Users\etien\AppData\Local\pipx\pipx\shared\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\etien\AppData\Local\pipx\pipx\shared\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\etien\AppData\Local\pipx\pipx\shared\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\etien\AppData\Local\Temp\pip-build-env-0nm0e61l\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\etien\AppData\Local\Temp\pip-build-env-0nm0e61l\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\etien\AppData\Local\Temp\pip-build-env-0nm0e61l\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\etien\AppData\Local\Temp\pip-build-env-0nm0e61l\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
        File "C:\Users\etien\AppData\Local\Temp\pip-install-s5_pges4\si-prefix_a5e1a90705c34c81b28d4b587ba49811\versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "C:\Users\etien\AppData\Local\Temp\pip-install-s5_pges4\si-prefix_a5e1a90705c34c81b28d4b587ba49811\versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\etien\AppData\Local\Temp\pip-install-s5_pges4\si-prefix_a5e1a90705c34c81b28d4b587ba49811\versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@dechamps
Copy link

dechamps commented Dec 24, 2023

Also for reference, the issue on the Versioneer side is python-versioneer/python-versioneer#375

dechamps added a commit to dechamps/videojitter that referenced this issue Dec 24, 2023
dechamps added a commit to dechamps/videojitter that referenced this issue Dec 24, 2023
dechamps added a commit to dechamps/si-prefix that referenced this issue Dec 24, 2023
This commit is the untouched output of `versioneer install --vendor`.

Fixes cfobel#11
@dechamps dechamps linked a pull request Dec 24, 2023 that will close this issue
@dechamps
Copy link

I took the liberty of sending a PR to upgrade versioneer in #12.

@Tomaubier
Copy link

Hi,
Any update on that? Is there any way to manually fix the issue ?
Best
Tom

@dechamps
Copy link

dechamps commented Mar 1, 2024

@Tomaubier For my project I ended up working around it by vendoring si-prefix directly inside my code instead of depending on the pip package. This is fairly trivial to do since si-prefix is very small and does not have any dependencies.

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 a pull request may close this issue.

3 participants