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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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...

"wheel",
"cython==0.29.22",
"jinja2==2.10.3",
"oldest-supported-numpy",
"extension-helpers"]
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]
write_to = "astropy/_version.py"

[tool.astropy-bot]
[tool.astropy-bot.autolabel]
# Comment this out to re-enable but then labeler Action needs to be disabled.
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ classifiers =
packages = find:
zip_safe = False
tests_require = pytest-astropy
setup_requires = setuptools_scm
install_requires =
numpy>=1.18
pyerfa>=2.0
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@

# Only import these if the above checks are okay
# to avoid masking the real problem with import error.
import os # noqa
from setuptools import setup # noqa
from extension_helpers import get_extensions # noqa

setup(use_scm_version={'write_to': os.path.join('astropy', '_version.py')},
ext_modules=get_extensions())
setup(ext_modules=get_extensions())