Skip to content

Migrate from pep517 to using build in tests and workflows #1065

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

Closed
matthewfeickert opened this issue Sep 14, 2020 · 3 comments · Fixed by #1066
Closed

Migrate from pep517 to using build in tests and workflows #1065

matthewfeickert opened this issue Sep 14, 2020 · 3 comments · Fixed by #1066
Labels
CI CI systems, GitHub Actions fix A bug fix packaging setup.py, setup.cfg, pyproject.toml, and friends

Comments

@matthewfeickert
Copy link
Member

matthewfeickert commented Sep 14, 2020

Description

Given pypa/pyproject-hooks#83 it seems that pep517 is deprecated and we should switch to using build. There is documentation for build and a new Issue that tracks things pypa/pyproject-hooks#91, but in short we should be using

python -m pip install build
python -m build --sdist --wheel --outdir dist/ .

From the build docs section on "Difference from other tools":

python -m pep517.build

python-build implements a CLI tailored to end users.

pep517.build contained a proof-of-concept of a PEP 517 frontend. It "implement[ed] essentially the simplest possible frontend tool, to exercise and illustrate how the core functionality can be used". It has since been deprecated and is scheduled for removal.

Thanks to @pganssle for the alerting Tweet.

cc @alexander-held @henryiii @gordonwatts

@matthewfeickert matthewfeickert added CI CI systems, GitHub Actions fix A bug fix packaging setup.py, setup.cfg, pyproject.toml, and friends labels Sep 14, 2020
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Sep 14, 2020

It seems that there is no equivalent yet in build for pep517.check

To test the build backend for a project, run in a system shell:

python3 -m pep517.check path/to/source  # source dir containing pyproject.toml

which is used by pyhf for publishing:

- name: Test the build backend is compliant with PEP517
run: |
python -m pep517.check .

I'll need to read more through the discussion and issues that exist to see if it exists, but I'll also be a bit annoying and tag @webknjaz now (:wave: hello again! Feel free to ignore this) as he seems to be highly in the know.

@pganssle
Copy link

To be clear, this sudden pep517.build deprecation is very unfortunate to my mind, not least of which because python-build is in pretty early alpha and has a few major show-stopping bugs like this one. pep517.build is not perfect either, mind you, but I think right now for my projects I'm at something close to a toss-up between "pin pep517" and "switch to build". Especially since the console script name might have to change (and it would be hard to implement a long deprecation period for that).

With regards to this:

It seems that there is now equivalent yet in build for pep517.check

It's not 100% clear to me that this is necessary. As far as I can tell pep517.check just does the checks that the project does before doing a build anyway, so if you're doing a build anyway, you aren't losing anything (it's just that the failure will show up in the build step, rather than in the "check the build" step).

@matthewfeickert
Copy link
Member Author

matthewfeickert commented Sep 14, 2020

As far as I can tell pep517.check just does the checks that the project does before doing a build anyway, so if you're doing a build anyway, you aren't losing anything

Yeah, I think you're right. I was just looking at the logs for this PR and the following screeenshot is showing the relevant section from

- name: Test the build backend is compliant with PEP517
run: |
python -m pep517.check .
- name: Build a wheel and a sdist
run: |
python -m pep517.build --source --binary --out-dir dist/ .

with

python -m build --sdist --wheel --outdir dist/ .

instead of pep517.build.

compare_of_pep517check_and_build

It seems that the same checks run in pep517.check are run in pep517.build and build and so there might not be an actual need for a check API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI systems, GitHub Actions fix A bug fix packaging setup.py, setup.cfg, pyproject.toml, and friends
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants