Poetry Plugin that uses setuptools-scm to determine version
Project description
Poetry Setuptools SCM Plugin
poetry-setuptools-scm-plugin is a Poetry plugin that uses setuptools_scm to extract a package version from git or Mercurial metadata.
Installation
Add the plugin to Poetry:
poetry self add poetry-setuptools-scm-plugin
Usage
To enable it in your Poetry-based project add the following to your pyproject.toml
:
[tool.setuptools_scm]
With this the version specified in version
of the tool.poetry
section in pyproject.toml
is ignored and
the version derived by setuptools_scm
is used instead. See its documentation
on further configuration options.
[!NOTE] The Poetry team believes "that the version is one of the static metadata and the pyproject.toml is the single source of truth for it".
Similar tools
- poetry-version-plugin:
This plugin allows to read the version either from a git tag or a version definition in an
__init__.py
file. To my latest knowledge it cannot derive dev-versions from git.
Development
Prerequisites
-
Python >=3.10, can for example be installed with pyenv:
pyenv install 3.10 pyenv local 3.10
-
Poetry >=1.2
Setup
poetry install
To simplify running commands in the Poetry environment:
poetry shell
The following section assume that the commands are executed from such a Poetry shell.
Test
pytest
Check
ruff check
Build
poetry build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for poetry_setuptools_scm_plugin-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7394a319e3243bd6d7f99c5f68de28122e34156c4c88490cb035963eb8264ed2 |
|
MD5 | 8264dfa13b11ac26e4a484279ef6076d |
|
BLAKE2b-256 | 86f2f5f4f2f0e0ba1bae2857740f84177a2539cb39f7221cee8d88fda6cf24bd |
Hashes for poetry_setuptools_scm_plugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcd23ad2cd7bea89890529df149fe6bd69f403a9471f7e352209b7d6609833be |
|
MD5 | f373f61c1d141717d9dba9e9b441f471 |
|
BLAKE2b-256 | 113b11407411b5d18d1ac5fc9477e5a727fe814ff5cf8be9c03571aabedabf5c |