Skip to content

Commit e1b78e9

Browse files
committed
use ruff; less pre-commit hooks; less overriding things
1 parent 074da70 commit e1b78e9

File tree

6 files changed

+63
-175
lines changed

6 files changed

+63
-175
lines changed

.github/workflows/ci-python.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,13 @@ jobs:
1919
- uses: actions/checkout@v4
2020

2121
- uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
22-
with:
23-
version: '0.9.3'
24-
enable-cache: false # we just cache the venv-dir directly in action-setup-venv
25-
26-
- uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0
27-
with:
28-
cache-dependency-path: uv.lock
29-
install-cmd: uv sync --all-packages --all-groups --frozen --active
30-
31-
- name: Run black
32-
run: black --check --diff python-objectstore-client
33-
34-
- name: Run isort
35-
run: isort --check-only --diff python-objectstore-client
36-
37-
- name: Run flake8
38-
run: flake8 python-objectstore-client
3922

23+
- name: Run ruff check
24+
run: ruff check
25+
- name: Run ruff format
26+
run: ruff format
4027
- name: Run mypy
41-
run: mypy python-objectstore-client
28+
run: mypy .
4229

4330
test:
4431
strategy:

.pre-commit-config.yaml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,24 @@ repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v6.0.0
77
hooks:
8-
- id: check-case-conflict
9-
- id: check-executables-have-shebangs
10-
- id: check-merge-conflict
11-
- id: check-symlinks
12-
- id: end-of-file-fixer
138
- id: trailing-whitespace
14-
- id: check-added-large-files
15-
args: ["--maxkb=1024"]
16-
- id: check-yaml
17-
args: ["--allow-multiple-documents"]
18-
- id: check-toml
19-
- id: detect-private-key
9+
- id: end-of-file-fixer
10+
- id: check-merge-conflict
2011

2112
- repo: local
2213
hooks:
23-
- id: black
24-
name: black
25-
entry: .venv/bin/black
14+
- id: ruff-check
15+
name: ruff check
16+
entry: ruff check --fix
2617
language: system
2718
types_or: [python, pyi]
28-
require_serial: true
29-
- id: isort
30-
name: isort
31-
entry: .venv/bin/isort
19+
- id: ruff-format
20+
name: ruff format
21+
entry: ruff format
3222
language: system
33-
types: [python]
34-
- id: flake8
35-
name: flake8
36-
entry: .venv/bin/flake8
37-
language: system
38-
types: [python]
39-
require_serial: true
23+
types_or: [python, pyi]
4024
- id: mypy
4125
name: mypy
4226
entry: .venv/bin/mypy
4327
language: system
4428
types: [python]
45-
require_serial: true

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "objectstore"
33
version = "0.1.0"
44
requires-python = ">=3.13"
55

6+
[tool.uv]
7+
required-version = "==0.9.3"
8+
69
[tool.uv.workspace]
710
members = [
811
"python-objectstore-client",
@@ -11,5 +14,19 @@ members = [
1114
[dependency-groups]
1215
dev = [
1316
"devservices>=1.2.2",
17+
"mypy>=1.17.1",
18+
"ruff>=0.14.2",
1419
"pre-commit>=4.2.0",
1520
]
21+
22+
[tool.ruff.lint]
23+
select = ["E", "F", "I", "UP"] # pycodestyle, pyflakes, isort, pyupgrade
24+
25+
[tool.mypy]
26+
no_implicit_reexport = true
27+
warn_unreachable = true
28+
warn_unused_ignores = true
29+
warn_redundant_casts = true
30+
local_partial_types = true
31+
disallow_any_generics = true
32+
disallow_untyped_defs = true

python-objectstore-client/pyproject.toml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,10 @@ requires-python = ">=3.13"
77
dependencies = []
88

99
[build-system]
10-
requires = ["uv_build==0.9.3"] # must match the version specified in devenv/config.ini
10+
requires = ["uv_build==0.9.3"] # must match the version specified in devenv/config.ini and the main pyproject.toml
1111
build-backend = "uv_build"
1212

1313
[dependency-groups]
1414
dev = [
1515
"pytest>=8.3.3",
16-
"black>=25.1.0",
17-
"isort>=5.13.2",
18-
"flake8>=7.3.0",
19-
"mypy>=1.17.1",
2016
]
21-
22-
[tool.mypy]
23-
check_untyped_defs = true
24-
no_implicit_reexport = true
25-
warn_unreachable = true
26-
warn_unused_configs = true
27-
warn_unused_ignores = true
28-
warn_redundant_casts = true
29-
enable_error_code = ["ignore-without-code", "redundant-self"]
30-
local_partial_types = true
31-
disallow_any_generics = true
32-
disallow_untyped_defs = true
33-
34-
[tool.black]
35-
line-length = 200
36-
target-version = ['py313']
37-
38-
[tool.isort]
39-
profile = "black"
40-
line_length = 200
41-
lines_between_sections = 1

python-objectstore-client/setup.cfg

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

0 commit comments

Comments
 (0)