Skip to content

Commit 24d73fc

Browse files
authored
New Tooling Migration (#5)
* Migrate to ruff, uv, and hatchling * Use just to create named workflows --------- Co-authored-by: Ben Fox <astudent@cinderhippo.com>
1 parent 5f4d288 commit 24d73fc

31 files changed

+220
-208
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,27 @@ on:
1313

1414
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1515
jobs:
16-
# Test creation of virtual environment
17-
create-venv:
16+
test:
17+
name: python
1818
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v3
21-
- uses: actions/setup-python@v4
22-
with:
23-
python-version: '3.10'
24-
- uses: syphar/restore-virtualenv@v1
25-
id: cache-virtualenv
26-
27-
- uses: syphar/restore-pip-download-cache@v1
28-
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
2919

30-
- run: pip install -r requirements.txt
31-
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
32-
33-
# Check code standards
34-
lint:
35-
needs: create-venv
36-
runs-on: ubuntu-latest
3720
steps:
38-
- uses: actions/checkout@v3
39-
- uses: actions/setup-python@v4
21+
- uses: actions/checkout@v4
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
4025
with:
41-
python-version: '3.10'
42-
- uses: syphar/restore-virtualenv@v1
43-
id: cache-virtualenv
26+
version: "0.6.6"
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version-file: ".python-version"
34+
35+
- name: Install Project
36+
run: uv sync --all-extras --dev
4437

45-
# Runs linting on repository
46-
- run: chmod +x ci/run_lint_remote.sh
47-
- run: ./ci/run_lint_remote.sh
38+
- name: Test Release
39+
run: uv run just release

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Directories
2-
.idea/
32
.mypy_cache/
3+
.ruff_cache/
44
.venv/
5-
*__pycache__
5+
__pycache__/

.pre-commit-config.yaml

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

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

ci/bash_common.sh

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

ci/run_ci_local.sh

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

ci/run_lint_remote.sh

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

install_setup.sh

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

justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
default: release
2+
3+
format:
4+
uv run ruff format --check --diff
5+
6+
lint:
7+
uv run ruff check
8+
9+
typecheck:
10+
uv run mypy .
11+
12+
release: format lint typecheck

pyproject.toml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,41 @@
1-
[tool.isort]
2-
profile = "black"
1+
[project]
2+
name = "ff-toolbox"
3+
version = "0.1.0"
4+
description = "UI and backend to help with fantasy football live drafting, trade analysis, and more."
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = []
8+
9+
[build-system]
10+
requires = ["hatchling"]
11+
build-backend = "hatchling.build"
12+
13+
[dependency-groups]
14+
dev = [
15+
"mypy>=1.15.0",
16+
"ruff>=0.11.0",
17+
"rust-just>=1.40.0",
18+
]
319

420
[tool.mypy]
521
strict = true
6-
ignore_missing_imports = true
22+
23+
[tool.ruff.lint]
24+
select = [
25+
# isort
26+
"I",
27+
# mccabe
28+
# "C",
29+
# pycodestyle
30+
"E",
31+
"W",
32+
# Pyflakes
33+
"F",
34+
]
35+
ignore = [
36+
# TODO: Remove E501 by fixing docstrings
37+
"E501"
38+
]
39+
40+
[tool.ruff.lint.per-file-ignores]
41+
"__init__.py" = ["E402"]

0 commit comments

Comments
 (0)