Skip to content

Commit

Permalink
switch to uv and drop black
Browse files Browse the repository at this point in the history
  • Loading branch information
lancelote committed Dec 6, 2024
1 parent 0dc261f commit f19e3e1
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 39 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ jobs:
fetch-depth: 0

- name: prepare
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ">=3.13.0"
python-version: ">=3.13"

- name: install
run: pip install -r requirements.txt
- name: install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: install project dependencies
run: uv sync --all-extras --dev

- name: test
run: PYTHONPATH=. pytest
run: PYTHONPATH=. uv run pytest

- name: lint
run: pre-commit run --all-files
run: uv run pre-commit run --all-files
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ repos:
- id: check-added-large-files
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
language_version: python3.13

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
37 changes: 17 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
[tool.black]
line-length = 79
target-version = ['py312']
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \.idea
| _build
| buck-out
| build
| dist
)/
'''
[project]
name = "leetcode"
version = "0.1.0"
description = "My Leetcode exercise solutions"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"black==24.10.0",
"click==8.1.7",
"mypy==1.13.0",
"pre-commit==4.0.1",
"pur==7.3.2",
"pytest==8.3.3",
"ruff==0.7.2",
]

[tool.mypy]
python_version = "3.12"
python_version = "3.13"
warn_return_any = true
warn_unused_configs = true
exclude = [
Expand All @@ -36,4 +33,4 @@ exclude = [
".venv"
]
line-length = 80
target-version = "py312"
target-version = "py313"
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

Loading

0 comments on commit f19e3e1

Please sign in to comment.