MDAnalysis / MDAKits

The MDAnalysis Toolkits Registry
https://mdakits.mdanalysis.org
Other
15 stars 24 forks source link

Python 3.12 versioneer help #111

Closed sef43 closed 8 months ago

sef43 commented 8 months ago

Hello MDA devs!,

I have just noticed that the CI on my repo for the MDAKit openmm-mdanalysis-reporter is failing with python 3.12: https://github.com/sef43/openmm-mdanalysis-reporter/actions/runs/7367470282

It is based on the cookie-cutter template. The error is coming from the versioneer script:

Processing /home/runner/work/openmm-mdanalysis-reporter/openmm-mdanalysis-reporter
  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'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      /home/runner/work/openmm-mdanalysis-reporter/openmm-mdanalysis-reporter/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/usr/share/miniconda3/envs/openmm-mdanalysis-reporter-test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/share/miniconda3/envs/openmm-mdanalysis-reporter-test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/share/miniconda3/envs/openmm-mdanalysis-reporter-test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-9abyg52w/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-9abyg52w/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-9abyg52w/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "/home/runner/work/openmm-mdanalysis-reporter/openmm-mdanalysis-reporter/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/home/runner/work/openmm-mdanalysis-reporter/openmm-mdanalysis-reporter/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/openmm-mdanalysis-reporter/openmm-mdanalysis-reporter/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.

I guess something needs updating?
Hopefully you have seen this before and know what I need to change, thanks!

IAlibay commented 8 months ago

@sef43 sorry to see this has affected you too - it's primarily an issue with versioneer being out of date. This unfortunately happens because we've been using versioneer in vendored mode so it doesn't update as things change. We've been slowly migrating everything on our end to use versioningit instead, which is less prone to these issues.

I've opened a quick PR on your repo to demonstrate what the changes would look like: https://github.com/sef43/openmm-mdanalysis-reporter/pull/3

IAlibay commented 8 months ago

Closing as fixed in the kit.

sef43 commented 8 months ago

Thanks @IAlibay !