Skip to content

Commit 9ac9f07

Browse files
authored
Adopt PEP-621 packaging (#9)
1 parent e543ef8 commit 9ac9f07

13 files changed

+87
-113
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
- name: Check out src from Git
2727
uses: actions/checkout@v3
2828
with:
29-
fetch-depth: 0 # needed by setuptools-scm
29+
fetch-depth: 0 # needed by setuptools-scm
3030
- name: Build dists
3131
run: python -m tox
3232
- name: Publish to pypi.org
33-
if: >- # "create" workflows run separately from "push" & "pull_request"
33+
if: >- # "create" workflows run separately from "push" & "pull_request"
3434
github.event_name == 'release'
3535
uses: pypa/gh-action-pypi-publish@release/v1
3636
with:

.github/workflows/tox.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
PYTEST_REQPASS: 1
4949

5050
steps:
51-
5251
- uses: actions/checkout@v3
5352
with:
5453
fetch-depth: 0 # needed by setuptools-scm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
src/pytest_plus/_version.py

.pre-commit-config.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ ci:
33
exclude:
44
- pip-tools
55
repos:
6+
- repo: meta
7+
hooks:
8+
- id: check-useless-excludes
9+
- repo: https://github.com/pre-commit/mirrors-prettier
10+
# keep it before yamllint
11+
rev: v3.0.0-alpha.4
12+
hooks:
13+
- id: prettier
14+
always_run: true
15+
additional_dependencies:
16+
- prettier
17+
- prettier-plugin-toml
18+
- prettier-plugin-sort-json
619
- repo: https://github.com/PyCQA/doc8.git
720
rev: v1.1.0
821
hooks:
@@ -51,15 +64,15 @@ repos:
5164
rev: 6.12.1
5265
hooks:
5366
- id: pip-compile
54-
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core
67+
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra test --strip-extras
5568
language: python
5669
files: ^(requirements\.txt|pyproject\.toml)$
5770
alias: deps
5871
language_version: "3.9" # minimal we support officially
5972
additional_dependencies:
6073
- pip>=22.3.1
6174
- id: pip-compile
62-
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core --upgrade
75+
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra test --strip-extras --upgrade
6376
language: python
6477
files: ^(requirements\.txt|pyproject\.toml)$
6578
alias: up

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
This plugin aims to be used to host multiple basic pytest extensions that meet
99
the following criteria:
1010

11-
* Keep py36 compatibility
12-
* Downgrade gracefully, meaning that if the plugin is removed, you will still
11+
- Keep py36 compatibility
12+
- Downgrade gracefully, meaning that if the plugin is removed, you will still
1313
be able to run pytest
1414

1515
## PYTEST_REQPASS
@@ -20,7 +20,7 @@ not exactly 123, pytest will return exit code 1.
2020

2121
This feature is aimed for CI usage in order to prevent accidental skipping of
2222
some tests. We do expect users to define this variable within their own CI job
23-
definitions. The number of tests executed is likely to be dependent on the CI
23+
definitions. The number of tests executed is likely to be dependent on the CI
2424
job.
2525

2626
We discourage defining this inside places like `tox.ini` because when a
@@ -29,9 +29,9 @@ tests. Also, this feature makes no sense if you try to mention a specific test.
2929

3030
## Links
3131

32-
* [MIT](http://opensource.org/licenses/MIT)
33-
* [file an issue](https://github.com/pytest-dev/pytest-plus/issues)
34-
* [pytest](https://github.com/pytest-dev/pytest)
35-
* [tox](https://tox.readthedocs.io/en/latest/)
36-
* [pip](https://pypi.org/project/pip/)
37-
* [PyPI](https://pypi.org/project)
32+
- [MIT](http://opensource.org/licenses/MIT)
33+
- [file an issue](https://github.com/pytest-dev/pytest-plus/issues)
34+
- [pytest](https://github.com/pytest-dev/pytest)
35+
- [tox](https://tox.readthedocs.io/en/latest/)
36+
- [pip](https://pypi.org/project/pip/)
37+
- [PyPI](https://pypi.org/project)

pyproject.toml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,62 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 41.0.0",
4-
"setuptools_scm >= 1.15.0",
5-
"setuptools_scm_git_archive >= 1.0",
6-
"wheel",
3+
"setuptools >= 63.0.0", # required by pyproject+setuptools_scm integration
4+
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme
5+
76
]
87
build-backend = "setuptools.build_meta"
8+
9+
[project]
10+
# https://peps.python.org/pep-0621/#readme
11+
requires-python = ">=3.8"
12+
dynamic = ["version"]
13+
name = "pytest-plus"
14+
description = "PyTest Plus Plugin :: extends pytest functionality"
15+
readme = "README.md"
16+
authors = [{ "name" = "Sorin Sbarnea", "email" = "[email protected]" }]
17+
maintainers = [
18+
{ "name" = "Sorin Sbarnea", "email" = "[email protected]" }
19+
]
20+
license = { text = "MIT" }
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
"Environment :: Console",
24+
"Framework :: Pytest",
25+
"Intended Audience :: Developers",
26+
"Intended Audience :: Information Technology",
27+
"Intended Audience :: System Administrators",
28+
"License :: OSI Approved :: MIT License",
29+
"Natural Language :: English",
30+
"Operating System :: OS Independent",
31+
"Programming Language :: Python :: 3 :: Only",
32+
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
35+
"Programming Language :: Python :: 3.8",
36+
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python",
38+
"Topic :: Software Development :: Quality Assurance",
39+
"Topic :: Software Development :: Testing",
40+
"Topic :: System :: Systems Administration",
41+
"Topic :: Utilities",
42+
]
43+
keywords = ["testing", "pytest", "plugin"]
44+
dependencies = ["pytest>=6.0.1", "more_itertools>=8.4.0"]
45+
46+
[project.urls]
47+
homepage = "https://github.com/pytest-dev/pytest-plus"
48+
repository = "https://github.com/pytest-dev/pytest-plus"
49+
changelog = "https://github.com/pytest-dev/pytest-plus/releases"
50+
51+
[project.optional-dependencies]
52+
test = ["coverage>=7.0.0", "pytest-html"]
53+
54+
[project.entry-points.pytest11]
55+
plus = "pytest_plus"
56+
57+
[tool.pytest.ini_options]
58+
addopts = "-p no:flaky"
59+
60+
[tool.setuptools_scm]
61+
local_scheme = "no-local-version"
62+
write_to = "src/pytest_plus/_version.py"

pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras --unsafe-package=ansible-core pyproject.toml
5+
# pip-compile --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras pyproject.toml
66
#
77
attrs==22.1.0
88
coverage==7.0.0

setup.cfg

Lines changed: 0 additions & 78 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.
File renamed without changes.

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For more information about tox, see https://tox.readthedocs.io/en/latest/
22
[tox]
3-
minversion = 3.9.0
3+
minversion = 4.0
44
envlist =
55
lint
66
py
@@ -83,7 +83,5 @@ commands =
8383
pre-commit run --all-files --show-diff-on-failure --hook-stage manual schemas
8484
# Update pre-commit hooks
8585
pre-commit autoupdate
86-
# Update npm deps
87-
bash -c "cd src/schemas && npm run deps"
8886
# We fail if files are modified at the end
8987
git diff --exit-code

0 commit comments

Comments
 (0)