Skip to content

Commit 142bd4a

Browse files
authored
chore: Migrate from Poetry to Hatch (#617)
1 parent aa9c529 commit 142bd4a

File tree

9 files changed

+169
-217
lines changed

9 files changed

+169
-217
lines changed

.github/workflows/actions.yml

-105
This file was deleted.

.github/workflows/nightly.yml

-10
This file was deleted.

.github/workflows/publish.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
8+
9+
jobs:
10+
publish:
11+
if: github.repository == 'pytest-dev/pytest-html'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: false
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '16.x'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build app.js
28+
run: npm run build:ci
29+
30+
- name: Build and Check Package
31+
uses: hynek/build-and-inspect-python-package@v1
32+
33+
- name: Download Package
34+
uses: actions/download-artifact@v3
35+
with:
36+
name: Packages
37+
path: dist
38+
39+
- name: Publish package to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
password: ${{ secrets.pypi_password }}

.github/workflows/tests.yml

+53-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,62 @@
11
name: Tests
22

33
on:
4-
workflow_call:
4+
push:
5+
branches:
6+
- master
7+
8+
schedule:
9+
- cron: '1 0 * * *' # Run daily at 0:01 UTC
10+
11+
pull_request:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
516

617
jobs:
18+
build_docs:
19+
name: Build Docs
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Install tox
30+
run: python -m pip install --upgrade tox
31+
32+
- name: Build docs with tox
33+
run: tox -e docs
34+
35+
build_package:
36+
name: Build Package
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
with:
41+
fetch-depth: 0
42+
persist-credentials: false
43+
44+
- name: Use Node.js
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: '16.x'
48+
49+
- name: Install dependencies
50+
run: npm ci
51+
52+
- name: Build app.js
53+
run: npm run build:ci
54+
55+
- name: Build and Check Package
56+
uses: hynek/build-and-inspect-python-package@v1
57+
758
test_javascript:
8-
name: javascript
59+
name: Run javascript unit tests
960
runs-on: ubuntu-latest
1061
steps:
1162
- uses: actions/checkout@v3

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ docs/_build/
5656
assets/
5757

5858
.nyc_output
59+
60+
.venv/

Gruntfile.js

-9
This file was deleted.

pyproject.toml

+72-50
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,87 @@
11
[build-system]
2-
requires = ["poetry-core>=1.0.0"]
3-
build-backend = "poetry.core.masonry.api"
2+
build-backend = "hatchling.build"
3+
requires = [
4+
"hatch-vcs>=0.3",
5+
"hatchling>=1.13",
6+
]
47

5-
[tool.poetry]
8+
[project]
69
name = "pytest-html"
710
description = "pytest plugin for generating HTML reports"
8-
version = "4.0.0-rc0"
9-
license = "MPL-2.0"
10-
authors = [
11-
"Dave Hunt <[email protected]>",
12-
"Jim Brannlund <[email protected]>"
13-
]
1411
readme = "README.rst"
15-
homepage = "https://github.com/pytest-dev/pytest-html"
16-
repository = "https://github.com/pytest-dev/pytest-html"
12+
license = "MPL-2.0"
13+
requires-python = ">=3.7"
1714
keywords = [
18-
"pytest",
19-
"html",
20-
"report",
15+
"pytest",
16+
"html",
17+
"report",
18+
]
19+
authors = [
20+
{ name = "Dave Hunt", email = "[email protected]" },
21+
{ name = "Jim Brannlund", email = "[email protected]" },
2122
]
2223
classifiers = [
23-
"Development Status :: 5 - Production/Stable",
24-
"Framework :: Pytest",
25-
"Intended Audience :: Developers",
26-
"Operating System :: POSIX",
27-
"Operating System :: Microsoft :: Windows",
28-
"Operating System :: MacOS :: MacOS X",
29-
"Topic :: Software Development :: Quality Assurance",
30-
"Topic :: Software Development :: Testing",
31-
"Topic :: Utilities",
24+
"Development Status :: 5 - Production/Stable",
25+
"Framework :: Pytest",
26+
"Intended Audience :: Developers",
27+
"License :: OSI Approved :: MIT License",
28+
"Natural Language :: English",
29+
"Operating System :: POSIX",
30+
"Operating System :: Microsoft :: Windows",
31+
"Operating System :: MacOS :: MacOS X",
32+
"Programming Language :: Python :: 3.7",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
"Programming Language :: Python :: Implementation :: CPython",
38+
"Programming Language :: Python :: Implementation :: PyPy",
39+
"Topic :: Software Development :: Quality Assurance",
40+
"Topic :: Software Development :: Testing",
41+
"Topic :: Utilities",
3242
]
33-
packages = [
34-
{ include = "pytest_html", from = "src" },
43+
dependencies = [
44+
"pytest>=7.0.0",
45+
"pytest-metadata>=2.0.2",
46+
"Jinja2>=3.0.0",
3547
]
36-
include = [
37-
{ path = "testing", format = "sdist" },
38-
{ path = "docs", format = "sdist" },
39-
"src/pytest_html/resources",
40-
"src/pytest_html/resources/app.js",
48+
dynamic = [
49+
"version",
4150
]
4251

43-
[tool.poetry.dependencies]
44-
python = ">=3.7"
45-
pytest = ">=7.0.0"
46-
pytest-metadata = ">=2.0.2"
47-
Jinja2 = ">=3.0.0"
52+
[project.optional-dependencies]
53+
test = [
54+
"assertpy>=1.1",
55+
"beautifulsoup4>=4.11.1",
56+
"black>=22.1.0",
57+
"flake8>=4.0.1",
58+
"pre-commit>=2.17.0",
59+
"pytest-xdist>=2.4.0",
60+
"pytest-mock>=3.7.0",
61+
"selenium>=4.3.0",
62+
"tox>=3.24.5",
63+
]
64+
65+
[project.urls]
66+
Homepage = "https://github.com/pytest-dev/pytest-html"
67+
Tracker = "https://github.com/pytest-dev/pytest-html/issues"
68+
Source = "https://github.com/pytest-dev/pytest-html"
69+
70+
[project.entry-points.pytest11]
71+
env = "pytest_html.plugin"
4872

49-
[tool.poetry.dev-dependencies]
50-
assertpy = ">=1.1"
51-
beautifulsoup4 = ">=4.11.1"
52-
black = ">=22.1.0"
53-
flake8 = ">=4.0.1"
54-
pre-commit = ">=2.17.0"
55-
pytest-xdist = ">=2.4.0"
56-
pytest-mock = ">=3.7.0"
57-
selenium = ">=4.3.0"
58-
tox = ">=3.24.5"
73+
[tool.hatch.version]
74+
source = "vcs"
5975

60-
[tool.poetry.plugins.pytest11]
61-
html = "pytest_html.plugin"
76+
[tool.hatch.build.targets.wheel]
77+
exclude = [
78+
"src/pytest_html/scripts/*",
79+
]
80+
81+
[tool.hatch.build.targets.sdist]
82+
exclude = [
83+
"/.github",
84+
]
6285

63-
[tool.setuptools_scm]
64-
local_scheme = "no-local-version"
65-
write_to = "src/pytest_html/__version.py"
86+
[tool.hatch.build.hooks.vcs]
87+
version-file = "src/pytest_html/__version.py"

setup.cfg

-2
This file was deleted.

0 commit comments

Comments
 (0)