Python dependency specifications supporting logical operations
Project description
Dep-Logic
Python dependency specifications supporting logical operations
Installation
pip install dep-logic
This library requires Python 3.8 or later.
Currently, it contains two sub-modules:
dep_logic.specifier- a module for parsing and calculating PEP 440 version specifiers.dep_logic.markers- a module for parsing and calculating PEP 508 environment markers.
What does it do?
This library allows logic operations on version specifiers and environment markers.
For example:
>>> from dep_logic.specifiers import parse_version_specifier
>>>
>>> a = parse_version_specifier(">=1.0.0")
>>> b = parse_version_specifier("<2.0.0")
>>> print(a & b)
>=1.0.0,<2.0.0
>>> a = parse_version_specifier(">=1.0.0,<2.0.0")
>>> b = parse_version_specifier(">1.5")
>>> print(a | b)
>=1.0.0
For markers:
>>> from dep_logic.markers import parse_marker
>>> m1 = parse_marker("python_version < '3.8'")
>>> m2 = parse_marker("python_version >= '3.6'")
>>> print(m1 & m2)
python_version < "3.8" and python_version >= "3.6"
About the project
This project is based on @sdispater's poetry-core code, but it includes additional packages and a lark parser, which increases the package size and makes it less reusable.
Furthermore, poetry-core does not always comply with PEP-508. As a result, this project aims to offer a lightweight utility for dependency specification logic using PyPA's packaging.
Submodules:
dep_logic.specifiers- PEP 440 version specifiersdep_logic.markers- PEP 508 environment markersdep_logic.tags- PEP 425 platform tags
Caveats
Logic operations with ===<string> specifiers is partially supported.
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 dep_logic-0.5.2.tar.gz.
File metadata
- Download URL: dep_logic-0.5.2.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8dc4a74d1bad0d35a45c236572cf5d6534b5c2e84de87f2a354c849eec7e562
|
|
| MD5 |
781b9036d1e3205dccc5ffcf8e576891
|
|
| BLAKE2b-256 |
d80093a90a4ce514e63a181486c6408ea50e8cdf7cdb73ab5580a6f7f5e5a496
|
Provenance
The following attestation bundles were made for dep_logic-0.5.2.tar.gz:
Publisher:
release.yml on pdm-project/dep-logic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dep_logic-0.5.2.tar.gz -
Subject digest:
f8dc4a74d1bad0d35a45c236572cf5d6534b5c2e84de87f2a354c849eec7e562 - Sigstore transparency entry: 341868659
- Sigstore integration time:
-
Permalink:
pdm-project/dep-logic@b222a6f3231e75b1799ee80763d67ee5427c5217 -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/pdm-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b222a6f3231e75b1799ee80763d67ee5427c5217 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dep_logic-0.5.2-py3-none-any.whl.
File metadata
- Download URL: dep_logic-0.5.2-py3-none-any.whl
- Upload date:
- Size: 35.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e72ab6676afd32fe8702896a8b9886bddd6ccd457b77ba360e7b6c4c95ce4c0
|
|
| MD5 |
9b2d07628b2d20217e033cda7e2b2113
|
|
| BLAKE2b-256 |
0ca4c6927ef27a8da0788da2fa5f577df6423102c0b50cbabd80f867570949ef
|
Provenance
The following attestation bundles were made for dep_logic-0.5.2-py3-none-any.whl:
Publisher:
release.yml on pdm-project/dep-logic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dep_logic-0.5.2-py3-none-any.whl -
Subject digest:
0e72ab6676afd32fe8702896a8b9886bddd6ccd457b77ba360e7b6c4c95ce4c0 - Sigstore transparency entry: 341868691
- Sigstore integration time:
-
Permalink:
pdm-project/dep-logic@b222a6f3231e75b1799ee80763d67ee5427c5217 -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/pdm-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b222a6f3231e75b1799ee80763d67ee5427c5217 -
Trigger Event:
push
-
Statement type: