chore: add Ruff and apply formatting across codebase
Introduce ruff lint/format config, expand .gitignore, and reformat Python sources. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+34
-3
@@ -10,11 +10,17 @@ readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
license = { text = "MIT" }
|
||||
authors = [{ name = "Frank" }]
|
||||
dependencies = []
|
||||
dependencies = [
|
||||
"Pillow>=10.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
ai = ["numpy>=1.26", "Pillow>=10.0", "torch>=2.0"]
|
||||
dev = ["pytest>=8.0"]
|
||||
ai = ["numpy>=1.26", "torch>=2.0"]
|
||||
dev = [
|
||||
"pytest>=8.0",
|
||||
"numpy>=1.26",
|
||||
"ruff>=0.8",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
imagepipeline = "imagepipeline.cli:main"
|
||||
@@ -25,3 +31,28 @@ include = ["imagepipeline*"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
markers = [
|
||||
"integration: tests that call external CLI tools (ImageMagick, G'MIC, rembg, darktable, GIMP)",
|
||||
"slow: tests that take more than a few seconds",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py311"
|
||||
line-length = 100
|
||||
src = ["imagepipeline", "tests", "pipelines"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"UP", # pyupgrade
|
||||
"B", # flake8-bugbear
|
||||
]
|
||||
ignore = [
|
||||
"E501", # line length handled by formatter
|
||||
"B027", # optional empty hooks on BaseModule
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["imagepipeline"]
|
||||
|
||||
Reference in New Issue
Block a user