Skip to content

Fix versioneer build failure on Python 3.12+ - #11

Open
lampo808 wants to merge 1 commit into
OpenSMFS:masterfrom
lampo808:fix/py312-versioneer-build
Open

Fix versioneer build failure on Python 3.12+#11
lampo808 wants to merge 1 commit into
OpenSMFS:masterfrom
lampo808:fix/py312-versioneer-build

Conversation

@lampo808

Copy link
Copy Markdown

Problem

pip install pycorrelate fails on Python 3.12+ during the
"Getting requirements to build wheel" stage:

  AttributeError: module 'configparser' has no attribute 'SafeConfigParser'

The bundled versioneer.py uses two configparser APIs that were
deprecated since Python 3.2 and removed in Python 3.12:

  • configparser.SafeConfigParser()
  • parser.readfp(...)

Fix

Replace them with their modern equivalents, which have been available
since Python 3.2:

  • configparser.ConfigParser()
  • parser.read_file(...)

This is a behavior-preserving 1:1 substitution. It works on every
supported Python 3 version (3.2 -> 3.13) -- it fixes the build on 3.12+
without breaking older interpreters.

Verification

On Python 3.12, pip wheel . --no-deps now completes successfully,
whereas before it errored out in the versioneer config step.

The bundled versioneer.py used configparser.SafeConfigParser() and
ConfigParser.readfp(), both deprecated since Python 3.2 and removed in
Python 3.12. This made `pip install pycorrelate` fail at the
"getting requirements to build wheel" stage on Python 3.12+ with:

    AttributeError: module 'configparser' has no attribute 'SafeConfigParser'

Replace them with the modern equivalents ConfigParser() and read_file(),
available on all supported Python 3 versions (3.2+), so the build works on
both older and newer interpreters without any behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant