Convert, sync, and validate dependency intent between pyproject.toml, dependency groups, and pylock.toml.
Project description
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
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 pylock_bridge-1.0.2.tar.gz.
File metadata
- Download URL: pylock_bridge-1.0.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dec7418ae45e554d477f07eed93a55d0b1dc9c0c97b4991c7461f14d549d59b
|
|
| MD5 |
301f6846c26cd0dbded2e3d82e548082
|
|
| BLAKE2b-256 |
67f91ab35c3b8ee2c66fb3af4bea34f4aa2ef32737674cd50e1c82ad64da61a9
|
Provenance
The following attestation bundles were made for pylock_bridge-1.0.2.tar.gz:
Publisher:
publish.yml on Halfblood-Prince/pylock-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylock_bridge-1.0.2.tar.gz -
Subject digest:
7dec7418ae45e554d477f07eed93a55d0b1dc9c0c97b4991c7461f14d549d59b - Sigstore transparency entry: 1229538848
- Sigstore integration time:
-
Permalink:
Halfblood-Prince/pylock-bridge@a1458a7c5bfc682b18a84edcb804ed285ebbdd54 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Halfblood-Prince
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a1458a7c5bfc682b18a84edcb804ed285ebbdd54 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pylock_bridge-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pylock_bridge-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f69917a0eb49650d07594e5ad72f89f3b9c45cae18dc78987fd4e7cd2debd5c8
|
|
| MD5 |
4dbbc20c35cc3ca2bb6cfeab2828009b
|
|
| BLAKE2b-256 |
146b4109aff78821c3bc953ad621c4f5e3c2abf35778e97f4a1261c5d4746bdf
|
Provenance
The following attestation bundles were made for pylock_bridge-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on Halfblood-Prince/pylock-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylock_bridge-1.0.2-py3-none-any.whl -
Subject digest:
f69917a0eb49650d07594e5ad72f89f3b9c45cae18dc78987fd4e7cd2debd5c8 - Sigstore transparency entry: 1229538913
- Sigstore integration time:
-
Permalink:
Halfblood-Prince/pylock-bridge@a1458a7c5bfc682b18a84edcb804ed285ebbdd54 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Halfblood-Prince
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a1458a7c5bfc682b18a84edcb804ed285ebbdd54 -
Trigger Event:
workflow_dispatch
-
Statement type: