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

Automatically add files referenced by configuration to sdist #3779

Merged
merged 13 commits into from Jan 20, 2023

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Jan 19, 2023

This PR is an alternative to #3771. Both solve the same problem, but use different implementations...

Summary of changes

  • Add a "protected" attribute to the Distribution class: _referenced_files
  • During config expansion, populate this attribute when the file directive is used
  • Use the same approach for pyproject.toml's project.readme and project.license.file.

Closes #2821 #3570

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review January 19, 2023 21:36
@abravalheri abravalheri merged commit 9ad7d34 into pypa:main Jan 20, 2023
@abravalheri abravalheri deleted the add-referenced-files branch January 20, 2023 11:43
@recordedfuture-dev
Copy link

recordedfuture-dev commented Jan 20, 2023

It seems like this change triggers such error:
(on multiple machines, but with the same project)

Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: <package>
  Building wheel for <package> (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for <package> (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing src/<package>.egg-info/PKG-INFO
      writing dependency_links to src/<package>.egg-info/dependency_links.txt
      writing entry points to src/<package>.egg-info/entry_points.txt
      writing requirements to src/<package>.egg-info/requires.txt
      writing top-level names to src/<package>.egg-info/top_level.txt
      reading manifest file 'src/<package>.egg-info/SOURCES.txt'
      writing manifest file 'src/<package>.egg-info/SOURCES.txt'
      /private/var/folders/c4/6462yxf34rv22w3577ab5jt00000gt/T/pip-build-env-rn3twi53/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
        warnings.warn(msg, _BetaConfiguration)
      error: Error: setup script specifies an absolute path:

          /

      setup() arguments must *always* be /-separated paths relative to the
      setup.py directory, *never* absolute paths.

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for <package>
Failed to build <package>
ERROR: Could not build wheels for <package>, which is required to install pyproject.toml-based projects

@abravalheri
Copy link
Contributor Author

Hi @recordedfuture-dev, could you please share which package you are trying to install? (I want to have a look on its pyproject.toml or setup.cfg).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants