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

Prepare versioneer.py for Python 3.12. #229

Closed
wants to merge 1 commit into from

Conversation

emollier
Copy link

As seen first in Debian bug #1058220, execution of the versioneer.py script fails with Python 3.12 with the following error:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/setup.py", line 16, in <module>
    version=versioneer.get_version(),
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/versioneer.py", line 1481, in get_version
    return get_versions()["version"]
           ^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/versioneer.py", line 1413, in get_versions
    cfg = get_config_from_root(root)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/versioneer.py", line 343, in get_config_from_root
    parser = configparser.SafeConfigParser()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

This patch follows Python 3.12 configparser porting guidelines to resolve this issue.

As seen first in [Debian bug #1058220], execution of the versioneer.py
script fails with Python 3.12 with the following error:

	Traceback (most recent call last):
	  File "/<<PKGBUILDDIR>>/setup.py", line 16, in <module>
	    version=versioneer.get_version(),
	            ^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/<<PKGBUILDDIR>>/versioneer.py", line 1481, in get_version
	    return get_versions()["version"]
	           ^^^^^^^^^^^^^^
	  File "/<<PKGBUILDDIR>>/versioneer.py", line 1413, in get_versions
	    cfg = get_config_from_root(root)
	          ^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/<<PKGBUILDDIR>>/versioneer.py", line 343, in get_config_from_root
	    parser = configparser.SafeConfigParser()
	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

This patch follows [Python 3.12 configparser porting guidelines] to
resolve this issue.

[Debian bug #1058220]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058220
[Python 3.12 configparser porting guidelines]: https://docs.python.org/3/whatsnew/3.12.html#configparser

Signed-off-by: Étienne Mollier <emollier@debian.org>
@gregcaporaso
Copy link
Member

Thanks for this PR @emollier. We are going to address this across all of our packages (planned for the 2024.10 release of QIIME 2) in one pass, so I'm going to close.

@emollier
Copy link
Author

emollier commented May 30, 2024 via email

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.

None yet

2 participants