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

Include WHEEL metadata when using PDM and poetry backends #2881

Merged
merged 3 commits into from Jan 18, 2023

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Jan 18, 2023

When building a wheel or editable package with a PEP 517 backend, no longer pass an empty metadata_directory to the backend build_wheel or build_editable endpoint.

Some backends, such as PDM and poetry, will not generate package metadata in the presence of a metadata_directory, even if it is empty.

Prior to this change, attempting to install a wheel created by tox using PDM or poetry would return an error like There is no item named 'my-package.0.1.dist-info/WHEEL' in the archive

Fix #2880
Fix #2870

Thanks for contribution

Please, make sure you address all the checklists (for details on how see
development documentation)!

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

If the caller provides a metadata_directory, then put the contents into the
wheel (instead of the hardcoded metadata in the module).

From pyproject-api with modifications:

  * correct the order of the `build_wheel` arguments according to PEP 517 to
    work correctly with pyproject_hooks
  * remove unnecessary `dedent` calls (these are applied during build)
missing WHEEL metadata with certain PEP 517 backends

Fix tox-dev#2870
@masenf
Copy link
Collaborator Author

masenf commented Jan 18, 2023

Not sure about the docs failure on windows, will have to look at that a bit later.

Passing empty `metadata_directory` to `build_wheel` or `build_editable` can
cause some PEP 517 backends to create a wheel without metadata.

Fix tox-dev#2880
@gaborbernat gaborbernat merged commit 8323aaa into tox-dev:main Jan 18, 2023
@kurtmckee
Copy link
Contributor

Thank you, @masenf and @gaborbernat! I'm very grateful for the fast work on this, and for your work on Tox!

@masenf masenf deleted the build-wheel-metadata branch January 18, 2023 21:49
descope bot added a commit to descope/django-descope that referenced this pull request Feb 1, 2023
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [tox](https://togithub.com/tox-dev/tox)
([changelog](https://tox.wiki/en/latest/changelog.html)) | dev | patch |
`4.3.4` -> `4.3.5` | `4.4.4` (+4) |

---

### Release Notes

<details>
<summary>tox-dev/tox</summary>

### [`v4.3.5`](https://togithub.com/tox-dev/tox/releases/tag/4.3.5)

[Compare Source](https://togithub.com/tox-dev/tox/compare/4.3.4...4.3.5)

#### What's Changed

- Include WHEEL metadata when using PDM and poetry backends by
[@&#8203;masenf](https://togithub.com/masenf) in
[tox-dev/tox#2881

**Full Changelog**: tox-dev/tox@4.3.4...4.3.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDEuMCIsInVwZGF0ZWRJblZlciI6IjM0LjEwMS4wIn0=-->

Co-authored-by: descope[bot] <descope[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tox does not create valid editable wheel When package=wheel is set, the wheel doesn't have a WHEEL item
3 participants