Skip to content

Commit fbe653d

Browse files
committed
packaging: convert to hatch
1 parent f4d2a00 commit fbe653d

File tree

6 files changed

+63
-78
lines changed

6 files changed

+63
-78
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
11
on:
22
- workflow_dispatch
33

4-
name: Release packages
4+
name: Release Packages
55

66
jobs:
77
build:
88
name: Create the package
99
runs-on: ubuntu-latest
1010
environment: github_release
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313

14-
- uses: actions/setup-python@v2
14+
- uses: actions/setup-python@v4
1515
with:
16-
python-version: 3.9
16+
python-version: "3.11"
1717

18-
- id: sdist
19-
run: python setup.py sdist
18+
- id: build
19+
run: pip install hatch==1.6.3 && hatch build
2020

2121
- id: version
2222
run: |
23-
printf "::set-output name=version::%s\n" $(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'])")
24-
printf "::set-output name=versiondash::%s\n" $(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'].replace('.', '-'))")
23+
version=$(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'])")
24+
versiondash=$(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'].replace('.', '-'))")
2525
26-
- id: package
27-
run: >
28-
printf "::set-output name=package::alt_pytest_asyncio-${{ steps.version.outputs.version}}.tar.gz"
29-
30-
- id: create_release
31-
uses: actions/create-release@v1
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
echo "version=$version" >> $GITHUB_OUTPUT
27+
echo "versiondash=$versiondash" >> $GITHUB_OUTPUT
3428
29+
- id: create-release
30+
uses: softprops/action-gh-release@v1
3531
with:
32+
name: alt_pytest_asyncio ${{ steps.version.outputs.version }}
33+
body: "https://github.com/delfick/python-alt_pytest_asyncio#release-${{ steps.version.outputs.versiondash }}"
3634
tag_name: "release-${{ steps.version.outputs.version }}"
37-
release_name: alt_pytest_asyncio ${{ steps.version.outputs.version }}
38-
body: "https://github.com/delfick/alt-pytest-asyncio#release-${{ steps.version.outputs.versiondash }}"
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
fail_on_unmatched_files: true
3937
draft: false
4038
prerelease: false
41-
42-
- id: upload-release-asset
43-
uses: actions/upload-release-asset@v1
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
upload_url: ${{ steps.create_release.outputs.upload_url }}
48-
asset_path: "dist/${{ steps.package.outputs.package }}"
49-
asset_name: ${{ steps.package.outputs.package }}
50-
asset_content_type: application/tar+gzip
39+
files: "dist/*"
5140

5241
- uses: pypa/[email protected]
5342
with:

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Changelog
2323

2424
0.7.0 - TBD
2525
* Changed the pytest dependency to be greater than pytest version 7
26+
* Using isort now
27+
* Went from setuptools to hatch
2628

2729
0.6.0 - 23 October 2021
2830
* Fix bug where it was possible for an async generator fixture to

find

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1111
--ignore-directory .mypy_cache \
1212
--ignore-directory dist \
1313
--ignore-directory build \
14-
--ignore-directory alt_pytest_asyncio.egg-info \
1514
--ignore-directory tools \
1615
)

pyproject.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "alt-pytest-asyncio"
7+
dynamic = ["version"]
8+
description = "Alternative pytest plugin to pytest-asyncio"
9+
readme = "README.rst"
10+
license = "MIT"
11+
requires-python = ">= 3.7"
12+
authors = [
13+
{ name = "Stephen Moore", email = "[email protected]" },
14+
]
15+
classifiers = [
16+
"Framework :: Pytest",
17+
"Topic :: Software Development :: Testing",
18+
]
19+
dependencies = [
20+
"pytest >= 7.0.0",
21+
]
22+
23+
[project.optional-dependencies]
24+
tests = [
25+
"nest-asyncio==1.0.0",
26+
"noseOfYeti[black]==2.4.1",
27+
"pytest==7.3.0",
28+
]
29+
30+
[project.entry-points.pytest11]
31+
alt_pytest_asyncio = "alt_pytest_asyncio"
32+
33+
[project.urls]
34+
Homepage = "https://github.com/delfick/alt-pytest-asyncio"
35+
36+
[tool.hatch.version]
37+
path = "alt_pytest_asyncio/version.py"
38+
39+
[tool.hatch.build.targets.sdist]
40+
include = [
41+
"/alt_pytest_asyncio",
42+
]
43+
144
[tool.black]
245
line-length = 100
346
include = '\.py$'

setup.py

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

tools/requirements.dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ pylsp-mypy==0.6.6
88
pyls-isort==0.2.2
99
python-lsp-black==1.2.1
1010
mslex==0.3.0; sys.platform == 'win32'
11+
hatch==1.7.0

0 commit comments

Comments
 (0)