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

setuptools_scm #93

Merged
merged 3 commits into from
Oct 28, 2022
Merged

setuptools_scm #93

merged 3 commits into from
Oct 28, 2022

Conversation

prisae
Copy link
Collaborator

@prisae prisae commented Jul 27, 2022

This PR is mainly meant for discussion. These would be the changes required to change to setuptools_scm.

The advantage of this approach is that you never have to hard-code a version any longer. The version numbers are created when installing it (e.g., pip install -e . or similar) and placed in scooby/version.py.

Example of version numbers:

  • Released versions just tags : 0.6.0
  • GitHub commits add .dev#+hash : 0.6.0.dev4+g2785721
  • Uncommitted changes add timestamp : 0.6.0.dev4+g2785721.d20220727

If scooby is not properly installed, e.g., the folder is copied somewhere without the .git/-information, then the version will be unknown plus date: unknown-20220727.

If you don't like this approach we can close this PR again.

Either way, I just found out that this setup does not seem to work with the release-branch setup that was implemented in #90 - because installing it now results in a version number v0.5.13.dev..., so it does not recognize the tag Releases/v0.6.0. This means, if we want to use this we would either have to revert the release branches approach, or adjust my implementation here. As in this approach there are never two commits with identical version numbers, I think we could simply get rid of the release branches again.
Edit: To support release branches, we have to add

    "version_scheme": "release-branch-semver",

to the use_scm_version-dict in setup.py. But I guess first we decide if we keep release branches or not.

There is one oddity that you might see when looking through the changes: MANIFEST.in is normally used to include files. setuptools_scm reverts that, so everything is included by default, and MANIFEST.in is used to exclude files.

TODO

  • Decide yes/no for setuptools_scm.
  • Decide yes/no for release branches; adjust this PR accordingly.
  • The conda-recipe would need adjustments to include setuptools_scm to requirements: host:.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #93 (49065b5) into main (999d9ca) will decrease coverage by 0.56%.
The diff coverage is 77.21%.

@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
- Coverage   87.15%   86.59%   -0.57%     
==========================================
  Files           4        4              
  Lines         366      388      +22     
==========================================
+ Hits          319      336      +17     
- Misses         47       52       +5     

Not absolutely necessary, just so it gets the right version in the
tests. Also, add setuptools_scm to the release yaml. However, probably
not necessary, as the test yaml does not have it explicitely listed but
it is installed anyway.
@banesullivan
Copy link
Owner

I'm in favor of this and not having release branches

@prisae prisae marked this pull request as ready for review August 2, 2022 15:38
@prisae prisae mentioned this pull request Sep 2, 2022
@prisae prisae merged commit 0ed857f into main Oct 28, 2022
@prisae prisae deleted the setuptools-scm branch October 28, 2022 09:23
@prisae
Copy link
Collaborator Author

prisae commented Oct 28, 2022

Let's bring this in and see how it goes.

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