Skip to content

Commit 1223583

Browse files
max-pfeiffertotallyzen
andauthoredMar 4, 2024··
fix(build): add pre-commit as a dev dependency to simplify local dev and CI (#438)
I could not install pre-commit handler because the package was missing in [tool.poetry.group.dev.dependencies]. I also updated the configuration for the pre-commit handler as black and ruff packages were outdated. Also removed deprecation for ruff v0.3.0 config in pyproject.toml. --------- Co-authored-by: Balint Bartha <39852431+totallyzen@users.noreply.github.com>
1 parent 7358b49 commit 1223583

File tree

4 files changed

+136
-17
lines changed

4 files changed

+136
-17
lines changed
 

‎.github/workflows/ci-lint.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
with:
1919
python-version: "3.9" # the pre-commit is hooked in as 3.9
2020
- name: Install Python dependencies
21-
run: poetry install
22-
- name: Install pre-commit
23-
run: pip install pre-commit
24-
- name: Run linter
25-
run: pre-commit run -a
21+
run: poetry install --no-interaction
22+
- name: Execute pre-commit handler
23+
run: poetry run pre-commit run -a

‎.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.9
2+
python: python3
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -10,13 +10,13 @@ repos:
1010
- id: end-of-file-fixer
1111

1212
- repo: https://github.com/psf/black-pre-commit-mirror
13-
rev: '24.1.1'
13+
rev: '24.2.0'
1414
hooks:
1515
- id: black
1616
args: [ '--config', 'pyproject.toml' ]
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: 'v0.1.14'
19+
rev: 'v0.3.0'
2020
hooks:
2121
- id: ruff
2222
# Explicitly setting config to prevent Ruff from using `pyproject.toml` in sub packages.

‎poetry.lock

+122-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

+8-6
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ redis = ["redis"]
108108
selenium = ["selenium"]
109109

110110
[tool.poetry.group.dev.dependencies]
111+
mypy = "1.7.1"
112+
pre-commit = "^3.6"
113+
pg8000 = "*"
111114
pytest = "7.4.3"
112115
pytest-cov = "4.1.0"
113116
sphinx = "^7.2.6"
114-
pg8000 = "*"
115117
twine = "^4.0.2"
116-
mypy = "1.7.1"
117118

118119
[[tool.poetry.source]]
119120
name = "PyPI"
@@ -139,15 +140,14 @@ exclude_lines = [
139140
"raise NotImplementedError" # TODO: used in core/generic.py, not sure we need DbContainer
140141
]
141142

142-
[tool.ruff.flake8-type-checking]
143-
strict = true
144-
145143
[tool.ruff]
146144
target-version = "py39"
147145
line-length = 120
148146
fix = true
149-
fixable = ["I"]
150147
src = ["core", "modules/*"]
148+
149+
[tool.ruff.lint]
150+
fixable = ["I"]
151151
exclude = ["**/tests/**/*.py"]
152152
select = [
153153
# flake8-2020
@@ -194,6 +194,8 @@ ignore = [
194194
"INP001"
195195
]
196196

197+
[tool.ruff.lint.flake8-type-checking]
198+
strict = true
197199

198200
[tool.mypy]
199201
python_version = "3.9"

0 commit comments

Comments
 (0)
Please sign in to comment.