Output testable Python versions based on pyproject.toml.
Project description
testable-dependables
testable-dependables outputs the testable versions of Python for use in a justfile or CI/CD workflow instead of hardcoding them. Automatically stay on top of supported Python versions.
It supports modern Python packages that use the pyproject.toml standard (aka PEP 621).
Why?
I wanted a command to automatically test all supported Python versions for a library based on its pyproject.toml Python requirements, i.e. not hardcoding versions somewhere.
Here's an example justfile that utilizes testable-dependables and uv to run unit tests in isolated environments for each supported Python version.
# Run tests across all supported Python versions
test-all-versions:
#!/usr/bin/env bash
set -euo pipefail
for version in $(uvx testable-dependables); do
echo -e "\n=== Testing with Python $version ==="
uv run --all-extras --python "$version" pytest
echo -e "\n=== Tests completed for Python $version ===\n"
done
echo "All tests completed successfully"
Usage
uvx
uv is an extremely fast Python package and project manager, written in Rust. uvx is an alias for uv tool run ....
- Install
uv - Go to a directory with source code for a Python package
uvx testable-dependables
pipx
pipx is a way to run install and run Python applications in isolated environments.
- Install
pipx pipx install testable-dependables- Go to a directory with source code for a Python package
testable-dependables
pip --user
Install testable-dependables to the Python user install directory. More details in the pip docs.
pip install --user testable-dependables- Go to a directory with source code for a Python package
testable-dependables
CLI arguments
path
testable-dependables optionally accepts a path as the first argument. Defaults to . for the current directory.
uvx testable-dependables /path/to/project
--json
Output as json.
uvx troml --json /path/to/project
--verbose
Outputs more verbose information.
uvx troml --verbose /path/to/project/
Development
- Install
just: https://just.systems/man/en/packages.html just fetch
Run from source
uv run testable-dependables [PATH-TO-PYPROJECT-TOML]
Commands
- unit tests (via
pytest):just test - linting (via
ruff):just lint - type checking (via
mypy):just type - unit test coverage (via
coverage.py):just coverage - run 'em all:
just dev
Inspiration
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 testable_dependables-0.1.0.tar.gz.
File metadata
- Download URL: testable_dependables-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8db7acfcf52148f9a631095ba054da9ff134adcef7f89d963e40df82c521c985
|
|
| MD5 |
ac8e102109dd42728825e7f2fc62e876
|
|
| BLAKE2b-256 |
f48b427f1b106b5df40731fa5a61341e5b65b69e0d777bcb9ae0920149400d29
|
Provenance
The following attestation bundles were made for testable_dependables-0.1.0.tar.gz:
Publisher:
publish.yml on adamghill/testable-dependables
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testable_dependables-0.1.0.tar.gz -
Subject digest:
8db7acfcf52148f9a631095ba054da9ff134adcef7f89d963e40df82c521c985 - Sigstore transparency entry: 529114447
- Sigstore integration time:
-
Permalink:
adamghill/testable-dependables@0858146138c732be3ca1831cbdc3ced4ec866bab -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/adamghill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0858146138c732be3ca1831cbdc3ced4ec866bab -
Trigger Event:
release
-
Statement type:
File details
Details for the file testable_dependables-0.1.0-py3-none-any.whl.
File metadata
- Download URL: testable_dependables-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 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 |
e0b3b3758c3abc22652e781705a8e48b64dfb65583b1410ec78f2b9901635640
|
|
| MD5 |
281e32db86e827a9a43a0101b401f344
|
|
| BLAKE2b-256 |
ea4633ab3426245b83fe60e8a73617ed06e0ce2da50b89ed464bc4ae475b1da7
|
Provenance
The following attestation bundles were made for testable_dependables-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on adamghill/testable-dependables
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
testable_dependables-0.1.0-py3-none-any.whl -
Subject digest:
e0b3b3758c3abc22652e781705a8e48b64dfb65583b1410ec78f2b9901635640 - Sigstore transparency entry: 529114456
- Sigstore integration time:
-
Permalink:
adamghill/testable-dependables@0858146138c732be3ca1831cbdc3ced4ec866bab -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/adamghill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0858146138c732be3ca1831cbdc3ced4ec866bab -
Trigger Event:
release
-
Statement type: