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

Installing some old dependencies migh fail local builds #2411

Closed
potiuk opened this issue Mar 13, 2024 · 3 comments
Closed

Installing some old dependencies migh fail local builds #2411

potiuk opened this issue Mar 13, 2024 · 3 comments
Labels
question Asking for clarification or support

Comments

@potiuk
Copy link

potiuk commented Mar 13, 2024

Installing some old, dependencies that require buidling local wheels, might lead to failures of the build project - especially when --lowest-direct resolution is used.

I encountered this wiht zenpy dependency of Airflow, which has no matching platform wheel and their lowest applicable version has some problems with pyproject.toml not being correct (similar to the issue solved in 0.1.17 with direct installation in #2302.

It's reproducible with 1a8c3bacd5b46b7224b6f0558e8fe36de8bb9ff0 commit hash of apache airflow

uv pip install --upgrade --resolution lowest-direct --editable '.[devel-ci]'                
   Built file:///home/jarek/code/airflow                                                                                                                                                                                                                                                                                                                                                      Built 1 editable in 4.84s
error: Failed to download and build: zenpy==2.0.32
  Caused by: Failed to build: zenpy==2.0.32
  Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
--- stdout:

--- stderr:
/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/dist.py:476: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'description-file' will not be supported in future
        versions. Please use the underscore name 'description_file' instead.

        By 2024-Sep-26, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  opt = self.warn_dash_deprecation(opt, section)
/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored.
!!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `license = 'GPLv3'`

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `license` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table

        To prevent this problem, you can list `license` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

!!
  _handle_missing_dynamic(dist, project_table)
/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: _MissingDynamic: `keywords` defined outside of `pyproject.toml` is ignored.
!!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `keywords = ['zendesk', 'api', 'wrapper']`

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `keywords` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table

        To prevent this problem, you can list `keywords` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

!!
  _handle_missing_dynamic(dist, project_table)
/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: _MissingDynamic: `dependencies` defined outside of `pyproject.toml` is ignored.
!!

        ********************************************************************************
        The following seems to be defined outside of `pyproject.toml`:

        `dependencies = ['requests>=2.14.2', 'python-dateutil>=2.7.5', 'cachetools>=3.1.0', 'pytz>=2018.9', 'six>=1.14.0']`

        According to the spec (see the link below), however, setuptools CANNOT
        consider this value unless `dependencies` is listed as `dynamic`.

        https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table

        To prevent this problem, you can list `dependencies` under `dynamic` or alternatively
        remove the `[project]` table from your file and rely entirely on other means of
        configuration.
        ********************************************************************************

!!
  _handle_missing_dynamic(dist, project_table)
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 4, in <module>
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 159, in setup
    dist.parse_config_files()
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/_virtualenv.py", line 22, in parse_config_files
    result = old_parse_config_files(self, *args, **kwargs)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/dist.py", line 631, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 69, in apply_configuration
    return _apply(dist, config, filepath)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 57, in apply
    _apply_project_table(dist, config, root_dir)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 83, in _apply_project_table
    corresp(dist, value, root_dir)
  File "/home/jarek/.cache/uv/.tmprbvDM3/.venv/lib/python3.8/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 184, in _license
    _set_config(dist, "license", val["text"])
KeyError: 'text'
---
@potiuk
Copy link
Author

potiuk commented Mar 13, 2024

BTW. Bumping min version of zenpy helped in this case: apache/airflow#38110 - but it would be nice if uv does not crash when they encounter a somewhat broken dependency that fails during wheel building for it.

@zanieb
Copy link
Member

zanieb commented Mar 13, 2024

What do you expect us to do here? If the lowest direct version is broken it seems like we should fail? I think adjusting the minimum version or excluding builds for the problematic package i.e. --no-build <package> makes sense as the solution?

@zanieb zanieb added the question Asking for clarification or support label Mar 13, 2024
@potiuk
Copy link
Author

potiuk commented Mar 14, 2024

If --no-build is an option then yes, we can close it, I just thought that in this case the failure should be avoided - but you are right - this is setuptools problem rather than uv or resolution problem. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants