Skip to content

Instantly share code, notes, and snippets.

@genadyp
Created June 9, 2021 12:20
Show Gist options
  • Select an option

  • Save genadyp/325bd56b59281121d342c2ac3ddf813f to your computer and use it in GitHub Desktop.

Select an option

Save genadyp/325bd56b59281121d342c2ac3ddf813f to your computer and use it in GitHub Desktop.
pyproject
# https://github.com/Pylons/pyramid/blob/master/pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 79
skip-string-normalization = true
py36 = false
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| \.pytest_cache
| dist
| build
| docs
)/
'''
# This next section only exists for people that have their editors
# automatically call isort.
[tool.isort]
profile = "black"
multi_line_output = 3
src_paths = ["src", "tests"]
skip_glob = ["docs/*"]
include_trailing_comma = true
force_grid_wrap = false
combine_as_imports = true
line_length = 79
force_sort_within_sections = true
no_lines_before = "THIRDPARTY"
sections = "FUTURE,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
default_section = "THIRDPARTY"
known_first_party = "pyramid"
@genadyp

genadyp commented Jun 29, 2021

Copy link
Copy Markdown
Author

link

[project]
# PEP 621 project metadata
# See https://www.python.org/dev/peps/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",
    "click>=7",
    "distlib>=0.3.1",
    "importlib-metadata; python_version < \"3.8\"",
    "pdm-pep517<0.8.0,>=0.7.0",
    "pep517",
    "pip>=20.1",
    "python-cfonts",
    "python-dotenv<1.0.0,>=0.15.0",
    "pythonfinder",
    "resolvelib>=0.7.0,<0.8.0",
    "shellingham<2.0.0,>=1.3.2",
    "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]

[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

[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"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment