Skip to main content

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.dependencies
  • project.optional-dependencies
  • top-level [dependency-groups]
  • pylock.toml metadata 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.toml target filenames
  • syncs lockfile metadata from pyproject.toml into existing or new pylock*.toml files
  • 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-python
  • extras
  • dependency-groups
  • default-groups
  • metadata.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 pylock filenames
  • missing lockfiles
  • drift between pyproject.toml metadata and existing pylock*.toml metadata

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

pylock_bridge-1.0.2.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

pylock_bridge-1.0.2-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

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

Hashes for pylock_bridge-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7dec7418ae45e554d477f07eed93a55d0b1dc9c0c97b4991c7461f14d549d59b
MD5 301f6846c26cd0dbded2e3d82e548082
BLAKE2b-256 67f91ab35c3b8ee2c66fb3af4bea34f4aa2ef32737674cd50e1c82ad64da61a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylock_bridge-1.0.2.tar.gz:

Publisher: publish.yml on Halfblood-Prince/pylock-bridge

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

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

Hashes for pylock_bridge-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f69917a0eb49650d07594e5ad72f89f3b9c45cae18dc78987fd4e7cd2debd5c8
MD5 4dbbc20c35cc3ca2bb6cfeab2828009b
BLAKE2b-256 146b4109aff78821c3bc953ad621c4f5e3c2abf35778e97f4a1261c5d4746bdf

See more details on using hashes here.

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

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