-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Labels
confirmedPrevent from becoming stalePrevent from becoming stalefeatureA new feature or a feature requestA new feature or a feature request
Description
Feature Request
Description
Add a mode to version_variables which adds a bare version number to a file instead of replacing a python variable.
Use cases
A "version" file which contains just a version number (no quotes, etc.). This makes it easier to support multi-language repos which load the contents of that file into their respective version variables. Example of mixed python and c++ via conan:
pyproject.toml
...
[tool.hatch.version]
path = "./version"
pattern = '(?P<version>.+$)'
conanfile.py
...
def set_version(self):
with open(os.path.join(self.recipe_folder, "version"), "rt") as v:
self.version = v.read().strip()
Possible implementation
version_variables = [
"version::nf"
]
Alternative solutions
I'm currently using a build_command:
#!/bin/sh
echo $NEW_VERSION > version
Metadata
Metadata
Assignees
Labels
confirmedPrevent from becoming stalePrevent from becoming stalefeatureA new feature or a feature requestA new feature or a feature request