properly write version file even if in pretend mode #102
+12
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
before this, SETUPTOOLS_SCM_PRETEND_VERSION make setuptools_scm fail
to write the
write_to
file correctly. this was apparently to avoidissues with archives, which we believe is not a problem anymore.
this is, however, a problem for other tools like Debian packaging:
there, we use the pretend mechanism to import the version number from
the Debian packaging system (from
debian/changelog
, usually). thisworks at setup time: setuptools_scm has the proper environment and
detects the version. but if the software was written to depend on the
write_to
file, it will fail to find that version at runtime becausesetup.py
will not have written thewrite_to
file properly at buildtime.
this patch simply makes sure that the version is written even if the
provided version number is a string, which is usually the case for
pretend version numbers. a fixed test case is also provided.
Closes: #101