Open jeeftor opened 7 months ago
Also here it looks like Rye can build fine with the modified version string in the pyproject.toml
I see I can call this directly as well:
So I guess I'm adding for an additional option to add a -dev
version in
In any case this is my work around in GitHub action:
If you tag your releases then an alternative workaround to consider might be to switch the backend from hatchling
to setuptools
and then use the standard configuration of setuptools_scm
to dynamically generate the version based on the latest tagged version and commit state. Between tagged releases the default versioning scheme for that setup will automatically include a devN
component based on the commit distance from the latest version tag, and you can run rye version
to see the dynamically computed version. Here's the relevant snippets of configuration required in the pyproject.toml
to enable that:
[project]
#version = "dynamic"
dynamic = ["version"]
[build-system]
requires = ["setuptools>=69", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
# can be empty if no extra settings are needed, presence enables setuptools_scm
Hatchling supports that directly and the maintainer uses this as well https://github.com/ofek/hatch-vcs
It looks like hatchling is being used under the hood. In my use case I'd like to utilize test.pypi and when I was using poetry I could do
.dev
versions.The first one here was uploaded with
rye
but I found I couldn't easily support.dev
versionsHowever to the best of my knowledge you are using hatchling under the hood.
I did the following:
Modified my pyproject:
Then I ran
So it looks like it wouldn't be to hard to implement a -dev version flag somehow.