Skip to content

Commit

Permalink
setup.py removal (#72)
Browse files Browse the repository at this point in the history
* simplify build and release
* setup.py -> pyproject.toml
  • Loading branch information
okken authored Oct 9, 2023
1 parent 394cf77 commit aa26ab6
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 46 deletions.
8 changes: 8 additions & 0 deletions .github/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Here are the steps on how to make a new release.

1. Create a `release-VERSION` branch from `upstream/main`.
2. Update `CHANGELOG.rst`.
3. Push the branch to `upstream`.
4. Once all tests pass, merge the PR.
5. Once the PR completes, create a Release with a new version tag on GitHub.
Version should be in the form of "vx.y.z". ex: v0.9.2
41 changes: 41 additions & 0 deletions .github/workflows/pypi-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Build & maybe upload PyPI package

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v1

# Upload to real PyPI on GitHub Releases.
release-pypi:
name: Publish released package to pypi.org
environment: release-pypi
if: github.repository_owner == 'pytest-dev' && github.event.action == 'published'
runs-on: ubuntu-latest
needs: build-package

steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

46 changes: 44 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
[project]
name = "pytest-repeat"
description = "pytest plugin for repeating tests"
readme = "README.rst"
license = {file = "LICENSE"}
authors = [{name = "Bob Silverberg"}]
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
dynamic = [ "version" ]
dependencies = [ "pytest" ]

[project.urls]
Home = "https://github.com/pytest-dev/pytest-repeat"

[project.entry-points.pytest11]
repeat = "pytest_repeat"



[build-system]
requires = ["setuptools>=40.8.0", "wheel", "setuptools_scm"]
build-backend = 'setuptools.build_meta'
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

2 changes: 1 addition & 1 deletion pytest_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UnexpectedError(Exception):
pass


@pytest.fixture
@pytest.fixture()
def __pytest_repeat_step_number(request):
marker = request.node.get_closest_marker("repeat")
count = marker and marker.args[0] or request.config.option.count
Expand Down
36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
minversion = 3.4.0
minversion = 4.0
isolated_build = true
envlist =
py{37,38,39,310,311,312,py3}-pytest7
py37-pytest{4,5,6}
flake8


[testenv]
commands = pytest {posargs}
package = wheel
wheel_build_env = .pkg
deps =
pytest4: pytest~=4.6
pytest5: pytest~=5.4
pytest6: pytest~=6.2
pytest7: pytest>=7


[testenv:flake8]
basepython = py311
deps = flake8
Expand Down

0 comments on commit aa26ab6

Please sign in to comment.