boutproject / boutdata

GNU Lesser General Public License v3.0
0 stars 2 forks source link

Get version number automatically from latest tag #23

Closed johnomotani closed 3 years ago

johnomotani commented 3 years ago

Uses the setuptools_scm package to automatically get the version number in both installed versions (which don't require setuptools_scm to be installed) and development versions (which do require setuptools_scm).

This is a copy of the automatic-version-numbering that we use in xbout.

Note: PR to #22 because this is an addition to the package-release feature.

codecov-io commented 3 years ago

Codecov Report

Merging #23 (7abfe61) into 4_automatic_release (2d4096f) will increase coverage by 0.21%. The diff coverage is 42.85%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           4_automatic_release     #23      +/-   ##
======================================================
+ Coverage                 1.23%   1.44%   +0.21%     
======================================================
  Files                       17      17              
  Lines                     2274    2281       +7     
======================================================
+ Hits                        28      33       +5     
- Misses                    2246    2248       +2     
Impacted Files Coverage Δ
setup.py 0.00% <ø> (ø)
boutdata/__init__.py 52.38% <42.85%> (-22.62%) :arrow_down:

Continue to review full report at Codecov.

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

johnomotani commented 3 years ago

I think this should work OK. On xbout I'd added a git fetch --tags --unshallow to ensure that the latest tag was fetched, but I think I added it while debugging some problem not because it was strictly necessary. Looking at the log from the last time the release action ran, that command didn't seem to be getting the latest tag, so it shouldn't be necessary.