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

cf-units doesn't install with pip on Python 3.12.3 #432

Closed
Tracked by #450
huaracheguarache opened this issue Jun 19, 2024 · 8 comments
Closed
Tracked by #450

cf-units doesn't install with pip on Python 3.12.3 #432

huaracheguarache opened this issue Jun 19, 2024 · 8 comments
Assignees
Labels
community New: Issue Highlight a new community raised "generic" issue Type: Bug Type: Infrastructure

Comments

@huaracheguarache
Copy link

huaracheguarache commented Jun 19, 2024

🐛 Bug Report

I am unable to install cf-units using a Python venv together with pip using Python version 3.12.3. I get an error message saying that wheel failed to build for cf-units (see attached traceback).

How to Reproduce

Steps to reproduce the behaviour:

  1. Create a python virtual environment: python -m venv .venv
  2. Activate it: source .venv/bin/activate
  3. Upgrade pip: python -m pip install --upgrade pip
  4. Try to install cf-units: python -m pip install cf-units

Expected Behaviour

cf-units installs without issues.

Environment

  • OS & Version: Fedora 40 Silverblue
  • cf-units Version: 3.2.0 (the one that it tries to install)
  • Python Version: 3.12.3
  • pip Version: 24.0

Additional Context

Click to expand this section...
(.venv) michael@localhost:~/src/koding/test$ python -m pip install cf-units
Collecting cf-units
  Using cached cf-units-3.2.0.tar.gz (165 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting antlr4-python3-runtime==4.7.2 (from cf-units)
  Using cached antlr4_python3_runtime-4.7.2-py3-none-any.whl
Collecting cftime>=1.2 (from cf-units)
  Using cached cftime-1.6.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.7 kB)
Collecting jinja2 (from cf-units)
  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting numpy (from cf-units)
  Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting MarkupSafe>=2.0 (from jinja2->cf-units)
  Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Using cached cftime-1.6.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB)
Using cached numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
Building wheels for collected packages: cf-units
  Building wheel for cf-units (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cf-units (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "/var/home/michael/src/koding/test/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/var/home/michael/src/koding/test/.venv/lib64/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 "/var/home/michael/src/koding/test/.venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_zcl5ayp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_zcl5ayp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-_zcl5ayp/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 152, in <module>
        File "<string>", line 75, in get_package_data
      ValueError: Require to set UDUNITS2_XML_PATH for a cf-units wheel build.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cf-units
Failed to build cf-units
ERROR: Could not build wheels for cf-units, which is required to install pyproject.toml-based projects
@huaracheguarache huaracheguarache added New: Issue Highlight a new community raised "generic" issue Type: Bug labels Jun 19, 2024
@ocefpaf
Copy link
Member

ocefpaf commented Jun 19, 2024

There are no wheels for py312. You need to build it from source there. You will need udunits2 to build it from source.

@echoix
Copy link

echoix commented Jun 22, 2024

In the OSGeo/grass-addons repo, trying to use Python 3.12thus creating a wheel locally fails even in CI. Is it possible to take a new look at this? We are getting closer to the next 3.13 release in October than we are from the last 3.12 release

@rcomer rcomer linked a pull request Jun 22, 2024 that will close this issue
@rcomer
Copy link
Member

rcomer commented Jun 22, 2024

I guess we need #423 since that adds support for py312. Then of course we need a new release.

@echoix
Copy link

echoix commented Jun 22, 2024

I see... I postponed the migration to Python 3.12 (I was syncing the CI workflows with the changes that the non-addons repo grass was using, and the new release would have used 3.12 by default).

@ocefpaf
Copy link
Member

ocefpaf commented Jun 25, 2024

I guess we need #423 since that adds support for py312. Then of course we need a new release.

I believe that we don't need #423, PR #368, that was already merged, would do. I am building cf-units for Python 3.12 in conda-forge for a while now. All we need is a new release here. Note that #427 would be nice though, that one adds numpy 2.0 support.

@rcomer rcomer removed a link to a pull request Jun 25, 2024
@stephenworsley
Copy link
Contributor

@SciTools/peloton We agree that a release is perhaps overdue for this, @pp-mo @bjlittle will be looking into this.

@trexfeathers
Copy link
Collaborator

Just to confirm from a conversation with @bjlittle: the error reported by @huaracheguarache (love the name!) is always expected - UDUNITS2 is not available via Pip and must therefore always be installed by other means (e.g. Conda). This is part of the motive for #446.

@trexfeathers
Copy link
Collaborator

As for the various other comments - which are not truly related to this error - we have made progress in the last few days:

After that I'm assuming a release won't be far away @pp-mo?

@trexfeathers trexfeathers closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community New: Issue Highlight a new community raised "generic" issue Type: Bug Type: Infrastructure
Projects
Status: Done
Status: Done
Development

No branches or pull requests

7 participants