Skip to content

MNT: migrate static metadata out of setup.cfg - #145

Merged
mhvk merged 1 commit into
liberfa:mainfrom
neutrinoceros:mnt/pyproject.toml
Aug 28, 2024
Merged

MNT: migrate static metadata out of setup.cfg#145
mhvk merged 1 commit into
liberfa:mainfrom
neutrinoceros:mnt/pyproject.toml

Conversation

@neutrinoceros

Copy link
Copy Markdown
Contributor

Follow up to #144
migration from setup.cfg to pyproject.toml was mostly automated using ini2toml

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

I missed that setuptools_scm was a runtime dependency in dev builds, and I need to figure out how this is supposed to translate in pyproject.toml without adding it as a mandatory runtime dep

@neutrinoceros
neutrinoceros marked this pull request as ready for review April 5, 2024 09:41

@avalentino avalentino left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few small suggestions, which we might as well fix up...

Comment thread pyproject.toml Outdated

[tool.pytest.ini_options]
minversion = "4.6"
testpaths = ['"erfa"', '"docs"', '"README.rst"']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this needs the single+double quotes -- at least, astropy just has the double ones.

Comment thread pyproject.toml Outdated
Comment thread erfa/_dev/scm_version.py
from warnings import warn

try:
from setuptools_scm import git, Configuration, get_version as _get_version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused why this is needed, given that astropy has the simpler direct try/except that we had here. What other attribute is being gotten that the __getattr__ solves? Or is it just that timing now is different?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't have any recollection of it, luckilly the answer to your question is in the commit message:
RFC: refactor scm_version.py to survive pytest collection if setuptools_scm isn't installed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, isn't the answer then to ensure that pytest doesn't look at this directory? Is that what astropy does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I couldn't reproduce the problem I was trying to solve here so I just reverted the change. The PR is more self-contained as a result.

@neutrinoceros
neutrinoceros force-pushed the mnt/pyproject.toml branch 2 times, most recently from 41cfa7a to 65619a0 Compare August 28, 2024 12:42

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Let's get it in.

@mhvk
mhvk merged commit a34a8f9 into liberfa:main Aug 28, 2024
@neutrinoceros
neutrinoceros deleted the mnt/pyproject.toml branch August 28, 2024 13:15
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.

3 participants