Skip to content

Commit 8a5df48

Browse files
committed
build: Pass in the build version explicitly.
This means we're using setuptools_scm in a very dumb and limited way but it does reduce boilerplate files/code in this repo and that project is fairly stable so I think it's fine. Ideally we either switch to a different build system in the future or the setuptools build interface allows for us to override the version number at build time.
1 parent e555f99 commit 8a5df48

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

backend/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ include = ["sample_plugin*"]
4545
exclude = ["sample_plugin.tests*"]
4646

4747
[tool.semantic_release]
48-
build_command = "pip install build && python -m build"
48+
# We use SETUPTOOLS_SCM_PRETEND_VERSION to pull the version from python-semantic-release instead
49+
# of actually pulling it from version control because the build step happens before the repo gets
50+
# tagged. Setuptools by default doesn't have any way of overriding the version number at build
51+
# time without a setup.py file. This is a fine alternative that reduces the amount of boilerplate
52+
# code and files we need in this repo.
53+
build_command = "pip install build && SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION python -m build"
4954

5055
[tool.semantic_release.commit_parser_options]
5156
# Because this repo is meant to be an example, docs changes are relevant

0 commit comments

Comments
 (0)