Skip to content

Conversation

@willingc
Copy link
Member

@willingc willingc commented Nov 14, 2025

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:

  • use hatch for package build
  • remove bumpversion and use dynamic version with hatch
  • removes setuptools and setup.py completely
  • removes requirements files and uses standard pyproject.toml approach
  • moves pytest config into pyproject.toml and updates items flagged by repo-review

Addresses #833 #844

To Do:

  • Update binder config in tox

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.13%. Comparing base (cb2eb37) to head (73aaa13).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f26414...73aaa13. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@willingc willingc marked this pull request as ready for review November 15, 2025 20:37
@willingc willingc requested review from Borda, Copilot and rgbkrk November 15, 2025 20:38
@willingc willingc changed the title [WIP] Use hatch as build system instead of setuptools Use hatch as build system instead of setuptools Nov 15, 2025
Copilot finished reviewing on behalf of willingc November 15, 2025 20:40
Copy link

Copilot AI left a 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.

@willingc willingc mentioned this pull request Nov 15, 2025
8 tasks
@willingc
Copy link
Member Author

@ofek If you have time to take a quick look at the hatch sections, I would appreciate it. Thanks 😄

Copy link

@ofek ofek left a 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!

Comment on lines +159 to +165
[tool.hatch.build.targets.sdist]
include = [
"/papermill",
]
exclude = [
"binder/*",
]
Copy link

Choose a reason for hiding this comment

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

  1. 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.
  2. If you only care about shipping the package/certain directories then there is a fast-path option called only-include that prevents scanning the tree and just selects what you define.
  3. 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: Image

ignore-words-list = "dne, compiletime"


[tool.pytest.ini_options]
Copy link

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)

Suggested change
[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
Copy link

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:

Suggested change
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
Copy link

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?

Copy link
Member

@rgbkrk rgbkrk left a comment

Choose a reason for hiding this comment

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

Plenty of feedback in here from @Borda and @ofek. Thank you both for the review. Merge it when ready @willingc! Thank you!

@willingc
Copy link
Member Author

Thanks @rgbkrk. I will loop back to this late in the week.

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