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

Build distributions in an isolated environment. #449

Merged
merged 3 commits into from
Jun 16, 2024

Conversation

mauritsvanrees
Copy link
Member

Otherwise build cannot install packages needed for the build system, for example hatchling. Fixes issue #448.

I see a few test failures locally, which should only be small differences in the output during release. Let's see if they are there on GitHub as well.

Code is taken from how build does it itself.

Otherwise `build` cannot install packages needed for the build system, for example `hatchling`.
Fixes issue #448.
Instead of `tha.example-0.1.tar.gz` you get `tha_example-0.1.tar.gz`.
Wheels currently still have dots there, but those might become underscores at some point as well.

This is actually a problem for Buildout: buildout/buildout#647

The change in this PR does have a bit of an effect:

- Previously when we were running `build`, it would run in non-isolated mode.  So if you make sure you have an older `setuptools` version in the venv of `zest.releaser`, you get dots, like was always the case.
- Now with this PR, we run in isolated mode, which means that `build` will most likely install the latest setuptools version.  Well, it does that if setuptools is the chosen build-system, and I think this is still the default, at least if there is a `setup.py`.

You can influence this in the `pyproject.toml` of the package you are releasing.
In Plone we have this in most packages:

```
[build-system]
requires = ["setuptools>=68.2"]
```

I think we want it like this now:

```
[build-system]
requires = ["setuptools>=68.2,<=69.2"]
```

I am mostly writing this as note to myself. :-)
@mauritsvanrees
Copy link
Member Author

I found out what was going wrong in the tests. This actually has nothing to do with the changes in this PR. The scheduled tests already fail. It took a long time before I saw what the actual diff was. Wwith setuptools>=69.3 sdists get an underscore. Instead of tha.example-0.1.tar.gz you get tha_example-0.1.tar.gz.

Okay, I have updated the tests. See commit 934ffb7 for more details.

Copy link
Collaborator

@reinout reinout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for figuring out the underscore/point problem... Looks like some serious debugging :-)

@reinout reinout merged commit a1455cf into master Jun 16, 2024
6 checks passed
@reinout reinout deleted the maurits-isolated-build branch June 16, 2024 17:05
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

Successfully merging this pull request may close these issues.

2 participants