-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependencies upgrade and switch to ruff for formatting
- Loading branch information
1 parent
d837339
commit 9cd0ebd
Showing
9 changed files
with
47 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
{ | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"editor.formatOnSave": true, | ||
"python.linting.mypyEnabled": true, | ||
"[python]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
"source.organizeImports.ruff": "explicit" | ||
} | ||
}, | ||
"ruff.organizeImports": false, | ||
"ruff.fixAll": false, | ||
"ruff.importStrategy": "fromEnvironment", | ||
"autoDocstring.docstringFormat": "sphinx-notypes", | ||
"python.analysis.typeCheckingMode": "strict" | ||
"python.analysis.typeCheckingMode": "strict", | ||
"mypy.runUsingActiveInterpreter": true, | ||
"ruff.lint.args": ["--extend-exclude=/**/site-packages/**/*.py"], | ||
"autoDocstring.docstringFormat": "sphinx-notypes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build" | |
name = "thumbhash-python" | ||
description = 'A Python implementation of the Thumbhash image placeholder generation algorithm.' | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
requires-python = ">=3.8" | ||
license = "MIT" | ||
authors = [ | ||
{ name = "Yohann MARTIN", email = "[email protected]" }, | ||
|
@@ -22,17 +22,19 @@ classifiers = [ | |
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"Pillow >=8.0.0,<10.0.0", | ||
"typer[all] ==0.7.0" | ||
"Pillow >=8.0.0,<11.0.0", | ||
"typer[all] >=0.7.0,<1.0.0" | ||
] | ||
dynamic = ["version"] | ||
|
||
|
@@ -42,18 +44,14 @@ Issues = "https://github.com/Astropilot/thumbhash-python/issues" | |
Source = "https://github.com/Astropilot/thumbhash-python" | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest >=7.1.3,<8.0.0", | ||
"coverage[toml] >= 6.5.0,< 8.0" | ||
] | ||
dev = [ | ||
"mypy ==1.1.1", | ||
"ruff ==0.0.257", | ||
"black ==23.1.0", | ||
"isort >=5.0.6,<6.0.0", | ||
"devtools[pygments] ==0.10.0", | ||
"types-Pillow >=10.0.0", | ||
|
||
"types-Pillow >=9.0.0" | ||
"mypy ==1.7.1", | ||
"ruff ==0.1.8", | ||
"devtools[pygments] ==0.12.2", | ||
"pytest >=7.1.3,<8.0.0", | ||
"coverage[toml] >=6.5.0,<8.0" | ||
] | ||
|
||
[project.scripts] | ||
|
@@ -66,12 +64,11 @@ path = "thumbhash/__version__.py" | |
exclude = [ | ||
"/.github", | ||
"/.vscode", | ||
"/scripts" | ||
"/scripts", | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_third_party = ["thumbhash", "typer"] | ||
[tool.hatch.build.targets.wheel] | ||
packages = ["thumbhash"] | ||
|
||
[tool.mypy] | ||
strict = true | ||
|
@@ -90,27 +87,33 @@ exclude_lines = [ | |
"if TYPE_CHECKING:", | ||
] | ||
|
||
[tool.ruff] | ||
target-version = "py37" | ||
[tool.ruff.lint] | ||
select = [ | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings | ||
"F", # pyflakes | ||
# "I", # isort | ||
"C", # flake8-comprehensions | ||
"B", # flake8-bugbear | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings | ||
"F", # pyflakes | ||
"I", # isort | ||
"C", # flake8-comprehensions | ||
"B", # flake8-bugbear | ||
"UP", # pyupgrade | ||
] | ||
ignore = [ | ||
"E501", # line too long, handled by black | ||
"B008", # do not perform function calls in argument defaults | ||
"C901", # too complex | ||
"E501", # line too long, handled by ruff | ||
"B008", # do not perform function calls in argument defaults | ||
"C901", # too complex, | ||
"W191", # indentation contains tabs | ||
"B904" # Opinionated warning on exception chaining | ||
] | ||
[tool.ruff.format] | ||
line-ending = "lf" | ||
quote-style = "double" | ||
indent-style = "space" | ||
|
||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["F401"] | ||
|
||
[tool.ruff.isort] | ||
known-third-party = ["thumbhash"] | ||
known-third-party = ["thumbhash", "typer", "PIL"] | ||
|
||
[tool.pyright] | ||
reportUnknownMemberType=false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
set -x | ||
|
||
ruff check thumbhash tests --fix | ||
black thumbhash tests | ||
isort thumbhash tests | ||
ruff format thumbhash tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ set -x | |
|
||
mypy thumbhash | ||
ruff check thumbhash tests | ||
black thumbhash tests --check | ||
isort thumbhash tests --check-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.0.0" | ||
__version__ = "1.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters