Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt PEP-621 for packaging #1763

Merged
merged 2 commits into from
Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder is there any decent pyproject.toml formatter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, prettier, i will configure it after this gets in.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Original file line number Diff line number Diff line change
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