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
setuptools_scm preferences in pyproject.toml #12366
Conversation
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
👋 Thank you for your draft pull request! Do you know that you can use |
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!
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
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.
I see no reason why we shouldn't do this.
@@ -1,13 +1,16 @@ | |||
[build-system] | |||
requires = ["setuptools", | |||
"setuptools_scm", | |||
"setuptools_scm>=6.2", |
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.
Any reason for this version requirement ? This forces using the 2 most recent versions released 2 months ago: https://pypi.org/project/setuptools-scm/#history
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.
I assume because this was the version which added pyproject.toml support? but I didn't check, this is just what the scm docs say to do.
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.
I don't think there is any downside to being strict version wise here since it gets installed into the isolated build environment automatically anyway.
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.
this is just what the scm docs say to do
Yeah, that's where I grabbed it from. I can try to see if any earlier version works.
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.
It looks like this can be replaced with "setuptools_scm[toml]>=3.4"
Later versions allow for the [toml] to be dropped.
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.
As @astrofrog says, I don't think this is an issue. We run very modern Cython and other things in this list, I am happy to keep it where it is.
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.
I'm asking because recently they broke our CI (and many others) with their tomli dependency.
e.g. pypa/setuptools_scm#608, pypa/setuptools_scm#624
Indeed they recommend >=6.2 but all the versions between 6.1 and 6.3 have been yanked.
Bu thopefully should be fine 🤞
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.
We can always hard pin a version if we don't trust them with releases?
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.
So merge with this version lower-bound? I guess if there's no version 6.2 it just goes up...
Ok, let's merge this. Not sure if we should backport to 5.0, so I set the milestone to 5.1 for now. @astrofrog, what do you think ? |
I think 5.1 makes sense |
Actually I think we should backport since we are going to be maintaining 5.0 for two years and we are fixing deprecated behavior |
@meeseeksdev backport v5.0.x |
…366-on-v5.0.x Backport PR #12366 on branch v5.0.x (setuptools_scm preferences in pyproject.toml)
I'm very much NOT an expert in packaging infrastructure.
This PR does:
[tool.setuptools_scm]
topyproject.toml
, along with the version write-to location.setup_requires
in setup.cfg. I don't remove this now because "Many tools, especially those that invoke setup.py for any reason, may continue to rely on setup_requires. For maximum compatibility with those uses, consider also including a setup_requires directive (described below in setup.py usage and setup.cfg)." (https://pypi.org/project/setuptools-scm/). I'm not sure when this no longer applies to Astropy. If it doesn't it would be good to remove.setup.py
. Like the above, I think it may be possible to removeuse_scm_version
, but I'm not sure.Insight appreciated.
Fixes #12326
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CI
label.no-changelog-entry-needed
label. If this is a manual backport, use theskip-changelog-checks
label unless special changelog handling is necessary.astropy-bot
check might be missing; do not let the green checkmark fool you.backport-X.Y.x
label(s) before merge.