pylock-bridge
pylock-bridge is a production-ready Python library and CLI for converting, syncing, and validating dependency intent between:
project.dependenciesproject.optional-dependencies- top-level
[dependency-groups] pylock.tomlmetadata and target naming
It is designed for CI pipelines, multi-lock workflows, and monorepos that want one place to reason about standardized packaging data without taking over dependency resolution.
What it does
- inspects dependency intent from
pyproject.toml - plans standardized
pylock.tomltarget filenames - syncs lockfile metadata from
pyproject.tomlinto existing or newpylock*.tomlfiles - preserves existing
[[packages]],tool.*, and unrelated lockfile content while updating bridge-managed metadata - validates drift between project metadata and lockfile metadata
- scans monorepos and reports project-by-project plans
- exposes a clean Python API for automation
pylock-bridge does not resolve dependencies or generate package entries. It keeps project intent and lockfile metadata aligned so your resolver or build pipeline can do the actual solving.
Install
pip install pylock-bridge
For local development:
pip install -e .
python -m unittest discover -s tests
CLI
Inspect a project:
pylock-bridge inspect
pylock-bridge inspect --project path/to/pyproject.toml --format json
Plan lock targets:
pylock-bridge plan
pylock-bridge plan --workspace .
Validate drift:
pylock-bridge validate
pylock-bridge validate --workspace . --strict
Sync a target into a lockfile:
pylock-bridge sync --target default --write
pylock-bridge sync --target dev --format toml
pylock-bridge sync --target dev --check
Discover projects in a monorepo:
pylock-bridge discover --workspace .
Python API
from pylock_bridge import plan_project, sync_project_lock, validate_workspace
targets = plan_project("pyproject.toml")
result = sync_project_lock("pyproject.toml", target_name="default", write=True)
issues = validate_workspace(".", check_lockfiles=True)
Planning configuration
You can customize how lock targets are planned using [tool.pylock-bridge]:
[tool.pylock-bridge]
default-lock = "pylock.toml"
include-optionals-by-default = false
include-groups-by-default = false
default-groups = ["dev"]
[tool.pylock-bridge.targets.dev]
dependency-groups = ["dev"]
default-groups = ["dev"]
[tool.pylock-bridge.targets.docs]
optional-dependencies = ["docs"]
[tool.pylock-bridge.targets.ci]
include-runtime = true
dependency-groups = ["lint", "test"]
filename = "pylock.ci.toml"
Sync model
When you run sync, the tool updates lockfile metadata based on the selected target:
requires-pythonextrasdependency-groupsdefault-groupsmetadata.pylock-bridge
Existing [[packages]] entries are preserved so lockfile metadata can be refreshed without discarding solved package state.
Monorepo support
Workspace scanning walks the tree for pyproject.toml files while ignoring common generated directories such as .git, .venv, dist, build, and node_modules.
This makes it suitable for:
- repository-wide validation in CI
- reporting planned lock targets for many packages
- standardizing lock metadata conventions across multiple subprojects
Validation rules
Validation currently checks:
- group/extra normalization collisions
- target filename collisions
- nonstandard
pylockfilenames - missing lockfiles
- drift between
pyproject.tomlmetadata and existingpylock*.tomlmetadata
Metadata
Release files for pylock-bridge 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylock_bridge-1.0.2.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylock_bridge-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / pylock_bridge-1.0.2.tar.gz
| Download URL | pylock_bridge-1.0.2.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dec7418ae45e554d477f07eed93a55d0b1dc9c0c97b4991c7461f14d549d59b
|
|
BLAKE2b-256 checksum How to use checksums |
67f91ab35c3b8ee2c66fb3af4bea34f4aa2ef32737674cd50e1c82ad64da61a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logRelease files / pylock_bridge-1.0.2-py3-none-any.whl
| Download URL | pylock_bridge-1.0.2-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f69917a0eb49650d07594e5ad72f89f3b9c45cae18dc78987fd4e7cd2debd5c8
|
|
BLAKE2b-256 checksum How to use checksums |
146b4109aff78821c3bc953ad621c4f5e3c2abf35778e97f4a1261c5d4746bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency log