[project]
# PEP 621 project metadata
# See https://peps.python.org/pep-0621/
authors = [
    {name = "frostming", email = "mianghong@gmail.com"},
]
dynamic = ["version", "classifiers"]
version = {use_scm = true}
requires-python = ">=3.7"
license = {text = "MIT"}
dependencies = [
    "appdirs",
    "atoml>=1.0.3",
    "click>=7",
    "importlib-metadata; python_version < \"3.8\"",
    "installer~=0.3.0",
    "packaging",
    "pdm-pep517>=0.8.3,<0.9",
    "pep517>=0.11.0",
    "pip>=20.1",
    "python-dotenv~=0.15",
    "pythonfinder",
    "resolvelib>=0.7.0,<0.8.0",
    "shellingham<2.0.0,>=1.3.2",
    "tomli>=1.1.0,<2.0.0",
    "typing-extensions; python_version < \"3.8\"",
    "wheel<1.0.0,>=0.36.2",
]
name = "pdm"
description = "Python Development Master"
readme = "README.md"
keywords = ["packaging", "dependency", "workflow"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Topic :: Software Development :: Build Tools",
]

[project.urls]
homepage = "https://pdm.fming.dev"
Repository = "https://github.com/pdm-project/pdm"
Documentation = "https://pdm.fming.dev"

[project.optional-dependencies]

[project.scripts]
pdm = "pdm.core:main"

[tool.pdm]
includes = ["pdm"]
source-includes = ["tests"]
# editables backend doesn't work well with namespace packages
editable-backend = "path"

[tool.pdm.scripts]
release = "python tasks/release.py"
test = "pytest tests/"
doc = {shell = "cd docs && mkdocs serve", help = "Start the dev server for doc preview"}
lint = "pre-commit run --all-files"
complete = {call = "tasks.complete:main"}

[tool.pdm.dev-dependencies]
test = [
    "pytest",
    "pytest-cov",
    "pytest-mock",
    "pytest-xdist<2.0.0,>=1.31.0"
]
doc = [
    "mkdocs<2.0.0,>=1.1",
    "mkdocs-material<7.0.0,>=6.2.4",
    "markdown-include<1.0.0,>=0.5.1"
]
workflow = [
    "parver<1.0.0,>=0.3.1",
    "towncrier<20.0.0,>=19.2.0",
    "vendoring; python_version ~= \"3.8\"",
    "mypy~=0.812",
    "pycomplete~=0.3"
]

[tool.black]
line-length = 88
exclude = '''
/(
    \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
  | pdm/_vendor
  | tests/fixtures
)/
'''

[tool.towncrier]
package = "pdm"
filename = "CHANGELOG.md"
issue_format = "[#{issue}](https://github.com/pdm-project/pdm/issues/{issue})"
directory = "news/"
title_format = "Release v{version} ({project_date})"
template = "news/towncrier_template.md"
underlines = "-~^"

  [[tool.towncrier.type]]
  directory = "feature"
  name = "Features & Improvements"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "bugfix"
  name = "Bug Fixes"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "doc"
  name = "Improved Documentation"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "dep"
  name = "Dependencies"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "removal"
  name = "Removals and Deprecations"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "misc"
  name = "Miscellany"
  showcontent = true

  [[tool.towncrier.type]]
  directory = "refactor"
  name = "Refactor"
  showcontent = true

[build-system]
requires = ["pdm-pep517>=0.3.0"]
build-backend = "pdm.pep517.api"

[tool.isort]
profile = "black"
atomic = true
skip_glob = ["*/setup.py", "pdm/_vendor/*"]
filter_files = true
known_first_party = ["pdm"]
known_third_party = [
    "appdirs",
    "atoml",
    "click",
    "cfonts",
    "distlib",
    "halo",
    "packaging",
    "pip_shims",
    "pytest",
    "pythonfinder"
]

[tool.vendoring]
destination = "pdm/_vendor/"
requirements = "pdm/_vendor/vendors.txt"
namespace = "pdm._vendor"

protected-files = ["__init__.py", "README.md", "vendors.txt"]
patches-dir = "tasks/patches"

[tool.vendoring.transformations]
substitute = [
  {match = 'import halo\.', replace = 'import pdm._vendor.halo.'}
]
drop = [
    "bin/",
    "*.so",
    "typing.*",
    "*/tests/"
]

[tool.vendoring.typing-stubs]
halo = []
log_symbols = []
spinners = []
termcolor = []
colorama = []

[tool.vendoring.license.directories]

[tool.vendoring.license.fallback-urls]

[tool.pytest.ini_options]
filterwarnings = [
  "ignore::DeprecationWarning"
]
markers = [
    "pypi: Tests that connect to the real PyPI",
    "integration: Run with all Python versions"
]
addopts = "-ra"
