Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deplock-0.1.0.tar.gz (158.1 kB view details)

Uploaded Source

Built Distribution

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

deplock-0.1.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file deplock-0.1.0.tar.gz.

File metadata

  • Download URL: deplock-0.1.0.tar.gz
  • Upload date:
  • Size: 158.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deplock-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a82b2098b10e62e26416ae62975a08afa0e51bdb512c35080d5a563bac144160
MD5 4db60f7797f8bb60b3201f3996636e28
BLAKE2b-256 d7e2c489d879a6e29add4b50961e466e5330a639f5e001d10a5a9a5f889b772e

See more details on using hashes here.

Provenance

The following attestation bundles were made for deplock-0.1.0.tar.gz:

Publisher: python-release.yml on block/deplock

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

File details

Details for the file deplock-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deplock-0.1.0-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

Hashes for deplock-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b5f1bb1393aa4579656c0c9b653a9a119af56f137dce734a2695c1cb0fce1ae
MD5 17c6b506f79c5b64cb5cc42327e70647
BLAKE2b-256 a42d5ee58a18b4683f966b31d88d0ed6d838d4adece4f4178e0275023703e789

See more details on using hashes here.

Provenance

The following attestation bundles were made for deplock-0.1.0-py3-none-any.whl:

Publisher: python-release.yml on block/deplock

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