Skip to content

Commit

Permalink
Adopt PEP-621 for packaging (#1763)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 11, 2022
1 parent 9aed54f commit ba59404
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 122 deletions.
15 changes: 15 additions & 0 deletions .flake8
@@ -0,0 +1,15 @@
[flake8]
max-line-length = 100
# E203 conflicts with PEP8; see https://github.com/psf/black#slices
extend-ignore = E203

# flake8-pytest-style
# PT001:
pytest-fixture-no-parentheses = true
# PT006:
pytest-parametrize-names-type = tuple
# PT007:
pytest-parametrize-values-type = tuple
pytest-parametrize-values-row-type = tuple
# PT023:
pytest-mark-no-parentheses = true
116 changes: 115 additions & 1 deletion pyproject.toml
@@ -1,5 +1,119 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=63", "setuptools_scm[toml]>=7"]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.7"
dynamic = ["version"]
name = "pip-tools"
description = "pip-tools keeps your pinned dependencies fresh."
readme = "README.rst"
authors = [{ "name" = "Vincent Driessen", "email" = "me@nvie.com" }]
license = { text = "BSD" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
"Typing :: Typed",
]
keywords = ["pip", "requirements", "packaging"]
dependencies = [
# direct dependencies
"build",
"click >= 8",
"pip >= 22.2",
# indirect dependencies
"setuptools", # typically needed when pip-tools invokes setup.py
"wheel", # pip plugin needed by pip-tools
]

[project.urls]
homepage = "https://github.com/jazzband/pip-tools/"
documentation = "https://pip-tools.readthedocs.io/en/latest/"
repository = "https://github.com/jazzband/pip-tools"
changelog = "https://github.com/jazzband/pip-tools/releases"

[project.optional-dependencies]
testing = [
"pytest >= 7.2.0",
"pytest-rerunfailures",
"pytest-xdist",
# build deps for tests
"flit_core >=2,<4",
"poetry_core>=1.0.0",
]
coverage = [
"pytest-cov",
]

[project.scripts]
pip-compile = "piptools.scripts.compile:cli"
pip-sync = "piptools.scripts.sync:cli"

[tool.isort]
profile = "black"
add_imports = "from __future__ import annotations"

[tool.mypy]
disallow_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
ignore_missing_imports = true
no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

# Avoid error: Duplicate module named 'setup'
# https://github.com/python/mypy/issues/4008
exclude = "^tests/test_data/"

[tool.mypy.overrides]
modules = [
"tests.*"
]
disallow_untyped_defs = false

[tool.pytest.ini_options]
addopts = [
# `pytest-xdist`:
"--numprocesses=auto"
]
norecursedirs = ".* build dist venv test_data piptools/_compat/*"
testpaths = "tests piptools"
filterwarnings = [
"always"
]
markers = [
"network: mark tests that require internet access"
]

[tool.setuptools.packages.find]
# needed only because we did not adopt src layout yet
exclude = ["img"]

[tool.setuptools_scm]
115 changes: 0 additions & 115 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -45,7 +45,7 @@ deps =
commands_pre =
commands =
python -m build --outdir {envtmpdir} --sdist {toxinidir}
twine check {envtmpdir}{/}*
twine check --strict {envtmpdir}{/}*
skip_install = true

[testenv:build-docs]
Expand Down

0 comments on commit ba59404

Please sign in to comment.