banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

setuptools_scm #93

Closed prisae closed 1 year ago

prisae commented 2 years ago

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:

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 https://github.com/banesullivan/scooby/pull/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

codecov-commenter commented 2 years ago

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     
banesullivan commented 2 years ago

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

prisae commented 1 year ago

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