Skip to main content

Load Poetry package sources from environment variables

Project description

poetry-source-env

PyPI - Python Version PyPI GitHub release (latest SemVer) PyPI - License Code style: Black

poetry-source-env is a Poetry plugin that allows for package sources to be defined in environment variables. This lets you define private package sources for your project without exposing their URLs in pyproject.toml.

This plugin is intended as a workaround for python-poetry/poetry#5958 and will be deprecated if its functionality is ever implemented in Poetry itself.

Installation

poetry self add poetry-source-env

Usage

Normally, you would define a package source in pyproject.toml like this:

[[tool.poetry.source]]
name = "my-epic-source"
url = "https://pkg.celsiusnarhwal.dev"
default = false
secondary = false

With poetry-source-env, you can define this source via environment variables, similar to how you can already configure publishable repositories:

export POETRY_REPOSITORIES_MY_EPIC_SOURCE_URL=https://pkg.celsiusnarhwal.dev
export POETRY_REPOSITORIES_MY_EPIC_SOURCE_DEFAULT=false
export POETRY_REPOSITORIES_MY_EPIC_SOURCE_SECONDARY=false

If your source requires authentication, Poetry already supports defining its credentials via environment variables:

export POETRY_HTTP_BASIC_MY_EPIC_SOURCE_USERNAME=celsiusnarhwal
export POETRY_HTTP_BASIC_MY_EPIC_SOURCE_PASSWORD=superdupersecret

License

poetry-source-env is licensed under the MIT License.

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_source_env-1.0.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

poetry_source_env-1.0.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file poetry_source_env-1.0.0.tar.gz.

File metadata

  • Download URL: poetry_source_env-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.1 Linux/5.15.0-1036-azure

File hashes

Hashes for poetry_source_env-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae698702fe42a1e68ae9d186a664e128298cfc8f18aa6613e77778e28401a59d
MD5 32c81369e23485c543bc669662c725bf
BLAKE2b-256 80881cb6acfb0ffc74e19e05e2ac6b94a0d448c0eb62fcfab12a4dcb47711f98

See more details on using hashes here.

File details

Details for the file poetry_source_env-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: poetry_source_env-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.1 Linux/5.15.0-1036-azure

File hashes

Hashes for poetry_source_env-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 591b9c9d315920885939a919b44bfbe86d209bfd0aee4773f57ac8a07cd62d99
MD5 50a43c0fda878c582cd175b2f00a0692
BLAKE2b-256 5267e424b7de8ecdb429a0b3a70e920274602c170562c745871272485e6f9494

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