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
docs: add note about opting into PEP 621 #1065
Conversation
Thanks again for the PR. On this change, what would the minimum fields be that we could show in this example? It would be nice to just include the minimum, that's kinda what the example was trying to do before (hence why it includes the I had a read of the PEP, is the minimum just |
The PEP requires all the projects to specify However the PEP also forbids setuptools from backfilling using external sources (e.g. |
Version |
Ahh, I see. So, I had a go at making a bigger improvement to this section. If you have time, it would be great if you could let me know what you think. Probably easiest to read the rendered output - https://cibuildwheel--1065.org.readthedocs.build/en/1065/options/#requires-python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joerick thank you very much for the changes.
In general it does look good to me.
docs/options.md
Outdated
``` | ||
|
||
- If you didn't already have a `pyproject.toml` that had a `[project]` | ||
table, you should migrate values from `setup.py` or `setup.cfg`, or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should migrate
My only remark is that support for PEP 621 was just added last Friday, so there might be sharp edges left.
The following is just maintainer babbling 😅:
We can actively start encouraging people to migrate to it, however in setuptools we decided to keep the experimental
status for a while to guarantee that we have the freedom to modify how we implement it before committing to an specific design.
Changes in interface will not occur in the [project]
table (after all it is standardized), but if the users reach out for [tool.setuptools]
there is no guarantee the fields there will stay unchanged between versions.
If in the following days we receive reports that the release seriously break important packages for the community we might also consider yanking it and backing off a bit while we re-implement any problematic bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing !
My only remark is that support for PEP 621 was just added last Friday, so there might be sharp edges left.
Hm. Yes okay I see. So what's the conservative route for users with a [project]
table? Would listing options in dynamic
be the safest way to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the users specify as dynamic the fields that they are providing via setup.py
, that would be safe.
I think the parts of PEP 621 important to keep in mind are:
Build back-ends MUST raise an error if the metadata specifies a field in dynamic but the build back-end was unable to provide the data for it.
Build back-ends MUST raise an error if the metadata specifies a field statically as well as being listed in dynamic.
If the metadata does not list a field in dynamic, then a build back-end CANNOT fill in
@abravalheri so if i had pyproject.toml file with project tag where i was just defining name and python-requires and for version i had a dynamic logic in setup.py , now setuptools will complain - [06:26:51] [Step 3/5] ############################ To fix this i should change it to below?- [project] |
Hi @deepika094, yes that change makes sense. If you are using any other field in For example let's say you define These principles are defined in the PEP 621:
Please note that this maintenance overhead is a direct consequence of opting into PEP 621. Footnotes |
@abravalheri thank you. that's very helpful. Indeed we define lots of fields in setup.py like install_requires, extra_requires, entry-points so I guess we will have to make change in all the projects and make these fields dynamic in pyproject.toml. After- will that be ok and compliant with pep621? in that case we can just keep pyproject.toml to have below and not [project]- Or the recommended way is to use [project] and for fields we define in setup.py we should mark them as dynamic in pyproject.toml? |
Personally, while I'm a big fan of PEP 621 (and am thrilled by @abravalheri 's work there) and look forward to all tools supporting it, IMO Furthermore, it means that Since this is just about adding a single, simple metadata key as a way for Also, on another note, since it has been accepted, PEP 621 itself is not the canonical specification or its documentation and thus should not be linked to in that capacity, as opposed to the official specification on the packaging guide. The latter can and will be updated over time as the specification changes (based on future PEPs and minor errata); PEP 621 is already out of date in that respect and will grow more so over time. |
This is heavily my fault - I added this (about a year ago, maybe more) with the understanding that the PEP 621 location ( When we later added Something similar happened with metadata.license and setup.cfg, with projects filling in just that one field in setup.cfg. PEP 621 is not the same, though, in that it's all-or-nothing; as a benefit to tools wanting to statically infer information from pyproject.toml, it requires everything to either be specified or listed explicitly in My thought would be (I think closely following @CAM-Gerlach's suggestion above):
|
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Thanks for the input, all. I still think that adopting the I'll redraft the docs to be more in line with the discussion here. (And I'd agree with @henryiii, I don't think we should add a |
Thank you very much @joerick , @CAM-Gerlach and @henryiii . Please feel free to make any changes or even ignore the PR. My original intention was just to draw attention of the users that adding I am very sure that the original intention of the text was spot on. Maybe this is just a case of Hyrum's Law applied to documentation. |
Just to be clear, supporting the |
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
for more information, see https://pre-commit.ci
The pycln failure (due to typer) is fixed in #1066. |
Closes #1064
This is just a quick suggestion covering the bare minimum without touching the other parts of the doc.
You guys might want to do it in a completely different way. In that case, please feel free to ignore the PR.