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

setuptools_scm preferences in pyproject.toml #12366

Merged
merged 2 commits into from Nov 4, 2021

Conversation

nstarman
Copy link
Member

@nstarman nstarman commented Nov 2, 2021

I'm very much NOT an expert in packaging infrastructure.

This PR does:

  1. adds [tool.setuptools_scm] to pyproject.toml, along with the version write-to location.
  2. marks for future removal 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.
  3. removes stuff from setup.py. Like the above, I think it may be possible to remove use_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.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the Extra CI label.
  • Is a change log needed? If yes, did the change log check pass? If no, add the no-changelog-entry-needed label. If this is a manual backport, use the skip-changelog-checks label unless special changelog handling is necessary.
  • Is a milestone set? Milestone must be set but astropy-bot check might be missing; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate backport-X.Y.x label(s) before merge.

Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
@github-actions
Copy link

github-actions bot commented Nov 2, 2021

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

Copy link
Member

@Cadair Cadair left a comment

Choose a reason for hiding this comment

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

Thanks!

setup.cfg Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
@nstarman nstarman requested review from a team and Cadair November 2, 2021 21:17
@nstarman nstarman marked this pull request as ready for review November 2, 2021 23:06
Copy link
Member

@Cadair Cadair left a 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",
Copy link
Contributor

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

Copy link
Member

@Cadair Cadair Nov 3, 2021

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Contributor

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 🤞

Copy link
Member

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?

Copy link
Member Author

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...

@saimn saimn added this to the v5.1 milestone Nov 4, 2021
@saimn
Copy link
Contributor

saimn commented Nov 4, 2021

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 ?

@saimn saimn merged commit f509ac2 into astropy:main Nov 4, 2021
@astrofrog
Copy link
Member

I think 5.1 makes sense

@astrofrog
Copy link
Member

Actually I think we should backport since we are going to be maintaining 5.0 for two years and we are fixing deprecated behavior

@astrofrog
Copy link
Member

@meeseeksdev backport v5.0.x

meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Nov 4, 2021
@astrofrog astrofrog modified the milestones: v5.1, v5.0 Nov 4, 2021
astrofrog added a commit that referenced this pull request Nov 4, 2021
…366-on-v5.0.x

Backport PR #12366 on branch v5.0.x (setuptools_scm preferences in pyproject.toml)
@nstarman nstarman deleted the setuptools_scm-in-pyproject branch November 4, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add [tools.setuptools_scm] to pyproject.toml
4 participants