No project description provided
Project description
DepLock
Introduction
A simple Python package used to parse lock files, useful when writing code that must interpret the requirements of a lock file and process or manipulate these requirements.
Background
With the acceptance of Pep 751 in March 2025, Python
has agreed upon a universal lock file specification, known as the pylock.toml. The
PEP describes the projects as:
"[A] new file format for specifying dependencies to enable reproducible installation in a Python environment. The format is designed to be human-readable and machine-generated. Installers consuming the file should be able to calculate what to install without the need for dependency resolution at install-time."
There are many use cases where a Python API that parses the lock file specifications into Python objects are useful and necessary to build on top of.
How To Use
Import the package and get started!
from deplock.parser.pylock import PyLock
from deplock.types.environment import PythonVersion
from deplock.utils.prebuilt_envs import python_env_one
# create the config
config = PyLock()
py_env = python_env_one(PythonVersion.current_version())
# add a Python environment specifier
config.add_target_environment_specification(py_env)
# validate that lock file is valid for current Python env
config.validate_pylock_toml()
# find the subset of packages in lock file valid for current Python env
config.get_valid_packages_from_lock()
Simply change the configuration class if to parse uv.lock files!
from deplock.parser.uv import UVLock
from deplock.types.environment import PythonVersion
from deplock.utils.prebuilt_envs import python_env_one
# create the config
config = UVLock()
py_env = python_env_one(PythonVersion.current_version())
# add a Python environment specifier
config.add_target_environment_specification(py_env)
# validate that lock file is valid for current Python env
config.validate_uv_lock()
# find the subset of packages in lock file valid for current Python env
config.get_valid_packages_from_lock()
# find the preferred distribution of each valid package
config.get_preferred_distributions()
Notes
Unlike some lock files, the metadata contained in [[package.dependencies]] is
purposefully not used to determine if a package is required in the current installation
environment. The PEP confirms this, stating "Tools MUST NOT use this information when
doing installation; it is purely informational for auditing purposes."
More Open Source and usage information can be found here:
Project Resources
| Resource | Description |
|---|---|
| CODEOWNERS | Outlines the project lead(s) |
| CODE_OF_CONDUCT.md | Expected behavior for project contributors, promoting a welcoming environment |
| CONTRIBUTING.md | Developer guide to build, test, run, access CI, chat, discuss, file issues |
| GOVERNANCE.md | Project governance |
| LICENSE | Apache License, Version 2.0 |
Authors:
- Tyler Zupan
- Josh Hamet
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 deplock-0.1.1.tar.gz.
File metadata
- Download URL: deplock-0.1.1.tar.gz
- Upload date:
- Size: 159.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
551e45d6e7777055d167be03caef287c380f3799ddeccff69de478cca8d48290
|
|
| MD5 |
2450cabc890c6f262031f63a2db0b6c0
|
|
| BLAKE2b-256 |
a3f84c6eca694bb47d7dee65ac3e3fc7faa9bbe4127a1e62d68046e97b08c62c
|
Provenance
The following attestation bundles were made for deplock-0.1.1.tar.gz:
Publisher:
python-release.yml on block/deplock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deplock-0.1.1.tar.gz -
Subject digest:
551e45d6e7777055d167be03caef287c380f3799ddeccff69de478cca8d48290 - Sigstore transparency entry: 663615423
- Sigstore integration time:
-
Permalink:
block/deplock@27cfefdc36ee076fd30356784004569f2d77215a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/block
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@27cfefdc36ee076fd30356784004569f2d77215a -
Trigger Event:
release
-
Statement type:
File details
Details for the file deplock-0.1.1-py3-none-any.whl.
File metadata
- Download URL: deplock-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.2 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 |
e481b1b99d57367b766bdf3f19f5b80f78db0d78205860a3a3aaa43bfda7facd
|
|
| MD5 |
5b05498af164c7b8d70fafe3ec322076
|
|
| BLAKE2b-256 |
ca05b7b7a916a7d54ad2a7ed9cb2a42c301802f69b53ebeb2cace851f8db2e84
|
Provenance
The following attestation bundles were made for deplock-0.1.1-py3-none-any.whl:
Publisher:
python-release.yml on block/deplock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deplock-0.1.1-py3-none-any.whl -
Subject digest:
e481b1b99d57367b766bdf3f19f5b80f78db0d78205860a3a3aaa43bfda7facd - Sigstore transparency entry: 663615454
- Sigstore integration time:
-
Permalink:
block/deplock@27cfefdc36ee076fd30356784004569f2d77215a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/block
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@27cfefdc36ee076fd30356784004569f2d77215a -
Trigger Event:
release
-
Statement type: