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 into pyproject.toml #6847

Merged

Conversation

zacharyburnett
Copy link
Collaborator

@zacharyburnett zacharyburnett commented May 16, 2022

Note
#7912 should be merged before this PR to test the build with cibuildwheel

Description

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.

Checklist

  • Tests
  • [N/A] Documentation
  • Change log
  • [N/A] Milestone
  • Label(s)

@zacharyburnett zacharyburnett changed the title Consolidate build config into pyproject.toml using poetry-core Consolidate build config into pyproject.toml May 18, 2022
@zacharyburnett zacharyburnett self-assigned this May 18, 2022
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 2 times, most recently from 5483667 to 1b99f2d Compare May 18, 2022 15:27
@zacharyburnett zacharyburnett marked this pull request as ready for review May 18, 2022 15:31
@zacharyburnett zacharyburnett marked this pull request as draft May 18, 2022 15:31
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 1b99f2d to 7a31d53 Compare May 18, 2022 15:37
docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 7a31d53 to b3a786c Compare May 18, 2022 15:46
tox.ini Outdated Show resolved Hide resolved
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from b3a786c to b99844c Compare May 18, 2022 15:49
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3cf897a) 75.42% compared to head (bd80933) 75.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6847   +/-   ##
=======================================
  Coverage   75.42%   75.42%           
=======================================
  Files         464      464           
  Lines       37938    37936    -2     
=======================================
  Hits        28615    28615           
+ Misses       9323     9321    -2     
Flag Coverage Δ *Carryforward flag
nightly 77.37% <ø> (+<0.01%) ⬆️ Carriedforward from 9a73e53

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zacharyburnett zacharyburnett marked this pull request as ready for review May 19, 2022 15:33
@zacharyburnett zacharyburnett requested review from hbushouse, stscieisenhamer and nden and removed request for stscieisenhamer and hbushouse May 19, 2022 15:34
@zacharyburnett
Copy link
Collaborator Author

there's an issue with the package data so I will convert this back to draft for now

@zacharyburnett zacharyburnett marked this pull request as draft May 19, 2022 17:42
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 2 times, most recently from b0fb38e to 6dd7e61 Compare May 23, 2022 14:29
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 62309de to ebb3dd7 Compare May 23, 2022 20:34
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 7b46d88 to a021a70 Compare May 31, 2022 16:14
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 2 times, most recently from 9d33653 to 0d64e30 Compare June 7, 2022 13:10
@zacharyburnett zacharyburnett changed the title Consolidate build config into pyproject.toml move build config into pyproject.toml Jun 7, 2022
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 2 times, most recently from fef8992 to 6aca0c5 Compare June 12, 2023 15:39
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from e17881d to a692a13 Compare July 24, 2023 11:33
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 58cb8ab to 87edcbd Compare August 17, 2023 13:42
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 87edcbd to a7c04d0 Compare November 17, 2023 13:03
@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Nov 17, 2023

we can test the effect of this PR on the build after #7912 is merged

@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from a7c04d0 to cd3f2e7 Compare December 1, 2023 16:55
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 8c7a58a to a0e7841 Compare December 5, 2023 15:01
@zacharyburnett zacharyburnett marked this pull request as draft December 5, 2023 15:07
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 2 times, most recently from 95645bc to 3cd395f Compare December 6, 2023 18:21
@zacharyburnett zacharyburnett marked this pull request as ready for review December 6, 2023 19:24
@zacharyburnett
Copy link
Collaborator Author

it looks like the tests all pass here (except for the lint check which should be resolved by #8111 / #8112), so I think this is ready to merge

@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 3cd395f to 9a73e53 Compare December 7, 2023 14:57
CHANGES.rst Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
docs/conf.py Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

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

Looks OK to me, I guess (but what do I know about build configuration?). I assume all the CI failures with devdeps are expected, because of numpy?

@zacharyburnett zacharyburnett merged commit 4205d60 into spacetelescope:master Dec 7, 2023
35 of 39 checks passed
@zacharyburnett zacharyburnett deleted the consolidate_build_config branch December 7, 2023 16:42
@zacharyburnett
Copy link
Collaborator Author

great! I'll merge this then, thanks!

@@ -68,6 +68,7 @@ deps =
xdist: pytest-xdist
oldestdeps: minimum_dependencies
package =
# necessary so the C extensions are available for import; see https://github.com/spacetelescope/jwst/issues/7386#issuecomment-1344371482
Copy link
Member

Choose a reason for hiding this comment

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

I do not think this is necessary. This can be avoided my a artful (as opposite to scientific, deterministic) use of various tox directory names. That is, the path to where the commands must be run, the location of the configuration files, etc. can be adjusted in such a way that this may not be needed. See https://github.com/spacetelescope/stsci.imagestats on how this was done there.

One possible complication might be on RTD or pytest of docstrings if there are examples that use/import C code.

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.

4 participants