From a6d39bc9f65b0b6b82952bb4a415b92e45bf78a9 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Sat, 4 Jan 2025 18:42:12 +0200 Subject: [PATCH] Add example of setuptools-scm raw-options --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 8dd0a19..85f7d7a 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,22 @@ The [version source plugin](https://hatch.pypa.io/latest/plugins/version-source/ | `fallback-version` | `str` | | The version that will be used if no other method for detecting the version is successful. If not specified, unsuccessful version detection will raise an error. | | `raw-options` | `dict` | | A table of [`setuptools-scm` parameters](https://setuptools-scm.readthedocs.io/en/latest/config/) that will override any of the options listed above. The `write_to` and `write_to_template` parameters are ignored. | +For example, to prevent incrementing version numbers on non-release commits, you can adjust the `version_scheme` parameter for `setuptools-scm` as follows: + +- ***pyproject.toml*** + + ```toml + [tool.hatch.version.raw-options] + version_scheme = "no-guess-dev" + ``` + +- ***hatch.toml*** + + ```toml + [version.raw-options] + version_scheme = "no-guess-dev" + ``` + ### Version source environment variables - `SETUPTOOLS_SCM_PRETEND_VERSION`: When defined and not empty, it's used as the primary source for the version, in which case it will be an unparsed string.