Skip to content

Commit

Permalink
build: + pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
hrz6976 committed Jun 11, 2024
1 parent 5befb65 commit 728546c
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 11 deletions.
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
ci:
skip: [pytest]

default_language_version:
python: python3.8

repos:
# general checks (see here: https://pre-commit.com/hooks.html)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace

# ruff: linting + formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format

# pytest: testing
- repo: local
hooks:
- id: pytest
name: pytest
entry: poetry run pytest
language: system
types: [python]
pass_filenames: false

# # skip poetry check for now, it's large and slow
# # poetry: check lock and generate requirements.txt
# - repo: https://github.com/python-poetry/poetry
# rev: 1.8.3
# hooks:
# - id: poetry-check
# args: ["--lock"]
# - id: poetry-export
# args: ["-f", "requirements.txt", "--with", "build", "--output", "requirements.txt"]
# verbose: true
179 changes: 178 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ python = "^3.8"
python-lzf = "^0.2.4"
chardet = "^5.2.0"

[tool.poetry.group.dev.dependencies]
[tool.poetry.group.build.dependencies]
cython = "^0.29.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
pytest-cov = "^5.0.0"
coverage = {extras = ["toml"], version = "^7.5.3"}
# bandit = "^1.7.8"
# docformatter = "^1.7.5"
ruff = "^0.4.6" # <- ruff is powerful enough to be the only linter
ruff = "^0.4.4" # <- ruff is powerful enough to be the only linter
# sphinx = "^7.1.2"
# sphinx-rtd-theme = "^1.0.0"
# sphinx-autobuild = "^2021.3.14"
# sphinx-pyproject = "^0.3.0"
# sphinx-autodoc-typehints = "^1.25.3"
pdoc = "^14.5.0" # <- drop sphinx, too many deps and rst is not fun
pre-commit = "^3.5"

[build-system]
requires = ["poetry-core", "Cython>=0.29.0,<1.0.0", "setuptools>=42"]
Expand Down Expand Up @@ -118,13 +121,13 @@ ignore = ["E203", "E501", "E741"]
[tool.ruff.lint.per-file-ignores]
# loose checks for test files
"tests/**/*.py" = [
"S101",
"ARG",
"S101",
"ARG",
"FBT",
"PLR2004",
"S311",
"PLR2004",
"S311",
"D",
"F405",
"F403",
"F841"
]
]
Loading

0 comments on commit 728546c

Please sign in to comment.