Skip to main content

A poetry plugin to store the current git branch into environment variable when poetry runs any command.

Project description

Poetry Git Branch Plugin

driconfig

CI/CD Tests Coverage Status Tests types - Mypy Ruff
Package PyPI PyPI - Downloads PyPI - Python Version GitHub

Documentation: https://dribia.github.io/poetry-git-branch-plugin

Source Code: https://github.com/dribia/poetry-git-branch-plugin


A simple poetry plugin that sets an environment variable containing the name of the current checked-out branch before executing any poetry command.

Installation

Depending on how you installed poetry, there are different ways to install this plugin.

The easiest way to install this plugin is to use the poetry self add command:

poetry self add poetry-git-branch-plugin

If you installed poetry using pip:

pip install poetry-git-branch-plugin

If you installed poetry using pipx:

pipx inject poetry poetry-git-branch-plugin

You can also specify that a plugin is required for your project in the tool.poetry.requires-plugins section of the pyproject.toml file:

[tool.poetry.requires-plugins]
poetry-git-branch-plugin = ">=0.0.1"

Usage

Our main use case is in situations where DBT needs access to the current git branch name to set the name of the target schema.

Contributing

Poetry is the best way to interact with this project, to install it, follow the official Poetry installation guide.

With poetry installed, one can install the project dependencies with:

poetry install

Then, to run the project unit tests:

make test-unit

To run the linters (ruff and mypy):

make lint

To apply all code formatting:

make format

License

poetry-git-branch-plugin is distributed under the terms of the MIT license. Check the LICENSE file for further details.

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

poetry_git_branch_plugin-0.0.15.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file poetry_git_branch_plugin-0.0.15.tar.gz.

File metadata

  • Download URL: poetry_git_branch_plugin-0.0.15.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.0 Linux/6.5.0-1025-azure

File hashes

Hashes for poetry_git_branch_plugin-0.0.15.tar.gz
Algorithm Hash digest
SHA256 4c01f70049445d491cad87537092cdb09aae123d52bf041a5d9dd6ddd6886b66
MD5 572ede4417c89734fa210a4834c9a86f
BLAKE2b-256 a3598338ffd013fd97ae5148fb9f717cc2e7c4f56023b7cb61e256c016464a6e

See more details on using hashes here.

File details

Details for the file poetry_git_branch_plugin-0.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_git_branch_plugin-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 33d424495caa1e305f0186a6b01866bf29e32fafd6337bcd0193563e508ab8da
MD5 bad6b3257bd1e3e53c790e64f6fd854e
BLAKE2b-256 fcead303cc9f09b74f2c826750910ee65286048b425c930f0598d2edb0f46375

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