Skip to main content

Use PDM inside Nox sessions

Project description

nox-pdm

Use PDM inside Nox sessions

This package provides a drop-in replacement for the nox.session decorator, and for the nox.Session object passed to user-defined session functions. This enables session.install to install packages at the versions specified in the pdm.lock file.

from nox_pdm import session, Session

@session(python=["3.10", "3.9"])
def tests(session: Session):
    # To install all packages in dependency group `tests` while using pdm.lock as constraint
    session.install(".[tests]")
    session.run("pytest")

Installation

Install nox-pdm from the Python Package Index:

pip install nox-pdm

Important: This package must be installed into the same environment that Nox is run from. If you installed Nox using pipx, use the following command to install this package into the same environment:

pipx inject nox nox-pdm

Requirements

  • Python 3.9+
  • PDM >= 2.12.0

You need to have a PDM installation on your system. It does not have to be in the same environment, but at the very least running the command pdm should work. nox-pdm uses PDM via its command-line interface.

Credits

This project was inspired by Claudio Jolowicz's https://pypi.org/project/nox-poetry.

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

nox_pdm-0.0.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

nox_pdm-0.0.1-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page