Skip to content

MNT: Switch to hatchling build backend #1176

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

Merged
merged 4 commits into from
Jan 6, 2023
Merged

Conversation

effigies
Copy link
Member

@effigies effigies commented Jan 6, 2023

I've become increasingly frustrated with setuptools across various projects, in large part due to the weird blend of backward compatibility and churn related to trying to support modern standards.

#1133 converted most of our build metadata to backend-agnostic pyproject.toml metadata.
#1171 converted the rest and replaced the setuptools-specific versioneer with the (surprisingly) backend-agnostic setuptools_scm.

This PR finishes the job by selecting a new backend, and one that actually works better with setuptools_scm by separating version calculation from version file writing and both of these from determining which files belong in the sdist or wheel. Even better, you can separately decide what goes in an sdist and what goes in a wheel.

See Hatch and hatch-vcs for further details.

This will also let us resolve #1087 in the short term by excluding it from the wheel/installation, while keeping it in the sdist for testing purposes.

Fixes #1087.

@effigies effigies added this to the 5.0.0 milestone Jan 6, 2023
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Base: 92.38% // Head: 92.38% // No change to project coverage 👍

Coverage data is based on head (cfa209a) compared to base (02c7a34).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1176   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files          97       97           
  Lines       12250    12250           
  Branches     2525     2525           
=======================================
  Hits        11317    11317           
  Misses        613      613           
  Partials      320      320           

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.

@effigies
Copy link
Member Author

effigies commented Jan 6, 2023

Seems it likes to exclude .gz data files by default. Not sure if that's a bug or configuration choice.

@ofek
Copy link

ofek commented Jan 6, 2023

Seems it likes to exclude .gz data files by default. Not sure if that's a bug or configuration choice.

@effigies
Copy link
Member Author

effigies commented Jan 6, 2023

Thanks, @ofek! I was thinking it might be something along those lines but ran out of energy to fiddle last night.

@effigies
Copy link
Member Author

effigies commented Jan 6, 2023

@ZviBaratz Would you mind reviewing if you have a couple minutes?

Copy link
Contributor

@ZviBaratz ZviBaratz left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Thank you for taking this on. Hatch looks really great, and I haven't had the chance to use it yet. I think we could probably leverage it further down the road to simplify some of our testing and CI workflows, etc.

@effigies
Copy link
Member Author

effigies commented Jan 6, 2023

I think we could probably leverage it further down the road to simplify some of our testing and CI workflows, etc.

Sure. Feel free to look into this. My next project along the lines of these PRs will be to purge setuptools' pkg_resources for pkgutil and importlib-resources.

@effigies effigies merged commit 2145058 into nipy:master Jan 6, 2023
@effigies effigies deleted the mnt/hatch branch January 6, 2023 14:26
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.

Reorganize/compress test files to reduce package footprint
3 participants