pdm-project.org Open in urlscan Pro
2606:4700:3031::6815:a3c  Public Scan

Submitted URL: http://pdm-project.org/
Effective URL: https://pdm-project.org/latest/
Submission: On February 18 via api from US — Scanned from DE

Form analysis 2 forms found in the DOM

<form class="md-header__option" data-md-component="palette">
  <input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="deep-purple" data-md-color-accent="teal" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
  <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path
        d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5c-.84 0-1.65.15-2.39.42L12 2M3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29L3.34 7m.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14L3.36 17M20.65 7l-1.77 3.79a7.023 7.023 0 0 0-2.38-4.15l4.15.36m-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29L20.64 17M12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44L12 22Z">
      </path>
    </svg>
  </label>
  <input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="teal" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
  <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden="">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path
        d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95 2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31Z">
      </path>
    </svg>
  </label>
</form>

Name: search

<form class="md-search__form" name="search">
  <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required="">
  <label class="md-search__icon md-icon" for="__search">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"></path>
    </svg>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"></path>
    </svg>
  </label>
  <nav class="md-search__options" aria-label="Search">
    <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
        <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"></path>
      </svg>
    </button>
  </nav>
</form>

Text Content

Skip to content
Party Dancing Master

PDM
2.12
 * 2.12
 * 2.11
 * 2.10
 * 2.9
 * dev

Introduction

Type to start searching
GitHub
 * 2.12.3
 * 6.2k
 * 318

 * Usage
 * Reference
 * Development
 * Sponsor

PDM
GitHub
 * 2.12.3
 * 6.2k
 * 318

 * Usage
   Usage
    * Introduction Introduction
      Table of contents
       * Feature highlights
       * Installation
          * Recommended installation method
          * Other installation methods
          * Update the PDM version
      
       * Packaging Status
       * Shell Completion
       * Virtualenv and PEP 582
       * PDM Eco-system
       * Sponsors
   
    * New Project
    * Manage Dependencies
    * Build and Publish
    * Configure the Project
    * PDM Scripts
    * Lifecycle and Hooks
    * Advanced Usage
    * Working with Virtual Environments
    * Working with PEP 582
    * Create Project From a Template

 * Reference
   Reference
    * PEP 621 Metadata
    * Configurations
    * Build Configuration
    * CLI Reference
    * API Reference

 * Development
   Development
    * PDM Plugins
    * Pytest fixtures
    * Contributing to PDM
    * Changelog
    * Benchmark

 * Sponsor

Table of contents
 * Feature highlights
 * Installation
    * Recommended installation method
    * Other installation methods
    * Update the PDM version

 * Packaging Status
 * Shell Completion
 * Virtualenv and PEP 582
 * PDM Eco-system
 * Sponsors


INTRODUCTION#

PDM, as described, is a modern Python package and dependency manager supporting
the latest PEP standards. But it is more than a package manager. It boosts your
development workflow in various aspects.




FEATURE HIGHLIGHTS#

 * Simple and fast dependency resolver, mainly for large binary distributions.
 * A PEP 517 build backend.
 * PEP 621 project metadata.
 * Flexible and powerful plug-in system.
 * Versatile user scripts.
 * Opt-in centralized installation cache like pnpm.


INSTALLATION#

PDM requires Python 3.8+ to be installed. It works on multiple platforms
including Windows, Linux and macOS.

Note

You can still have your project working on lower Python versions, read how to do
it here.


RECOMMENDED INSTALLATION METHOD#

PDM requires python version 3.8 or higher.

Like Pip, PDM provides an installation script that will install PDM into an
isolated environment.

Linux/MacWindows

1

curl -sSL https://pdm-project.org/install-pdm.py | python3 -


1

(Invoke-WebRequest -Uri https://pdm-project.org/install-pdm.py -UseBasicParsing).Content | py -





For security reasons, you should verify the checksum of install-pdm.py. It can
be downloaded from install-pdm.py.sha256.

For example, on Linux/Mac:

1
2
3
4

curl -sSLO https://pdm-project.org/install-pdm.py
curl -sSL https://pdm-project.org/install-pdm.py.sha256 | shasum -a 256 -c -
# Run the installer
python3 install-pdm.py [options]


The installer will install PDM into the user site and the location depends on
the system:

 * $HOME/.local/bin for Unix
 * $HOME/Library/Python/<version>/bin for MacOS
 * %APPDATA%\Python\Scripts on Windows

You can pass additional options to the script to control how PDM is installed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

usage: install-pdm.py [-h] [-v VERSION] [--prerelease] [--remove] [-p PATH] [-d DEP]

optional arguments:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION | envvar: PDM_VERSION
                        Specify the version to be installed, or HEAD to install from the main branch
  --prerelease | envvar: PDM_PRERELEASE    Allow prereleases to be installed
  --remove | envvar: PDM_REMOVE            Remove the PDM installation
  -p PATH, --path PATH | envvar: PDM_HOME  Specify the location to install PDM
  -d DEP, --dep DEP | envvar: PDM_DEPS     Specify additional dependencies, can be given multiple times


You can either pass the options after the script or set the env var value.


OTHER INSTALLATION METHODS#

HomebrewScooppipxpipasdfinside project

1

brew install pdm


1
2

scoop bucket add frostming https://github.com/frostming/scoop-frostming.git
scoop install pdm


1

pipx install pdm


Install the head version of GitHub repository. Make sure you have installed Git
LFS on your system.

1

pipx install git+https://github.com/pdm-project/pdm.git@main#egg=pdm


To install PDM with all features:

1

pipx install pdm[all]


See also: https://pypa.github.io/pipx/

1

pip install --user pdm


Assuming you have asdf installed.

1
2
3

asdf plugin add pdm
asdf local pdm latest
asdf install pdm




By copying the Pyprojectx wrapper scripts to a project, you can install PDM as
(npm-style) dev dependency inside that project. This allows different
projects/branches to use different PDM versions.

To initialize a new or existing project, cd into the project folder and:

Linux/MacWindows

1
2

curl -LO https://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip && unzip wrappers.zip && rm -f wrappers.zip
./pw --add pdm


1
2

Invoke-WebRequest https://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip -OutFile wrappers.zip; Expand-Archive -Path wrappers.zip -DestinationPath .; Remove-Item -Path wrappers.zip
.\pw --add pdm





When installing pdm with this method, you need to run all pdm commands through
the pw wrapper:

Linux/Mac/Windows

1

./pw pdm install








UPDATE THE PDM VERSION#

1

pdm self update



PACKAGING STATUS#




SHELL COMPLETION#

PDM supports generating completion scripts for Bash, Zsh, Fish or Powershell.
Here are some common locations for each shell:

BashZshFishPowershell

1

pdm completion bash > /etc/bash_completion.d/pdm.bash-completion


1
2

# Make sure ~/.zfunc is added to fpath, before compinit.
pdm completion zsh > ~/.zfunc/_pdm


Oh-My-Zsh:

1
2

mkdir $ZSH_CUSTOM/plugins/pdm
pdm completion zsh > $ZSH_CUSTOM/plugins/pdm/_pdm


Then make sure pdm plugin is enabled in ~/.zshrc

1

pdm completion fish > ~/.config/fish/completions/pdm.fish


 1
 2
 3
 4
 5
 6
 7
 8
 9
10

# Create a directory to store completion scripts
mkdir $PROFILE\..\Completions
echo @'
Get-ChildItem "$PROFILE\..\Completions\" | ForEach-Object {
    . $_.FullName
}
'@ | Out-File -Append -Encoding utf8 $PROFILE
# Generate script
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
pdm completion powershell | Out-File -Encoding utf8 $PROFILE\..\Completions\pdm_completion.ps1






VIRTUALENV AND PEP 582#

PDM offers experimental support for PEP 582 as an opt-in feature, in addition to
virtualenv management. Although the Python Steering Council has rejected PEP
582, you can still test it out using PDM.

To learn more about the two modes, refer to the relevant chapters on Working
with virtualenv and Working with PEP 582.


PDM ECO-SYSTEM#

Awesome PDM is a curated list of awesome PDM plugins and resources.


SPONSORS#



Copyright © 2019 Frost Ming
Made with Material for MkDocs