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

Building failed in Python 3.12 #141

Open
wangzcl opened this issue Nov 30, 2023 · 2 comments
Open

Building failed in Python 3.12 #141

wangzcl opened this issue Nov 30, 2023 · 2 comments

Comments

@wangzcl
Copy link

wangzcl commented Nov 30, 2023

In a Python 3.12.0 environment, the package is not able to be built when I run pip install eofs:

Collecting eofs
  Downloading eofs-1.4.0.tar.gz (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 5.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      /private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-install-sc7frlj7/eofs_6d9c0b752671431dbb381dd9967a8c61/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/Users/zwang505/Code/LGMR_EM/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/zwang505/Code/LGMR_EM/.venv/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 "/Users/zwang505/Code/LGMR_EM/.venv/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 "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-build-env-byvse4f7/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 "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-build-env-byvse4f7/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-build-env-byvse4f7/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-build-env-byvse4f7/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 38, in <module>
        File "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-install-sc7frlj7/eofs_6d9c0b752671431dbb381dd9967a8c61/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-install-sc7frlj7/eofs_6d9c0b752671431dbb381dd9967a8c61/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/qp/6xl2w1n10lb8nnt8xql_wvcc0000gq/T/pip-install-sc7frlj7/eofs_6d9c0b752671431dbb381dd9967a8c61/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.

The problem may be caused by the usage of a deprecated feature SafeConfigParser. It is deleted in Python 3.12 (see https://docs.python.org/3/whatsnew/3.12.html):

configparser no longer has a SafeConfigParser class. Use the shorter ConfigParser name instead.

The build is fine in a Python 3.11.6 environment.

Environment

Device: Macbook Air, Mac 14,2 with Apple M2 chip

System: MacOS Ventura 13.6.1

Python version: 3.12.0

@cyschneck
Copy link

With the updates to include pyproject.toml it appears like eofs is in transition from versioneer (where this issue arises from) to setuptools_scm. That should fix the pip install issue with Python 3.12.

Is there a timeline for when this will be released?

@ajdawson
Copy link
Owner

Version 1.4.1 was released today, does this solve this issue?

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

No branches or pull requests

3 participants