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

move build configuration to pyproject.toml #279

Merged
merged 6 commits into from
Aug 21, 2023

Conversation

zacharyburnett
Copy link
Contributor

@zacharyburnett zacharyburnett commented Sep 21, 2022

setuptools now supports the [project] table, which is defined by PEP621.

Additionally, setuptools now supports its own entry in pyproject.toml called [tool.setuptools] (pypa/setuptools#1688, https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#setuptools-specific-configuration); however, it comes with the following disclaimer:

Support for declaring configurations not standardized by PEP 621 (i.e. the [tool.setuptools] table), is still in beta stage and might change in future releases.

Reading toml is supported natively in Python 3.11 with tomllib

Given this, we can attempt to consolidate the build configuration into a single pyproject.toml file that can possibly be read by other build systems in the future.

@zacharyburnett zacharyburnett marked this pull request as draft September 21, 2022 15:30
docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
@zacharyburnett zacharyburnett marked this pull request as ready for review April 19, 2023 15:39
Copy link
Collaborator

@mfixstsci mfixstsci left a comment

Choose a reason for hiding this comment

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

Thanks @zacharyburnett! This is really helpful, sorry it took me some time to get around to it!

@zacharyburnett
Copy link
Contributor Author

Thanks @zacharyburnett! This is really helpful, sorry it took me some time to get around to it!

No problem! The CI seems to be failing because it never calls pip install ., but that should be easy to fix

@mfixstsci
Copy link
Collaborator

@zacharyburnett I noticed and am updating some of the docs/removing deprecated test runs etc. I am hoping to have it in better shape this afternoon!

@mfixstsci mfixstsci merged commit d3ac5eb into spacetelescope:master Aug 21, 2023
0 of 3 checks passed
@zacharyburnett zacharyburnett deleted the pep621 branch August 21, 2023 16:47
@pllim
Copy link

pllim commented Aug 21, 2023

Are you sure this PR is complete?

E ModuleNotFoundError: No module named 'requests'

Should not merge PR with red CI, if possible.

"setuptools>=61.2",
"setuptools_scm[toml]>=3.4",
"wheel",
"oldest-supported-numpy",
Copy link

Choose a reason for hiding this comment

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

Are you sure you need oldest-supported-numpy . Do you have C-extension that uses numpy ABI?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@zacharyburnett I am assuming this a hold over from the setup.py file. I can double check and open a new PR with a fix.

Copy link
Collaborator

@mfixstsci mfixstsci Aug 21, 2023

Choose a reason for hiding this comment

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

Looks like we versioned numpy in the setup.py file. Any reason for using the "oldest-supported-numpy" version?

Copy link

Choose a reason for hiding this comment

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

This section is for build, not install. Do you need numpy during compile time?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, right sorry. I don't believe we do!

Copy link

Choose a reason for hiding this comment

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

Then you should remove it. Will make your lives easier when Python 3.12 and NumPy 2.0 are released.

@mfixstsci
Copy link
Collaborator

mfixstsci commented Aug 21, 2023

Are you sure this PR is complete?

E ModuleNotFoundError: No module named 'requests'

Should not merge PR with red CI, if possible.

I agree, but sadly the tests have been failing for some time now. There are some issues that are instrument specific that cause them which are out of @Witchblade101 and I's expertise. In this case I was wrong and should have double checked.

@mfixstsci
Copy link
Collaborator

Are you sure this PR is complete?
E ModuleNotFoundError: No module named 'requests'
Should not merge PR with red CI, if possible.

I agree, but sadly the tests have been failing for some time now. There are some issues that are instrument specific that cause them which are out of @Witchblade101 and I's expertise. In this case I was wrong and should have double checked.

@pllim maybe it was an issue with python 3.7 because @zacharyburnett just added another PR #319 and the test are all passing now 🎉

@mfixstsci mfixstsci mentioned this pull request Aug 21, 2023
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