Skip to content

Commit b94d206

Browse files
authored
Adopt PEP-621 for packaging (#65)
1 parent e1e2d4c commit b94d206

File tree

7 files changed

+81
-45
lines changed

7 files changed

+81
-45
lines changed

.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E203, E231, E501, E722, W503, B950
3+
select = C,E,F,W,B,B9,I

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
python -m pip install --upgrade pip
4040
pip install tox tox-gh-actions
4141
42+
- name: Test packaging
43+
run: tox -e pkg
44+
4245
- name: Run tests with PyTest 4
4346
run: tox
4447
if: ${{ matrix.python-version != '3.10' }}

MANIFEST.in

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
include *.py
2-
include LICENSE
2+
include *.txt
3+
include *.yaml
4+
include .flake8
5+
include .pre-commit-config.yaml
36
include CHANGELOG.md
7+
include LICENSE
48
include tox.ini

pyproject.toml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 64.0.0", # required by pyproject+setuptools_scm integration
4+
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme
5+
6+
]
7+
build-backend = "setuptools.build_meta"
8+
9+
[project]
10+
# https://peps.python.org/pep-0621/#readme
11+
requires-python = ">=3.7"
12+
version = "0.1.8"
13+
name = "pytest-github-actions-annotate-failures"
14+
description = "pytest plugin to annotate failed tests with a workflow command for GitHub Actions"
15+
readme = "README.md"
16+
authors = [{ "name" = "utgwkk", "email" = "[email protected]" }]
17+
maintainers = [{ "name" = "utgwkk", "email" = "[email protected]" }]
18+
license = { text = "MIT" }
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Console",
22+
"Intended Audience :: Developers",
23+
"Intended Audience :: Information Technology",
24+
"Intended Audience :: System Administrators",
25+
"License :: OSI Approved :: MIT License",
26+
"Framework :: Pytest",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3 :: Only",
34+
"Programming Language :: Python",
35+
"Topic :: System :: Systems Administration",
36+
"Topic :: Software Development :: Quality Assurance",
37+
"Topic :: Software Development :: Testing",
38+
"Topic :: Utilities",
39+
]
40+
keywords = ["ansible", "testing", "molecule", "plugin"]
41+
dependencies = [
42+
"pytest>=4.0.0"
43+
]
44+
45+
[project.urls]
46+
homepage = "https://github.com/pytest-dev/pytest-github-actions-annotate-failures"
47+
repository = "https://github.com/pytest-dev/pytest-github-actions-annotate-failures"
48+
changelog = "https://github.com/pytest-dev/pytest-github-actions-annotate-failures/releases"
49+
50+
[project.entry-points.pytest11]
51+
pytest_github_actions_annotate_failures = "pytest_github_actions_annotate_failures.plugin"

setup.cfg

-12
This file was deleted.

setup.py

-31
This file was deleted.

tox.ini

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[tox]
2-
envlist = py27-pytest4-{linux,windows}, py{36,37,38,39}-pytest{4,5,6,7}-{linux,windows}, py{310}-pytest{6,7}-{linux,windows}
2+
envlist =
3+
py27-pytest4-{linux,windows}
4+
py{36,37,38,39}-pytest{4,5,6,7}-{linux,windows}
5+
py{310}-pytest{6,7}-{linux,windows}
6+
pkg
37

48
[gh-actions]
59
python =
@@ -28,3 +32,17 @@ deps =
2832
pytest7: pytest>=7.0.0,<8.0.0
2933

3034
commands = {envpython} -m pytest
35+
36+
[testenv:pkg]
37+
skip_install = true
38+
deps =
39+
twine
40+
build
41+
commands =
42+
{envpython} -c 'import os.path, shutil, sys; \
43+
dist_dir = os.path.join("{toxinidir}", "dist"); \
44+
os.path.isdir(dist_dir) or sys.exit(0); \
45+
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
46+
shutil.rmtree(dist_dir)'
47+
{envpython} -m build --outdir {toxinidir}/dist/ {toxinidir}
48+
{envpython} -m twine check --strict dist/*

0 commit comments

Comments
 (0)