Skip to content

Commit 309124e

Browse files
committed
maint: use hatch instead of poetry
1 parent 1e0bf4e commit 309124e

File tree

3 files changed

+61
-16
lines changed

3 files changed

+61
-16
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,8 @@ jobs:
2525

2626
- name: Upgrade pip
2727
run: |
28-
pip install --constraint=.github/workflows/constraints.txt pip
29-
pip --version
30-
31-
- name: Install Poetry
32-
run: |
33-
pip install --constraint=.github/workflows/constraints.txt poetry
34-
poetry --version
28+
pip install --upgrade pip
29+
pip install hatch
3530
3631
- name: Check if there is a parent commit
3732
id: check-parent-commit
@@ -44,18 +39,17 @@ jobs:
4439
uses: salsify/[email protected]
4540
with:
4641
version-command: |
47-
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
42+
bash -o pipefail -c "hatch version"
4843
4944
- name: Bump version for developmental release
5045
if: "! steps.check-version.outputs.tag"
5146
run: |
52-
poetry version patch &&
53-
version=$(poetry version | awk '{ print $2 }') &&
54-
poetry version $version.dev.$(date +%s)
47+
version=$(hatch version) &&
48+
hatch version $version.dev.$(date +%s)
5549
5650
- name: Build package
5751
run: |
58-
poetry build --ansi
52+
hatch build
5953
6054
- name: Publish package on PyPI
6155
if: steps.check-version.outputs.tag

pyproject.toml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
[project]
2+
name = "protosym"
3+
version = "0.0.2"
4+
requires-python = ">=3.8"
5+
license = "BSD-3-clause"
6+
description = "ProtoSym"
7+
readme = "README.rst"
8+
authors = [
9+
{ name = "Oscar Benjamin", email = "[email protected]" },
10+
]
11+
classifiers = [
12+
"Programming Language :: Python :: 3.8",
13+
"Programming Language :: Python :: 3.9",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
]
18+
19+
[project.optional-dependencies]
20+
all = [
21+
"numpy",
22+
"sympy",
23+
"llvmlite",
24+
]
25+
26+
[build-system]
27+
requires = ["hatchling"]
28+
build-backend = "hatchling.build"
29+
30+
[tool.hatch.build]
31+
include = [
32+
"src",
33+
"docs",
34+
"tests",
35+
"benchmarks",
36+
37+
"requirements-*.txt",
38+
39+
"noxfile.py",
40+
"quicktest.sh",
41+
42+
"README.rst",
43+
"CONTRIBUTING.rst",
44+
"CODE_OF_CONDUCT.rst",
45+
"LICENSE.rst",
46+
47+
"pyproject.toml",
48+
]
49+
50+
[tool.hatch.build.targets.wheel]
51+
packages = [
52+
"src/protosym",
53+
]
54+
155
[tool.poetry]
256
name = "protosym"
357
version = "0.0.2"
@@ -109,7 +163,3 @@ module = [
109163
]
110164
follow_imports = "skip"
111165
ignore_missing_imports = true
112-
113-
[build-system]
114-
requires = ["poetry-core>=1.0.0"]
115-
build-backend = "poetry.core.masonry.api"

requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sympy
22
llvmlite
33
numpy
44
pytest
5+
pytest-cov
56
coverage[toml]
67
pygments
78
xdoctest[colors]

0 commit comments

Comments
 (0)