Skip to main content

PDM plugin that allows additional directories listed in pyproject.toml to be added to environment PATH

Project description

pdm-bin-dir

CI PyPI version Python versions License: MIT

pdm-bin-dir is a PDM plugin that automatically prepends additional project directories to PATH when running commands via PDM. This lets you place helper scripts alongside your project and run them as plain commands — no prefix or activation needed.

Installation

Install the plugin into PDM's own environment:

pdm plugin add pdm-bin-dir

Usage

The plugin is opt-in per project: it has no effect unless [tool.pdm.plugin.bin-dir] is present in the project's pyproject.toml. Once configured, the listed directories are prepended to PATH before every pdm run … invocation.

Configuration

Override the directories in pyproject.toml:

[tool.pdm.plugin.bin-dir]
dirs = ["bin", "scripts"]

Paths are relative to the project root. Absolute paths are also accepted.

pdm bin-dir command

The plugin registers a bin-dir sub-command for inspecting and changing the configuration:

# Show current configured directories (JSON array)
pdm bin-dir show

# Replace the list
pdm bin-dir set bin scripts

# Append to the list (duplicates are silently skipped)
pdm bin-dir add tools

Changes made via set / add are written back to pyproject.toml.

Development

This project uses PDM for dependency management, linting, type checking, and testing.

pdm install -G dev
pdm run lint       # ruff check
pdm run typecheck  # mypy
pdm run test       # pytest
pdm build

Publishing

Releases are managed through GitHub Actions using a three-channel model:

Channel Branch Tag format Index
dev main — (no publish)
rc rc/<x.y.z> rc-v<x.y.z>-rc.<n> TestPyPI
prod prod/<x.y.z> v<x.y.z> PyPI

Version invariant

main always carries X.Y.Z-dev.N. The x.y.z portion of any RC or production release always matches the commit on main from which it was cut — only the qualifier suffix changes.

Release workflow

Bump dev version — increment the version on main.

bin/bump-dev [dev|patch|minor|major]   # edits pyproject.toml, does not commit
bump_type Example
dev 1.0.0-dev.11.0.0-dev.2
patch 1.0.0-dev.21.0.1-dev.1
minor 1.0.0-dev.21.1.0-dev.1
major 1.0.0-dev.22.0.0-dev.1

Also available remotely via Actions → Bump dev version → Run workflow for cases where a local checkout is not convenient.

bin/cut-rc (run on main) — create a release candidate.

Reads X.Y.Z-dev.N from pyproject.toml, auto-increments the rc counter from existing tags, creates branch rc/X.Y.Z with version X.Y.Z-rc.N, and pushes — triggering Publish TestPyPI.

bin/cut-prod (run on rc/<x.y.z>) — promote to production.

Strips the rc qualifier, creates branch prod/X.Y.Z with the clean X.Y.Z version, and pushes — triggering Publish, which tags the commit vX.Y.Z and auto-bumps main to X.Y.(Z+1)-dev.1 after a successful PyPI push.

Guards

Both publish workflows validate that:

  • The branch version matches pyproject.toml's version.
  • The version format matches the target index (stable for PyPI, -rc.N for TestPyPI).
  • The version does not already exist on the target index.
  • Lint, type checks, and tests pass.

Install-path smoke test

Use the Install Smoke Test workflow to verify an install without publishing or bumping a version:

  • source=github with a git_ref — installs directly from the repository.
  • source=testpypi with a version — installs an already-uploaded TestPyPI build.

Supported Python Versions

Python 3.10 and later.

License

MIT. See 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

pdm_bin_dir-1.0.5.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdm_bin_dir-1.0.5-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pdm_bin_dir-1.0.5.tar.gz.

File metadata

  • Download URL: pdm_bin_dir-1.0.5.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdm_bin_dir-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3a08ac6047a306a61e3ff1199e8c06622c24d5c0ed3d967d815baebaab81b984
MD5 16aa3ba7cb980ac8568bb92867cae5f9
BLAKE2b-256 1a6fcfa6dc80258f17d21598b855823ec3703e14793cb23049c55d5eeb56656c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdm_bin_dir-1.0.5.tar.gz:

Publisher: publish.yml on mckelvie-org/pdm-bin-dir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdm_bin_dir-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: pdm_bin_dir-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdm_bin_dir-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 09bfe8ed72c388524343886b8f2f231e16a394c65126fa1914270509a937e21c
MD5 d40a92f78edd63ccfc9f2972acfce0d8
BLAKE2b-256 c4911378b71a2e8f696fab3d0f2c71852f2a4699821fc1bbb51b705aef553720

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdm_bin_dir-1.0.5-py3-none-any.whl:

Publisher: publish.yml on mckelvie-org/pdm-bin-dir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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