Skip to main content

Some set of poetry plugins

Project description

Poem Plugins

Pypi Coverage Status

A set of plugins for Poetry.

How to use

Make sure you have Poetry version 1.4.0 or above. Read below for instructions to install it if you haven't.

Install Poem Plugins

Install this plugin to your Poetry:

poetry self add poem-plugins

Version Plugin

The poetry plugin for project versioning allows users to specify the version of their project via the provider other than the default pyproject.toml file. This can be useful for users who prefer to set the project version based on a git tag, for example.

Plugin can be configured via a section in the pyproject.toml file. To use the plugin, you will need to add a section to your pyproject.toml file that specifies the provider.

Here's an example of how you might configure the plugin in your pyproject.toml file:

[tool.poem-plugins.version]
provider = "git"

Likewise, you can specify a number of optional arguments to control the plugin behavior. Here are some of the arguments that you can use:

Name description Default
update_pyproject plugin will not only use version from provider for building, but save it in pyproject.toml false
write_version_file plugin will create a file version.py inside a module, with version information false
version_file_quotes plugin will replace default quotes in version.py file with provided by: ' or " unset

You can specify provider-specific settings in your configuration. To specify provider-specific settings, you can use the tool.poem-plugins.version.{provider} section. Here are some of the arguments that you can use for git provider:

Name description Default
version_prefix filter tags only starts with this prefix v
format plugin will use commit hash (long) or not (short) to build a project version short

Example:

[tool.poem-plugins.version.git]
version_prefix = "v"
format = "short"

To build your project, run the poetry build command. The plugin will build the version via provider and use it to set the version for the project.

$ git tag -a v0.1 -m 'tag description'
$ poetry build
poem-plugins: Setting version to: 0.1.0
Building awesome_package (0.1.0)
  - Building sdist
  - Built awesome_package-0.1.0.tar.gz
  - Building wheel
  - Built awesome_package-0.1.0-py3-none-any.whl

How to develop

Before getting started with development, you'll need to have poetry installed.

Once you have poetry installed, you can create a virtual environment for the project by running:

poetry install

This will also install all the dependencies required for the project.

Pre-commit hooks

This project uses pre-commit to automatically run simple formatter gray before committing changes. To set up the pre-commit hooks, run the following command in the project root:

poetry run pre-commit install

Type checking

This project uses mypy for type checking. You can run the type checker with the following command:

poetry run mypy poem_plugins

Linting

This project uses pylama for linting. You can run the linter with the following command:

poetry run pylama poem_plugins

Tests

We use pytest for running tests. You can run the tests with the following command:

poetry run pytest

Please make sure that all tests pass and linter and type checker does not report any issues before submitting a pull request.

Repo Activity

Alt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poem_plugins-1.1.101.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

poem_plugins-1.1.101-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file poem_plugins-1.1.101.tar.gz.

File metadata

  • Download URL: poem_plugins-1.1.101.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.3-arch1-1

File hashes

Hashes for poem_plugins-1.1.101.tar.gz
Algorithm Hash digest
SHA256 597df8dd286066cb2e09565a8262a053b72e36af4390c895388dcd0d5de68b91
MD5 732f222369665963500fca2d1b0a3068
BLAKE2b-256 3ae1a66cb59d49e6e32ac95974f322fb2d0e80e42e22554cc05368e1559f993e

See more details on using hashes here.

File details

Details for the file poem_plugins-1.1.101-py3-none-any.whl.

File metadata

  • Download URL: poem_plugins-1.1.101-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.3-arch1-1

File hashes

Hashes for poem_plugins-1.1.101-py3-none-any.whl
Algorithm Hash digest
SHA256 3cced4e893019e746e0be2142ae3c4e4dff32b360787e27a0aef79d2952dacf4
MD5 d6bcedd788dba18dc5ed3b6e7deb7dbc
BLAKE2b-256 f0897ca523162450f86ee579d6bc4fcf7e9c8ec881bc97c48e7eb41a15423647

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page