Skip to content

Commit aa26ab6

Browse files
authored
setup.py removal (#72)
* simplify build and release * setup.py -> pyproject.toml
1 parent 394cf77 commit aa26ab6

File tree

7 files changed

+99
-46
lines changed

7 files changed

+99
-46
lines changed

.github/RELEASING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Here are the steps on how to make a new release.
2+
3+
1. Create a `release-VERSION` branch from `upstream/main`.
4+
2. Update `CHANGELOG.rst`.
5+
3. Push the branch to `upstream`.
6+
4. Once all tests pass, merge the PR.
7+
5. Once the PR completes, create a Release with a new version tag on GitHub.
8+
Version should be in the form of "vx.y.z". ex: v0.9.2

.github/workflows/pypi-package.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Build & maybe upload PyPI package
3+
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
build-package:
15+
name: Build & verify package
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: hynek/build-and-inspect-python-package@v1
24+
25+
# Upload to real PyPI on GitHub Releases.
26+
release-pypi:
27+
name: Publish released package to pypi.org
28+
environment: release-pypi
29+
if: github.repository_owner == 'pytest-dev' && github.event.action == 'published'
30+
runs-on: ubuntu-latest
31+
needs: build-package
32+
33+
steps:
34+
- name: Download packages built by build-and-inspect-python-package
35+
uses: actions/download-artifact@v3
36+
with:
37+
name: Packages
38+
path: dist
39+
40+
- name: Upload package to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
[project]
2+
name = "pytest-repeat"
3+
description = "pytest plugin for repeating tests"
4+
readme = "README.rst"
5+
license = {file = "LICENSE"}
6+
authors = [{name = "Bob Silverberg"}]
7+
requires-python = ">=3.7"
8+
classifiers = [
9+
"Development Status :: 5 - Production/Stable",
10+
"Framework :: Pytest",
11+
"Intended Audience :: Developers",
12+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
13+
"Operating System :: MacOS :: MacOS X",
14+
"Operating System :: Microsoft :: Windows",
15+
"Operating System :: POSIX",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3 :: Only",
18+
"Programming Language :: Python :: 3.7",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Topic :: Software Development :: Quality Assurance",
25+
"Topic :: Software Development :: Testing",
26+
"Topic :: Utilities",
27+
]
28+
dynamic = [ "version" ]
29+
dependencies = [ "pytest" ]
30+
31+
[project.urls]
32+
Home = "https://github.com/pytest-dev/pytest-repeat"
33+
34+
[project.entry-points.pytest11]
35+
repeat = "pytest_repeat"
36+
37+
38+
139
[build-system]
2-
requires = ["setuptools>=40.8.0", "wheel", "setuptools_scm"]
3-
build-backend = 'setuptools.build_meta'
40+
requires = ["hatchling", "hatch-vcs"]
41+
build-backend = "hatchling.build"
42+
43+
[tool.hatch.version]
44+
source = "vcs"
45+

pytest_repeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class UnexpectedError(Exception):
3434
pass
3535

3636

37-
@pytest.fixture
37+
@pytest.fixture()
3838
def __pytest_repeat_step_number(request):
3939
marker = request.node.get_closest_marker("repeat")
4040
count = marker and marker.args[0] or request.config.option.count

setup.py

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

tox.ini

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
# Tox (https://tox.readthedocs.io/) is a tool for running tests
2-
# in multiple virtualenvs. This configuration file will run the
3-
# test suite on all supported python versions. To use it, "pip install tox"
4-
# and then run "tox" from this directory.
5-
61
[tox]
7-
minversion = 3.4.0
2+
minversion = 4.0
83
isolated_build = true
94
envlist =
105
py{37,38,39,310,311,312,py3}-pytest7
116
py37-pytest{4,5,6}
127
flake8
138

9+
1410
[testenv]
1511
commands = pytest {posargs}
12+
package = wheel
13+
wheel_build_env = .pkg
1614
deps =
1715
pytest4: pytest~=4.6
1816
pytest5: pytest~=5.4
1917
pytest6: pytest~=6.2
2018
pytest7: pytest>=7
2119

20+
2221
[testenv:flake8]
2322
basepython = py311
2423
deps = flake8

0 commit comments

Comments
 (0)