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

feat: add PEP 621 config only #1031

Merged
merged 25 commits into from Jun 20, 2022
Merged

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Dec 12, 2021

This is a simpler, PEP 621 only version of #1030. Might not be ready to go this route, but this would be what I think we could do.

Also, I'd love to move this over to using pipx. That would really simplify the ending commands (building and publishing), and would remove the unix/windows split from everything except the first line, where pipx would be installed.

Update from @bhrutledge:

Merging is currently blocked on changing the example package name to support backend discovery; see discussion in #1031 (comment). Until that's fixed, the tutorial is broken. Further content improvements can be made in future PRs. Closes #1085.

source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
@brettcannon
Copy link
Member

LGTM, but I don't manage this site. 😁

@henryiii henryiii marked this pull request as ready for review December 21, 2021 20:46
@henryiii
Copy link
Contributor Author

Maybe it was harder to notice because of the draft status? I took the draft off, maybe that would help.

@bhrutledge bhrutledge self-requested a review December 21, 2021 20:54
@webknjaz webknjaz requested a review from jaraco December 29, 2021 03:11
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I agree that we need to wait for the setuptools PR to be complete. Also, I feel like there may be links on the internet pointing to this document in the context of setuptools that may become misleading. Not sure what we can do about that, though.

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

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

Echoing other comments here and in #1030, I appreciate the effort, but I think we should wait for pypa/setuptools#2671. With that in mind, I'm wondering if someone could open a PR that updates this tutorial as if setuptools had support for PEP 621. In addition to being proactive instead of reactive, it might serve as an additional validation of the work in setuptools.

source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
@henryiii
Copy link
Contributor Author

I think having the tabs (with setuptools emphasized as the first tab) is probably fine - this is meant to be a general packaging tutorial, and for many users, Flit is likely a great way to get started, it's light and much faster than setuptools, and isn't struggling with the distutils drop like setuptools 60+ currently is. Having tabs indicates that this is a general tutorial rather than a specific, one tool only thing, and seems to be the direction we are moving. If we really can do the tutorial identically for each of at least setuptools and Flit (optionally PDM too), then I think that would be helpful for setuptools as well - it would provide motivation to make sure that custom tool.setuptools is not required for a basic, Python only package.

@henryiii
Copy link
Contributor Author

I've added setuptools, and tried to bundle any discussion about backends into the tabs. Someone reading the tutorial would just see setuptools unless they try to select a different tab.

PEP 621 configuration is now shown in the Scikit-HEP developer docs, BTW. No tabs there since we don't have those set up. https://scikit-hep.org/developer/pep621. The "regular" page there will become a binary (probably scikit-build) packing guide eventually.

@henryiii henryiii marked this pull request as draft December 30, 2021 20:56
Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

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

Thanks for continuing to chip away at this, in spite of naysayers like myself. It's helpful to have something concrete to react to, and I'm optimistic that some collaboration will lead to a polished final version.

source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
source/tutorials/packaging-projects.rst Outdated Show resolved Hide resolved
@henryiii henryiii force-pushed the henryiii/feat/pep621only branch 2 times, most recently from 194584f to a9ffb47 Compare March 15, 2022 18:53
@henryiii henryiii marked this pull request as ready for review April 26, 2022 17:43
henryiii and others added 2 commits May 9, 2022 09:25
Co-authored-by: Brett Cannon <brett@python.org>
@henryiii
Copy link
Contributor Author

I've matched the package name and module name. I've also standardized on using _ everywhere. I think it's a bit better practice, avoids an easy mistake, and keeps the SDist name consistent with the wheel name. The old printouts were wrong, by the way; wheel names always replace - with _ so that they can be parsed into tags correctly.

@henryiii
Copy link
Contributor Author

henryiii commented Jun 15, 2022

Guessing the build is broken by pypa/pip@347e724 . main has the same problem. @pradyunsg this seems to need to be pointed to pip:0-repeatability instead of pip:repeatability. Why are the zero's there?

henryiii referenced this pull request in pypa/pip Jun 15, 2022
This ensures that they don't show up in the table of contents sidebar,
which is part of the point of moving this content into dedicated pages.
@dstufft
Copy link
Member

dstufft commented Jun 16, 2022

FWIW, I see on the preview it says:

name is the distribution name of your package. This can be any name as long as it only contains letters, numbers, _ , and -.

I'm not sure if the omission was done on purpose, but . is the other character also valid in distribution names.

henryiii and others added 2 commits June 17, 2022 09:23
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@pradyunsg
Copy link
Member

Guessing the build is broken by pypa/pip@347e724 . main has the same problem. @pradyunsg this seems to need to be pointed to pip:0-repeatability instead of pip:repeatability. Why are the zero's there?

This has been fixed.

Copy link
Contributor

@bhrutledge bhrutledge left a comment

Choose a reason for hiding this comment

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

It brings me great pleasure (and relief) to approve this. Further refinements are welcome in future PRs. Thanks @henryiii for pushing this forward, and everyone who contributed to the conversation.

@bhrutledge bhrutledge merged commit 9e839b0 into pypa:main Jun 20, 2022

.. code-block:: toml
:file:`pyproject.toml` tells tools "frontend" build tools like :ref:`pip` and
Copy link
Contributor

Choose a reason for hiding this comment

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

Wording issue: tools frontend build tools

abravalheri added a commit to abravalheri/setuptools that referenced this pull request Aug 4, 2022
Based on the following discussions:

- pypa/packaging.python.org#1031 (comment)
- pypa/packaging-problems#604

it seems that people are having a hard time finding information about
validation error due to the long traceback and debug info.

The idea behind this change is to make the most relevant information
to fix the error easier to spot.
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.

Is it time to update the packaging tutorial to remove setup.py and setup.cfg