Skip to content

Commit

Permalink
Add example of setuptools-scm raw-options
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Jan 4, 2025
1 parent 6100c9b commit a6d39bc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a6d39bc

Please sign in to comment.