PDM plugin that allows additional directories listed in pyproject.toml to be added to environment PATH
Project description
pdm-bin-dir
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.1 → 1.0.0-dev.2 |
patch |
1.0.0-dev.2 → 1.0.1-dev.1 |
minor |
1.0.0-dev.2 → 1.1.0-dev.1 |
major |
1.0.0-dev.2 → 2.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.Nfor 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=githubwith agit_ref— installs directly from the repository.source=testpypiwith aversion— installs an already-uploaded TestPyPI build.
Supported Python Versions
Python 3.10 and later.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a08ac6047a306a61e3ff1199e8c06622c24d5c0ed3d967d815baebaab81b984
|
|
| MD5 |
16aa3ba7cb980ac8568bb92867cae5f9
|
|
| BLAKE2b-256 |
1a6fcfa6dc80258f17d21598b855823ec3703e14793cb23049c55d5eeb56656c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdm_bin_dir-1.0.5.tar.gz -
Subject digest:
3a08ac6047a306a61e3ff1199e8c06622c24d5c0ed3d967d815baebaab81b984 - Sigstore transparency entry: 1616117359
- Sigstore integration time:
-
Permalink:
mckelvie-org/pdm-bin-dir@8fc8b1e02e0107be684ce2fda19d48f21f7ad3cc -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/mckelvie-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fc8b1e02e0107be684ce2fda19d48f21f7ad3cc -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09bfe8ed72c388524343886b8f2f231e16a394c65126fa1914270509a937e21c
|
|
| MD5 |
d40a92f78edd63ccfc9f2972acfce0d8
|
|
| BLAKE2b-256 |
c4911378b71a2e8f696fab3d0f2c71852f2a4699821fc1bbb51b705aef553720
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdm_bin_dir-1.0.5-py3-none-any.whl -
Subject digest:
09bfe8ed72c388524343886b8f2f231e16a394c65126fa1914270509a937e21c - Sigstore transparency entry: 1616117360
- Sigstore integration time:
-
Permalink:
mckelvie-org/pdm-bin-dir@8fc8b1e02e0107be684ce2fda19d48f21f7ad3cc -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/mckelvie-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fc8b1e02e0107be684ce2fda19d48f21f7ad3cc -
Trigger Event:
push
-
Statement type: