-
Notifications
You must be signed in to change notification settings - Fork 445
Use hatch as build system instead of setuptools #848
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #848 +/- ##
==========================================
- Coverage 91.54% 91.13% -0.42%
==========================================
Files 17 17
Lines 1621 1635 +14
==========================================
+ Hits 1484 1490 +6
- Misses 137 145 +8 see 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the packaging infrastructure by migrating from setuptools to hatch as the build system, following Scientific Python development guidelines. The changes consolidate dependency management into pyproject.toml and adopt modern Python packaging standards.
Key changes:
- Migration from setuptools to hatchling with hatch-vcs for dynamic versioning
- Consolidation of all dependencies from separate requirements files into pyproject.toml optional dependencies
- Enhanced pytest configuration with stricter settings and moved into pyproject.toml
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Complete restructure: new build system (hatchling), consolidated dependencies, enhanced pytest config, updated tox environments |
| requirements/*.txt | Removed all requirement files (s3, hdfs, github, gcs, docs, dev, azure, base) - now managed in pyproject.toml |
| papermill/version.py | Removed static version file - now dynamically generated by hatch-vcs |
| MANIFEST.in | Removed - hatch manages package inclusion via pyproject.toml configuration |
| .pre-commit-config.yaml | Updated repository URLs for black and mdformat hooks |
| .gitignore | Added papermill/version.py to ignore dynamically generated version file |
| .gitattributes | Added .git_archival.txt for export-subst |
| .git_archival.txt | New file to support git archive with version information |
| .github/workflows/ci.yml | Removed setuptools from pip install, removed manifest tox environment, simplified condition syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@ofek If you have time to take a quick look at the hatch sections, I would appreciate it. Thanks 😄 |
ofek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, I left some comments!
| [tool.hatch.build.targets.sdist] | ||
| include = [ | ||
| "/papermill", | ||
| ] | ||
| exclude = [ | ||
| "binder/*", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If you specify inclusion then exclusion only acts upon what is included so here the exclusion is I think unnecessary because that's a sibling directory.
- If you only care about shipping the package/certain directories then there is a fast-path option called
only-includethat prevents scanning the tree and just selects what you define. - It's completely up to you what you now want to ship but just a heads up that the source distribution from the latest release on PyPI includes more like the pytest and tox config:

| ignore-words-list = "dne, compiletime" | ||
|
|
||
|
|
||
| [tool.pytest.ini_options] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit unrelated to Hatch: based on the value of addopts I think you want the standard configuration (perhaps it's working properly because they have a fallback mechanism, not sure)
| [tool.pytest.ini_options] | |
| [tool.pytest] |
| python -VV | ||
| python -m site | ||
| python -m pip install --upgrade pip setuptools wheel coverage[toml] virtualenv tox tox-gh-actions | ||
| python -m pip install --upgrade pip wheel coverage[toml] virtualenv tox tox-gh-actions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what CI is doing but I think this would also be unnecessary now:
| python -m pip install --upgrade pip wheel coverage[toml] virtualenv tox tox-gh-actions | |
| python -m pip install --upgrade pip coverage[toml] virtualenv tox tox-gh-actions |
| @@ -1 +1,2 @@ | |||
| papermill/_version.py export-subst | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh one more thing, is this accurate?
Co-authored-by: Ofek Lev <[email protected]>
rgbkrk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks @rgbkrk. I will loop back to this late in the week. |
This PR modernizes some packaging items and follows guidelines found in Scientific Python's guide. It resolves a number of issues found by repo-review: https://learn.scientific-python.org/development/guides/repo-review/
This PR:
Addresses #833 #844
To Do: