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 #512

Merged

Conversation

zacharyburnett
Copy link
Collaborator

@zacharyburnett zacharyburnett commented Jun 2, 2022

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.

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
  • Documentation
  • Change log
  • Milestone
  • Label(s)

@zacharyburnett zacharyburnett self-assigned this Jun 2, 2022
@codecov
Copy link

codecov bot commented Jun 2, 2022

Codecov Report

Base: 81.83% // Head: 81.22% // Decreases project coverage by -0.60% ⚠️

Coverage data is based on head (57b240c) compared to base (914c407).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head 57b240c differs from pull request most recent head b25dfa3. Consider uploading reports for the commit b25dfa3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
- Coverage   81.83%   81.22%   -0.61%     
==========================================
  Files          39       39              
  Lines        1167     1156      -11     
==========================================
- Hits          955      939      -16     
- Misses        212      217       +5     
Flag Coverage Δ *Carryforward flag
nightly 81.56% <0.00%> (-0.27%) ⬇️ Carriedforward from 767b907
unit 46.91% <ø> (+0.44%) ⬆️

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

Impacted Files Coverage Δ
setup.py 0.00% <0.00%> (ø)
romancal/lib/suffix.py 82.92% <0.00%> (-11.36%) ⬇️
romancal/photom/photom_step.py 73.68% <0.00%> (-3.59%) ⬇️
romancal/dq_init/dq_init_step.py 78.43% <0.00%> (-1.93%) ⬇️
romancal/jump/jump_step.py 97.14% <0.00%> (-0.23%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from c8dfb1f to eddf10c Compare June 3, 2022 13:42
@zacharyburnett zacharyburnett marked this pull request as ready for review June 3, 2022 13:49
@zacharyburnett zacharyburnett marked this pull request as draft June 7, 2022 19:43
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from dab2f82 to aaf6384 Compare June 17, 2022 17:20
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from aaf6384 to c839bdb Compare July 18, 2022 13:49
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 3 times, most recently from e442078 to 918028f Compare August 1, 2022 15:51
@github-actions github-actions bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation labels Aug 1, 2022
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 918028f to f9d3f21 Compare August 1, 2022 15:54
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch 3 times, most recently from a826f41 to 9a13b1b Compare August 9, 2022 18:05
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 9a13b1b to 4a08966 Compare August 17, 2022 15:21
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from 4a08966 to 767b907 Compare August 30, 2022 14:13
@zacharyburnett zacharyburnett force-pushed the consolidate_build_config branch from b6324e9 to 86c2f70 Compare November 29, 2022 13:42
@zacharyburnett zacharyburnett marked this pull request as ready for review November 29, 2022 13:44
@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Nov 29, 2022

copying from the stcal PR:

Now that Python 3.11 includes tomli in built-ins, and given that romancal doesn't currently build C extensions, I am comfortable with readying this for review. flake8 requires its own file, but if we ever move to a different linter in the future (e.g. ruff) we will likely be able to use pyproject.toml for its configuration

If setuptools changes their interface with pyproject.toml it would involve updating the [tool.setuptools] table, i.e. changing the following values:

[tool.setuptools]
zip-safe = false

[tool.setuptools.packages.find]

[tool.setuptools.package-data]
# package_data values are glob patterns relative to each specific subpackage.
'*' = [
    '*.fits',
    '*.txt',
    '*.inc',
    '*.cfg',
    '*.csv',
    '*.yaml',
    '*.json',
    '*.asdf',
]

The [project] table would remain unchanged as it is defined by PEP621.

Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@mairanteodoro mairanteodoro left a comment

Choose a reason for hiding this comment

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

Looking good to me.

@zacharyburnett zacharyburnett enabled auto-merge (squash) November 30, 2022 16:28
@zacharyburnett zacharyburnett merged commit e36b2a5 into spacetelescope:main Nov 30, 2022
@zacharyburnett zacharyburnett deleted the consolidate_build_config branch November 30, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants