Skip to content

Commit e9a0270

Browse files
committed
chore: migrate to ruff, composite actions, uv
1 parent 5a0b326 commit e9a0270

File tree

5 files changed

+19
-72
lines changed

5 files changed

+19
-72
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
# name: build
22

33
# on:
4-
# push:
5-
# paths:
6-
# - '.github/workflows/build.yml'
7-
# - '**/*.py'
8-
# branches:
9-
# - '**'
10-
# tags:
11-
# - '!**'
12-
# pull_request:
13-
# paths:
14-
# - '.github/workflows/build.yml'
15-
# - '**/*.py'
4+
# push: ~
5+
# pull_request: ~
166
# workflow_dispatch: ~
177

188
# jobs:
199
# lint:
2010
# runs-on: ubuntu-latest
2111
# steps:
22-
# - uses: actions/checkout@v5
23-
# - uses: extractions/setup-just@v3
24-
# - uses: actions/setup-python@v6
12+
# - uses: justintime50/composite-actions/bootstrap-python@v1
2513
# with:
2614
# python-version: '3.14'
2715
# - run: just install lint
@@ -31,19 +19,15 @@
3119
# matrix:
3220
# pythonversion: ['3.10', '3.11', '3.12', '3.13', '3.14']
3321
# steps:
34-
# - uses: actions/checkout@v5
35-
# - uses: extractions/setup-just@v3
36-
# - uses: actions/setup-python@v6
22+
# - uses: justintime50/composite-actions/bootstrap-python@v1
3723
# with:
3824
# python-version: ${{ matrix.pythonversion }}
3925
# - run: just install coverage
4026
# coverage:
4127
# if: github.ref == 'refs/heads/main'
4228
# runs-on: ubuntu-latest
4329
# steps:
44-
# - uses: actions/checkout@v5
45-
# - uses: extractions/setup-just@v3
46-
# - uses: actions/setup-python@v6
30+
# - uses: justintime50/composite-actions/bootstrap-python@v1
4731
# with:
4832
# python-version: '3.14'
4933
# - run: just install coverage

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
# release:
1010
# runs-on: ubuntu-latest
1111
# steps:
12-
# - uses: actions/checkout@v5
13-
# - uses: extractions/setup-just@v3
14-
# - uses: actions/setup-python@v6
12+
# - uses: justintime50/composite-actions/bootstrap-python@v1
1513
# with:
1614
# python-version: '3.14'
1715
# - name: Build package

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Justin Hammond
3+
Copyright (c) 2026 Justin Hammond
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

justfile

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
PYTHON_BINARY := "python3"
2-
VIRTUAL_ENV := "venv"
1+
VIRTUAL_ENV := ".venv"
32
VIRTUAL_BIN := VIRTUAL_ENV / "bin"
43
PROJECT_NAME := "project_name"
54
TEST_DIR := "test"
@@ -12,14 +11,6 @@ bandit:
1211
build:
1312
{{VIRTUAL_BIN}}/python -m build
1413

15-
# Runs the Black Python formatter against the project
16-
black:
17-
{{VIRTUAL_BIN}}/black {{PROJECT_NAME}}/ {{TEST_DIR}}/
18-
19-
# Checks if the project is formatted correctly against the Black rules
20-
black-check:
21-
{{VIRTUAL_BIN}}/black {{PROJECT_NAME}}/ {{TEST_DIR}}/ --check
22-
2314
# Test the project and generate an HTML coverage report
2415
coverage:
2516
{{VIRTUAL_BIN}}/pytest --cov={{PROJECT_NAME}} --cov-branch --cov-report=html --cov-report=lcov --cov-report=term-missing --cov-fail-under=90
@@ -29,28 +20,20 @@ clean:
2920
rm -rf {{VIRTUAL_ENV}} dist *.egg-info .coverage htmlcov .*cache
3021
find . -name '*.pyc' -delete
3122

32-
# Run flake8 checks against the project
33-
flake8:
34-
{{VIRTUAL_BIN}}/flake8 {{PROJECT_NAME}}/ {{TEST_DIR}}/
35-
3623
# Lints the project
37-
lint: black-check isort-check flake8 mypy bandit
24+
lint:
25+
{{VIRTUAL_BIN}}/ruff check {{PROJECT_NAME}}/ {{TEST_DIR}}/
26+
{{VIRTUAL_BIN}}/ruff format --check {{PROJECT_NAME}}/ {{TEST_DIR}}/
3827

39-
# Runs all formatting tools against the project
40-
lint-fix: black isort
28+
# Fixes lint issues
29+
lint-fix:
30+
{{VIRTUAL_BIN}}/ruff check --fix {{PROJECT_NAME}}/ {{TEST_DIR}}/
31+
{{VIRTUAL_BIN}}/ruff format {{PROJECT_NAME}}/ {{TEST_DIR}}/
4132

4233
# Install the project locally
4334
install:
44-
{{PYTHON_BINARY}} -m venv {{VIRTUAL_ENV}}
45-
{{VIRTUAL_BIN}}/pip install -e ."[dev]"
46-
47-
# Sorts imports throughout the project
48-
isort:
49-
{{VIRTUAL_BIN}}/isort {{PROJECT_NAME}}/ {{TEST_DIR}}/
50-
51-
# Checks that imports throughout the project are sorted correctly
52-
isort-check:
53-
{{VIRTUAL_BIN}}/isort {{PROJECT_NAME}}/ {{TEST_DIR}}/ --check-only
35+
uv venv
36+
uv pip install -e '.[dev]'
5437

5538
# Run mypy type checking on the project
5639
mypy:

pyproject.toml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ dependencies = [
1818
]
1919
optional-dependencies = { dev = [
2020
"bandit == 1.9.*",
21-
"black == 25.*",
2221
"build == 1.3.*",
23-
"flake8 == 7.*",
24-
"Flake8-pyproject == 1.2.*",
25-
"isort == 7.*",
2622
"mypy == 1.18.*",
2723
"pytest == 9.*",
2824
"pytest-cov == 7.*",
25+
"ruff == 0.14.*",
2926
] }
3027

3128
[tool.setuptools.dynamic]
@@ -37,23 +34,8 @@ exclude = ["examples", "test"]
3734
[tool.setuptools.package-data]
3835
project_name = ["py.typed"]
3936

40-
[tool.black]
37+
[tool.ruff]
4138
line-length = 120
4239

43-
[tool.isort]
44-
profile = "black"
45-
line_length = 120
46-
indent = 4
47-
force_grid_wrap = 2
48-
multi_line_output = 3
49-
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
50-
lines_after_imports = 2
51-
include_trailing_comma = true
52-
use_parentheses = true
53-
5440
[tool.mypy]
5541
disable_error_code = "import-untyped"
56-
57-
[tool.flake8]
58-
max-line-length = 120
59-
extend-ignore = "E203"

0 commit comments

Comments
 (0)