emsig / libdlf

Library of Digital Linear Filters
Creative Commons Attribution 4.0 International
7 stars 1 forks source link

Remove setuptools_scm #15

Closed prisae closed 3 years ago

prisae commented 3 years ago

To streamline with other packages we should use simply git describe to get the version number:

git describe --tags

The implementation is

version = subprocess.check_output(
    ['git', 'describe', '--tags'], stderr=subprocess.DEVNULL
).strip().decode('utf-8').split('-')
if len(version) > 1 and version[1]:
    version = version[0][1:] + '.dev' + version[1]
else:
    version = version[0][1:]

What it does:

kerrykey commented 3 years ago

I just added this to the Julia code in 6f41b801d337e0860c97757ec22abe5713912df5

After spending the last 25+ years in Fortran and MATLAB, it's nice to be able to write one liners like this: version = split(read(`git describe --tags`,String),"-")[1][2:end]

prisae commented 3 years ago

Nice. I definitely didn't optimize that :-) I have to say that my str/regexp capabilities are way behind my numpy capabilities...

However, it takes only care of releases, not of the dev-part above (which is OK for what we discussed for the Julia build).