Skip to content

[tool.pdm]#

[tool.pdm] #

Root table for setting pdm options within pyproject.toml

Attributes:

Name Type Description
build BuildTable

Control how pdm-backend builds the package

dev-dependencies dict[str, list[str]]

Development-only dependencies

distribution bool
ignore_package_warnings list[str]
options OptionsTable

Add parameters to every pdm cli call

plugins list[str]
resolution ResolutionTable

Rules governing lockfile resolution

scripts dict[str, Union[str, UserScript]]
source list[SourceTable]

Repositories where packages may be found

version VersionTable

Dynamic Versioning

build = BuildTable #

Control how pdm-backend builds the package

dev-dependencies = dict[str, list[str]] #

Development-only dependencies

distribution = bool #

ignore_package_warnings = list[str] #

options = OptionsTable #

Add parameters to every pdm cli call

plugins = list[str] #

resolution = ResolutionTable #

Rules governing lockfile resolution

scripts = dict[str, Union[str, UserScript]] #

source = list[SourceTable] #

Repositories where packages may be found

version = VersionTable #

Dynamic Versioning

[tool.pdm.build] #

[tool.pdm.build]

References

https://backend.pdm-project.org/build_config/

Attributes:

Name Type Description
custom-hook str
editable-backend Literal['editables', 'path']
excludes list[str]
includes list[str]
is-purelib bool
package-dir str
run-setuptools bool
source-includes list[str]
wheel-data dict[Literal['data', 'include', 'platinclude', 'platlib', 'purelib', 'scripts'], dict[Literal['path', 'relative-to'], str]]

custom-hook = str #

editable-backend = Literal['editables', 'path'] #

excludes = list[str] #

includes = list[str] #

is-purelib = bool #

package-dir = str #

run-setuptools = bool #

source-includes = list[str] #

wheel-data = dict[Literal['data', 'include', 'platinclude', 'platlib', 'purelib', 'scripts'], dict[Literal['path', 'relative-to'], str]] #

[tool.pdm.options] #

[tool.pdm.options]

References

Passing constant arguments to every pdm invocation

Attributes:

Name Type Description
add list[str]
build list[str]
cache list[str]
completion list[str]
config list[str]
export list[str]
fix list[str]
info list[str]
init list[str]
install list[str]
list list[str]
lock list[str]
new list[str]
outdated list[str]
publish list[str]
python list[str]
remove list[str]
run list[str]
search list[str]
self list[str]
show list[str]
sync list[str]
update list[str]
use list[str]
venv list[str]

add instance-attribute #

build instance-attribute #

cache instance-attribute #

completion instance-attribute #

config instance-attribute #

export instance-attribute #

fix instance-attribute #

info instance-attribute #

init instance-attribute #

install instance-attribute #

list instance-attribute #

lock instance-attribute #

new instance-attribute #

outdated instance-attribute #

publish instance-attribute #

python instance-attribute #

remove instance-attribute #

run instance-attribute #

search instance-attribute #

self instance-attribute #

show instance-attribute #

sync instance-attribute #

update instance-attribute #

use instance-attribute #

venv instance-attribute #

[tool.pdm.resolution] #

Attributes:

Name Type Description
allow-prereleases bool
exclude-newer str
excludes list[str]
no-binary Union[str, list[str]]
only-binary Union[str, list[str]]
overrides dict[str, str]
prefer-binary Union[str, list[str]]

allow-prereleases = bool #

exclude-newer = str #

excludes = list[str] #

no-binary = Union[str, list[str]] #

only-binary = Union[str, list[str]] #

overrides = dict[str, str] #

prefer-binary = Union[str, list[str]] #

[tool.pdm.scripts] #

The value of an item within [tool.pdm.scripts] .

An individual script may be a simple string, or a dictionary of this form.

Examples:

1
2
3
4
5
6
7
8
[tool.pdm.scripts]
list-files = "ls ."
start = {cmd = "flask run -p 54321"}
mytask.composite = [
    "echo 'Hello'",
    "echo 'World'"
]
mytask.keep_going = true
References

PDM Scripts

Attributes:

Name Type Description
call str
cmd str
composite list[str]
env dict[str, str]
env_file str | dict[Literal['override'], str]
keep_going bool
shell str
working_dir str

call instance-attribute #

cmd instance-attribute #

composite instance-attribute #

env instance-attribute #

env_file instance-attribute #

keep_going instance-attribute #

shell instance-attribute #

working_dir instance-attribute #

[[tool.pdm.source]] #

A repository where PDM can find packages during lockfile resolution

References

Configure the package indexes

Attributes:

Name Type Description
exclude_packages list[str]
include_packages list[str]
name str
password str
type Literal['index', 'find_links']
url str
username str
verify_ssl bool

exclude_packages instance-attribute #

include_packages instance-attribute #

name instance-attribute #

password instance-attribute #

type instance-attribute #

url instance-attribute #

username instance-attribute #

verify_ssl instance-attribute #

[tool.pdm.version] #

Specify how PDM computes dynamic versions.

References

Dynamic project version

Attributes:

Name Type Description
fallback_version str
getter str
path PathLike[str]
pattern str
source Literal['call', 'file', 'scm']
tag_filter str
tag_regex str
version_format str
write_template str
write_to str

fallback_version instance-attribute #

getter instance-attribute #

path instance-attribute #

pattern instance-attribute #

source instance-attribute #

tag_filter instance-attribute #

tag_regex instance-attribute #

version_format instance-attribute #

write_template instance-attribute #

write_to instance-attribute #