Skip to content

Commit 31edff3

Browse files
committed
replace setup.py with pyproject.toml and switch to uv in CI
1 parent 1bf64a3 commit 31edff3

File tree

5 files changed

+34
-26
lines changed

5 files changed

+34
-26
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,5 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
- name: Install test dependencies
25-
run: pip install flake8 pytest pytest-cov black
26-
- name: ci.py
27-
run: python ci.py
20+
- uses: astral-sh/setup-uv@v5
21+
- run: uv run --python ${{ python-version }} ci.py

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ __pycache__
33
.cache
44
*.egg-info
55
docs/build
6+
uv.lock

ci.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
subprocess.check_call(pytest_cmd)
2020

2121
print("Executing: flake8")
22-
subprocess.check_call(["flake8", "--max-line-length=88"])
22+
files = ["duct.py", "test_duct.py", "ci.py"]
23+
subprocess.check_call(["flake8", "--max-line-length=88"] + files)
2324

2425
print("Executing: black --check")
25-
subprocess.check_call(
26-
["black", "--check", "duct.py", "test_duct.py", "setup.py", "ci.py"]
27-
)
26+
subprocess.check_call(["black", "--check"] + files)
2827

2928
print("Success!")

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[project]
2+
name = "duct"
3+
version = "1.0.0"
4+
description = "a library for running child processes"
5+
readme = "README.md"
6+
license = "MIT"
7+
authors = [
8+
{ name = "Jack O'Connor", email = "[email protected]" },
9+
]
10+
requires-python = ">=3.9"
11+
12+
[project.urls]
13+
Repository = "https://github.com/oconnor663/duct.py"
14+
Documentation = "https://ductpy.readthedocs.io"
15+
16+
[build-system]
17+
requires = ["hatchling"]
18+
build-backend = "hatchling.build"
19+
20+
[tool.hatch.build]
21+
include = ["duct.py"]
22+
23+
[dependency-groups]
24+
dev = [
25+
"black>=25.9.0",
26+
"flake8>=7.3.0",
27+
"pytest>=8.4.2",
28+
]

setup.py

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

0 commit comments

Comments
 (0)