Skip to content

How to make a release without version bumping? #812

@wookayin

Description

@wookayin

I've spent more than hour to figure out how to make a release while using setuptools_scm, but it's documented nowhere properly. Some relevant issues are #143 and #767, as well as a SO thread, but they seem pretty outdated.

Here's how I am doing:

# pyproject.toml                                                   
                                                                   
[build-system]                                                     
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
                                                                   
[tool.setuptools_scm]                                              
version_scheme = "release-branch-semver"
write_to = "mypackage/_version.py"                                   

setup.py:

setup(
   name='mypackage',
   # version='...',      # no version= ...
)

Running python setup.py sdist always shows the development version:

$ git checkout -b release-v1.1

# Note that the latest tagged version is v1.0
$ python setup.py --version 
1.1.0.dev35+g5478274

$ python setup.py sdist
(generates 1.1.0.dev35+g5478274 in the metadata)

I tried branch v1.1, creating a tag v1.1 but doesn't work -- it would simply bump up to version to 1.2.0dev0 instead.

I would want to have the version simply set as '1.1' to make a release, but there seems no way to prohibit setuptools_scm from changing the version. Any hints? I hope documentations about how to make a release can be improved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions