Skip to content

A Poetry plugin that sets an environment variable with the current Git branch name.

License

Notifications You must be signed in to change notification settings

dribia/poetry-git-branch-plugin

Repository files navigation

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.

About

A Poetry plugin that sets an environment variable with the current Git branch name.

Resources

License

Stars

Watchers

Forks

Packages

No packages published