Skip to content

Commit

Permalink
chore: Migrate from Poetry to Hatch (pytest-dev#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil committed Apr 3, 2023
1 parent 60c827e commit 72ea35b
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 216 deletions.
105 changes: 0 additions & 105 deletions .github/workflows/actions.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/nightly.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
publish:
if: github.repository == 'pytest-dev/pytest-html'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install dependencies
run: npm ci

- name: Build app.js
run: npm run build:ci

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1

- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
55 changes: 53 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
name: Tests

on:
workflow_call:
push:
branches:
- master

schedule:
- cron: '1 0 * * *' # Run daily at 0:01 UTC

pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_docs:
name: Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install tox
run: python -m pip install --upgrade tox

- name: Build docs with tox
run: tox -e docs

build_package:
name: Build Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install dependencies
run: npm ci

- name: Build app.js
run: npm run build:ci

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1

test_javascript:
name: javascript
name: Run javascript unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ docs/_build/
assets/

.nyc_output

.venv/
9 changes: 0 additions & 9 deletions Gruntfile.js

This file was deleted.

122 changes: 72 additions & 50 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,65 +1,87 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.3",
"hatchling>=1.13",
]

[tool.poetry]
[project]
name = "pytest-html"
description = "pytest plugin for generating HTML reports"
version = "4.0.0-rc0"
license = "MPL-2.0"
authors = [
"Dave Hunt <dhunt@mozilla.com>",
"Jim Brannlund <jimbrannlund@fastmail.com>"
]
readme = "README.rst"
homepage = "https://github.com/pytest-dev/pytest-html"
repository = "https://github.com/pytest-dev/pytest-html"
license = "MPL-2.0"
requires-python = ">=3.7"
keywords = [
"pytest",
"html",
"report",
"pytest",
"html",
"report",
]
authors = [
{ name = "Dave Hunt", email = "dhunt@mozilla.com" },
{ name = "Jim Brannlund", email = "jimbrannlund@fastmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
packages = [
{ include = "pytest_html", from = "src" },
dependencies = [
"pytest>=7.0.0",
"pytest-metadata>=2.0.2",
"Jinja2>=3.0.0",
]
include = [
{ path = "testing", format = "sdist" },
{ path = "docs", format = "sdist" },
"src/pytest_html/resources",
"src/pytest_html/resources/app.js",
dynamic = [
"version",
]

[tool.poetry.dependencies]
python = ">=3.7"
pytest = ">=7.0.0"
pytest-metadata = ">=2.0.2"
Jinja2 = ">=3.0.0"
[project.optional-dependencies]
test = [
"assertpy>=1.1",
"beautifulsoup4>=4.11.1",
"black>=22.1.0",
"flake8>=4.0.1",
"pre-commit>=2.17.0",
"pytest-xdist>=2.4.0",
"pytest-mock>=3.7.0",
"selenium>=4.3.0",
"tox>=3.24.5",
]

[project.urls]
Homepage = "https://github.com/pytest-dev/pytest-html"
Tracker = "https://github.com/pytest-dev/pytest-html/issues"
Source = "https://github.com/pytest-dev/pytest-html"

[project.entry-points.pytest11]
env = "pytest_html.plugin"

[tool.poetry.dev-dependencies]
assertpy = ">=1.1"
beautifulsoup4 = ">=4.11.1"
black = ">=22.1.0"
flake8 = ">=4.0.1"
pre-commit = ">=2.17.0"
pytest-xdist = ">=2.4.0"
pytest-mock = ">=3.7.0"
selenium = ">=4.3.0"
tox = ">=3.24.5"
[tool.hatch.version]
source = "vcs"

[tool.poetry.plugins.pytest11]
html = "pytest_html.plugin"
[tool.hatch.build.targets.wheel]
exclude = [
"src/pytest_html/scripts/*",
]

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
]

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/pytest_html/__version.py"
[tool.hatch.build.hooks.vcs]
version-file = "src/pytest_html/__version.py"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit 72ea35b

Please sign in to comment.