Skip to content

Switch to fully pyproject.tml-based build#113

Merged
jayqi merged 5 commits intomasterfrom
pyproject-toml-build
Feb 22, 2023
Merged

Switch to fully pyproject.tml-based build#113
jayqi merged 5 commits intomasterfrom
pyproject-toml-build

Conversation

@jayqi
Copy link
Copy Markdown
Member

@jayqi jayqi commented Feb 18, 2023

This PR switches us to a fully pyproject.toml-based build.

We were previously partially using a PEP 517 build using setuptools for pip installs, but still using the deprecated setup.py commands for building wheels and sdist.

This PR additionally migrates our project metadata from setup.py to pyproject.toml (PEP 621).

Build backend and dynamic versioning

We were previously using setuptools as a build backend and versioneer for dynamic versioning from git.

I tried 3 different backend setups that would maintain this functionality:

  • setuptools + versioneer
  • setuptools + setuptools_scm
  • pdm-pep517

I found that pdm-pep517 worked the best with the sanest defaults and required the least configuration.

Versioneer does support declaring Versioneer's tool configuration in pyproject.toml, but unfortunately Versioneer still seems to require having a setup.py. I got a runtime error that setup.py was missing when trying to refresh our Versioneer setup with the latest version of Versioneer.

setuptools_scm is another package that provides dynamic versioning from git, and is used as an example in setuptools' docs for doing so. The dynamic versioning part worked fine. Unfortunately, a side effect is that there isn't a way to turn off setuptools_scm's other feature which is to automatically include all files tracked by git in the build. It was difficult and annoying to have to then wrangle MANIFEST.in to exclude all of these files.

We may also consider getting rid of the dynamic versioning functionality, but I didn't want to take on that decision in this PR. The main benefit that it provides right now is that the version string we label the post-save initialization code with will be distinguishable between development versions of nbautoexport vs releases.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 18, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.5%. Comparing base (3a06119) to head (9714aac).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #113   +/-   ##
======================================
  Coverage    98.5%   98.5%           
======================================
  Files           8       8           
  Lines         425     427    +2     
======================================
+ Hits          419     421    +2     
  Misses          6       6           
Files with missing lines Coverage Δ
nbautoexport/utils.py 100.0% <100.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 18, 2023

@jayqi jayqi requested review from ejm714, pjbull and r-b-g-b February 18, 2023 19:13
Copy link
Copy Markdown
Contributor

@ejm714 ejm714 left a comment

Choose a reason for hiding this comment

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

This is so much simpler! Thanks for taking this on @jayqi

Two small questions, neither of which is blocking

@jayqi jayqi merged commit 64b7fa5 into master Feb 22, 2023
@jayqi jayqi deleted the pyproject-toml-build branch February 22, 2023 02:58
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