Skip to main content

tox-pdm

A plugin for tox that utilizes PDM as the package manager and installer.

Github Actions PyPI pre-commit Code style: black Tox Versions

With this plugin, you can migrate your project to PDM while retaining the ability to test against multiple versions.

Installation

$ pip install tox-pdm

Or,

$ pdm add -d tox-pdm

Or if you installed tox via pipx, you can inject the plugin by:

$ pipx inject tox tox-pdm

Example tox.ini

The following simple example installs dev and test dependencies into the venv created by Tox and uses pytest to execute the tests, on both Python 3.7 and 3.8.

[tox]
min_version = 4.0
envlist = py37,py38

[testenv]
groups =  ; Dependency groups in pyproject.toml
    dev
    test
deps =      ; Additional dependencies, it will be installed into the library path via normal pip method
    flake8
commands =
    pytest test/

Here is another one installing the test dependencies and executing the test PDM script

[tox]
min_version = 4.0
envlist = py3{8,9,10}

[testenv]
groups = test
commands = test

If no groups are specified, the pdm install will be skipped.

A real-world example can be found at this repository's tox.ini and GitHub Action workflow.

Some best practices:

  1. pdm executable must be exposed in PATH, if it is not the case, give the absolute path to tox by tox --pdm <path_to_pdm>.
  2. Make sure you have generated pdm.lock before running the test, it will greatly accelerate the testing.
  3. If you don't set skip_install = true, the current package will be built and installed into the testing environment together with the dependencies from pyproject.toml.
  4. Reuse your PDM scripts to avoid duplication

Metadata

Release files for tox-pdm 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tox-pdm 0.7.2
File Size Uploaded
tox_pdm-0.7.2.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tox-pdm 0.7.2
File Interpreter ABI Platform
tox_pdm-0.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / tox_pdm-0.7.2.tar.gz

Download URL tox_pdm-0.7.2.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a841a7e1e942a71805624703b9a6d286663bd6af79bba6130ba756975c315308
BLAKE2b-256 checksum
How to use checksums
f90218bb27f68d094f2f8cea32c7e072d7e7e3ac0fb71e192a772f1fa97e1659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / tox_pdm-0.7.2-py3-none-any.whl

Download URL tox_pdm-0.7.2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12f6215416b7acd00a80a9e7128f3dc3e3c89308d60707f5d0a24abdf83ac104
BLAKE2b-256 checksum
How to use checksums
0d08b90abe66283809416441e9c778cb73cb637a53b914e9b2a9ded8fbdc51c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.7.2 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page