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

Switch to fully pyproject.tml-based build #113

Merged
merged 5 commits into from
Feb 22, 2023
Merged

Conversation

jayqi
Copy link
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

codecov-commenter commented Feb 18, 2023

Codecov Report

Merging #113 (b50724c) into master (3a06119) will increase coverage by 0.0%.
The diff coverage is 100.0%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

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           
Impacted Files Coverage Δ
nbautoexport/utils.py 100.0% <100.0%> (ø)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2023

@jayqi jayqi requested review from pjbull, r-b-g-b and ejm714 February 18, 2023 19:13
Copy link
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

tests/test_cli_clean.py Show resolved Hide resolved
nbautoexport/utils.py Outdated Show resolved Hide resolved
@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