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.16.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: poetry_git_branch_plugin-0.0.16.tar.gz
  • Upload date:
  • Size: 4.3 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.16.tar.gz
Algorithm Hash digest
SHA256 e7aa369cb59aab5cadd1e8f5e12c3a5fb5f1e65ada9a5f89a9c672e22e816e89
MD5 49e6b8a787b811c4d47fe25303bf24ff
BLAKE2b-256 56cccc362c8cb316f521b61e6e06a739cc72c6931a6ff3bf1026e1be65ddf5eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for poetry_git_branch_plugin-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 29b8680e5312f7dbca73d13e59047f5adc5e0ee824e6076eb5f2e0279fd0f4b1
MD5 80c6627c491dc71bb0c5680f470f0e8d
BLAKE2b-256 976b6de9ccbf82173c5a0175011c2de342ae2bceded65efaa7a9366ce341c40d

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