Skip to content

Commit f00952d

Browse files
committed
chore: migrate to hatch (would require >=3.10)
1 parent 2e0e288 commit f00952d

6 files changed

Lines changed: 75 additions & 94 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,39 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- name: Set up Python
14-
uses: actions/setup-python@v2
14+
uses: actions/setup-python@v5
1515
with:
1616
python-version: "3.12"
17-
- name: Setup packages
18-
run: |
19-
pip install -U pip setuptools wheel
20-
pip install -r requirements-dev.txt
17+
- name: Install hatch
18+
run: pip install hatch
2119
- name: Lint
22-
run: |
23-
flake8
24-
mypy
25-
black --diff src
26-
black --check src
27-
isort --diff src
28-
isort --check src
20+
run: hatch run lint:check
2921

3022
test:
31-
name: Test (Python ${{ matrix.python-version }})
23+
name: Test
3224
runs-on: ubuntu-latest
33-
strategy:
34-
matrix:
35-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3625
steps:
3726
- name: Checkout
38-
uses: actions/checkout@v2
39-
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v2
27+
uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
4130
with:
42-
python-version: "${{ matrix.python-version }}"
31+
python-version: |
32+
3.8
33+
3.9
34+
3.10
35+
3.11
36+
3.12
37+
3.13
38+
3.14
4339
allow-prereleases: true
44-
- name: Setup packages
45-
run: |
46-
pip install -U pip setuptools wheel
47-
pip install -r requirements-dev.txt codecov
40+
- name: Install hatch
41+
run: pip install hatch
4842
- name: Test
49-
run: |
50-
pytest --cov --cov-report=xml
43+
run: hatch run cov
5144
- name: Send coverage to codecov
5245
run: |
46+
pip install codecov
5347
codecov

noxfile.py

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

pyproject.toml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,56 @@
11
[build-system]
2-
requires = [
3-
"setuptools >= 40.9.0",
4-
"wheel",
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "jsonie"
7+
version = "0.0.8"
8+
description = "conversion between JSON and typed Python objects having Json-like structure"
9+
readme = "README.md"
10+
license = "MIT"
11+
authors = [{ name = "Moriyoshi Koizumi", email = "mozo@mozo.jp" }]
12+
keywords = ["json", "dataclasses", "typing"]
13+
requires-python = ">=3.8"
14+
dependencies = ["iso8601"]
15+
classifiers = [
16+
"License :: OSI Approved :: MIT License",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
25+
]
26+
27+
[tool.hatch.build.targets.wheel]
28+
packages = ["src/jsonie"]
29+
30+
[tool.hatch.envs.default]
31+
dependencies = ["pytest", "pytest-cov"]
32+
33+
[[tool.hatch.envs.default.matrix]]
34+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
35+
36+
[tool.hatch.envs.default.scripts]
37+
test = "pytest {args}"
38+
cov = "pytest --cov --cov-report=xml {args}"
39+
40+
[tool.hatch.envs.lint]
41+
dependencies = ["black", "flake8", "mypy", "isort", "pytest"]
42+
43+
[tool.hatch.envs.lint.scripts]
44+
check = [
45+
"flake8",
46+
"mypy",
47+
"black --check src",
48+
"isort --check src",
49+
]
50+
fmt = [
51+
"black src",
52+
"isort src",
553
]
6-
build-backend = "setuptools.build_meta"
754

855
[tool.black]
956
line-length = 100
@@ -22,3 +69,6 @@ profile = "black"
2269
multi_line_output = 3
2370
honor_noqa = true
2471
group_by_package = true
72+
73+
[tool.mypy]
74+
files = "src/"

requirements-dev.txt

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

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)