-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/cd: update workflows, ruff rules and pre-commit hooks (#418)
* ci/cd: add `toml-sort` precommit * ci/cd: add new pre-commits General propose: - `check-merge-conflict` - `name-tests-test` - `check-illegal-windows-names` These are for the release scripts: - `check-executables-have-shebangs` - `check-shebang-scripts-are-executable` - `check-added-large-files` - `check-case-conflict` * ci/cd: add new `ruff` rules New rules: - `ASYNC` # async calls that do not await anything or use blocking methods - `FA102` # future annotations - `PTH` # use pathlib instead of os - `T20` # flake8-print - `TID` # flake8-tidy-imports Change rules - Replace `TCH` with `TC` (new name for type checking imports) and add it as a safe fix - Marked `ERA` (commented out code) as unfixable Ignore: - Ignore `E402` on `__init__.py` files and `tests` and `docs` folders * fix: add `T20` exclude on `tests` and `docs` folder
- Loading branch information
1 parent
2f6bbdd
commit 30a03db
Showing
3 changed files
with
72 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
[tool.poetry] | ||
name = "cyberdrop-dl-patched" | ||
version = "6.0.1" | ||
description = "Bulk downloader for multiple file hosts" | ||
authors = ["Jacob B <[email protected]>"] | ||
readme = "README.md" | ||
repository = "https://github.com/jbsparrow/CyberDropDownloader" | ||
description = "Bulk downloader for multiple file hosts" | ||
documentation = "https://script-ware.gitbook.io/cyberdrop-dl/" | ||
packages = [{ include = "cyberdrop_dl" }] | ||
include = ["CHANGELOG.md"] | ||
packages = [{include = "cyberdrop_dl"}] | ||
readme = "README.md" | ||
repository = "https://github.com/jbsparrow/CyberDropDownloader" | ||
version = "6.0.1" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.11,<3.14" | ||
|
@@ -24,15 +24,15 @@ certifi = "^2024.12.14" | |
filedate = "^3.0" | ||
get-video-properties = "^0.1.1" | ||
inquirerpy = "^0.3.4" | ||
jeepney = [{platform = "linux", version = "^0.8.0"},{platform = "bsd", version = "^0.8.0"}] | ||
jeepney = [{platform = "bsd", version = "^0.8.0"}, {platform = "linux", version = "^0.8.0"}] | ||
mediafire = "^0.6.1" | ||
myjdapi = "^1.1.7" | ||
pillow = "^11.0.0" | ||
platformdirs = "^4.3.6" | ||
pycryptodomex = "^3.21.0" | ||
pydantic = "^2.10.4" | ||
pywin32 = {platform = "win32", version = "^308"} | ||
pyyaml = "^6.0.2" | ||
pywin32 = {version = "^308", platform = "win32"} | ||
rich = "^13.9.4" | ||
send2trash = "^1.8.3" | ||
xxhash = "^3.5.0" | ||
|
@@ -53,42 +53,64 @@ cyberdrop-dl = "cyberdrop_dl.main:main" | |
[tool.poetry.urls] | ||
Changelog = "https://github.com/jbsparrow/CyberDropDownloader/blob/master/CHANGELOG.md" | ||
|
||
[tool.pytest.ini_options] | ||
asyncio_default_fixture_loop_scope = "module" | ||
asyncio_mode = "auto" | ||
minversion = "8.3" | ||
testpaths = ["tests"] | ||
|
||
[tool.ruff] | ||
exclude = ["cyberdrop_dl/dependencies/browser_cookie3/__init__.py"] | ||
line-length = 120 | ||
target-version = "py311" | ||
exclude = ["cyberdrop_dl/dependencies/browser_cookie3/__init__.py"] | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings | ||
"F", # pyflakes | ||
"I", # isort | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"UP", # pyupgrade | ||
"N", # PEP8 naming conventions | ||
"TCH", # flake8-type-checking | ||
"COM8", # flake8-commas linter | ||
"ASYNC", # async calls that do not await anything or use blocking methods | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"COM8", # flake8-commas linter | ||
"E", # pycodestyle errors | ||
"F", # pyflakes | ||
"FA102", # future annotations | ||
"I", # isort | ||
"N", # PEP8 naming conventions | ||
"PTH", # use pathlib instead of os | ||
"Q", # flake8-quotes | ||
"RUF", # RUF specific fixes | ||
"Q", # flake8-quotes | ||
"T20", # flake8-print | ||
"TC", # flake8-type-checking | ||
"TID", # flake8-tidy-imports | ||
"UP", # pyupgrade | ||
"W" # pycodestyle warnings | ||
] | ||
extend-safe-fixes = [ | ||
"TC" # move import from and to TYPE_CHECKING blocks | ||
] | ||
|
||
ignore = [ | ||
"N806", # Uppercase variables in functions | ||
"E501", # Suppress line-too-long, let formatter decide | ||
"COM812", # missing-trailing-comma | ||
"COM812", # missing-trailing-comma | ||
"E501", # suppress line-too-long, let formatter decide | ||
"N806" # uppercase variables in functions | ||
] | ||
unfixable = [ | ||
"ERA" # do not autoremove commented out code | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "8.3" | ||
testpaths = ["tests"] | ||
asyncio_mode = "auto" | ||
asyncio_default_fixture_loop_scope = "module" | ||
[tool.ruff.lint.per-file-ignores] | ||
"**/{tests,docs}/*" = ["E402", "T20"] # imports not at the top of the file. | ||
"__init__.py" = ["E402"] # imports not at the top of the file. | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" | ||
|
||
[tool.tomlsort] | ||
all = true | ||
ignore_case = true | ||
in_place = true | ||
sort_first = ["name", "python", "select", "tool"] | ||
spaces_before_inline_comment = 2 | ||
spaces_indent_inline_array = 4 | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["poetry-core>=1.0.0"] |