Skip to main content

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 ....

  1. Install uv
  2. Go to a directory with source code for a Python package
  3. uvx testable-dependables

pipx

pipx is a way to run install and run Python applications in isolated environments.

  1. Install pipx
  2. pipx install testable-dependables
  3. Go to a directory with source code for a Python package
  4. testable-dependables

pip --user

Install testable-dependables to the Python user install directory. More details in the pip docs.

  1. pip install --user testable-dependables
  2. Go to a directory with source code for a Python package
  3. 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

  1. Install just: https://just.systems/man/en/packages.html
  2. 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


Download files

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

Source Distribution

testable_dependables-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

testable_dependables-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for testable_dependables-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8db7acfcf52148f9a631095ba054da9ff134adcef7f89d963e40df82c521c985
MD5 ac8e102109dd42728825e7f2fc62e876
BLAKE2b-256 f48b427f1b106b5df40731fa5a61341e5b65b69e0d777bcb9ae0920149400d29

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on adamghill/testable-dependables

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

File details

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

File metadata

File hashes

Hashes for testable_dependables-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0b3b3758c3abc22652e781705a8e48b64dfb65583b1410ec78f2b9901635640
MD5 281e32db86e827a9a43a0101b401f344
BLAKE2b-256 ea4633ab3426245b83fe60e8a73617ed06e0ce2da50b89ed464bc4ae475b1da7

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on adamghill/testable-dependables

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