ofek / hatch-vcs

Hatch plugin for versioning with your preferred VCS
MIT License
97 stars 15 forks source link

FIX: Only pass template to setuptools_scm.dump_version() if defined #55

Closed effigies closed 10 months ago

effigies commented 11 months ago

It seems more correct to return the actual value (None for absent) than a fake value. This will allow us to distinguish the case template = "" (which setuptools_scm could reasonably treat as an error) from it missing.

This patch uses a sentinel object to allow the result caching to work with None values. Once Python 3.7 is dropped, much of this machinery can be replaced with functools.cached_property.

Fixes #49.

effigies commented 11 months ago

Only failure is unrelated linting failures.

hoechenberger commented 10 months ago

Hello, what is the status on this one? :)

effigies commented 10 months ago

Waiting on review. It worked when I wrote it, but I haven't tested against more recent setuptools_scm, if there have been further releases.

ofek commented 10 months ago

Thank you!