-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Flake8 & Autopep8 to Ruff
- Loading branch information
Showing
81 changed files
with
2,776 additions
and
1,984 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
__pycache__ | ||
.mypy_cache | ||
.pytest_cache | ||
.ruff_cache | ||
|
||
.venv | ||
.direnv | ||
|
This file was deleted.
Oops, something went wrong.
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,12 +1,10 @@ | ||
[project] | ||
name = "apify" | ||
version = "1.3.1" | ||
version = "1.4.0" | ||
description = "Apify SDK for Python" | ||
readme = "README.md" | ||
license = {text = "Apache Software License"} | ||
authors = [ | ||
{name = "Apify Technologies s.r.o.", email = "[email protected]"}, | ||
] | ||
license = { text = "Apache Software License" } | ||
authors = [{ name = "Apify Technologies s.r.o.", email = "[email protected]" }] | ||
keywords = ["apify", "sdk", "actor", "scraping", "automation"] | ||
|
||
classifiers = [ | ||
|
@@ -26,8 +24,8 @@ requires-python = ">=3.8" | |
dependencies = [ | ||
"aiofiles >= 22.1.0", | ||
"aioshutil >= 1.0", | ||
"apify-client ~= 1.5.0", | ||
"apify-shared ~= 1.0.4", | ||
"apify-client == 1.6.1a2", | ||
"apify-shared ~= 1.1.0", | ||
"colorama >= 0.4.6", | ||
"cryptography >= 39.0.0", | ||
"httpx >= 0.24.1", | ||
|
@@ -40,25 +38,9 @@ dependencies = [ | |
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"autopep8 ~= 2.0.4", | ||
"build ~= 1.0.3", | ||
"filelock ~= 3.12.4", | ||
"flake8 ~= 6.1.0", | ||
"flake8-bugbear ~= 23.9.16", | ||
"flake8-commas ~= 2.1.0; python_version < '3.12'", | ||
"flake8-comprehensions ~= 3.14.0", | ||
"flake8-datetimez ~= 20.10.0", | ||
"flake8-docstrings ~= 1.7.0", | ||
"flake8-encodings ~= 0.5.0", | ||
"flake8-isort ~= 6.1.0", | ||
"flake8-noqa ~= 1.3.1; python_version < '3.12'", | ||
"flake8-pytest-style ~= 1.7.2", | ||
"flake8-quotes ~= 3.3.2; python_version < '3.12'", | ||
"flake8-simplify ~= 0.21.0", | ||
"flake8-unused-arguments ~= 0.0.13", | ||
"isort ~= 5.12.0", | ||
"mypy ~= 1.5.1", | ||
"pep8-naming ~= 0.13.3", | ||
"mypy ~= 1.7.1", | ||
"pre-commit ~= 3.4.0", | ||
"pydoc-markdown ~= 4.8.2", | ||
"pytest ~= 7.4.2", | ||
|
@@ -67,6 +49,7 @@ dev = [ | |
"pytest-timeout ~= 2.2.0", | ||
"pytest-xdist ~= 3.3.1", | ||
"respx ~= 0.20.1", | ||
"ruff ~= 0.1.6", | ||
"twine ~= 4.0.2", | ||
"types-aiofiles ~= 23.2.0.0", | ||
"types-colorama ~= 0.4.15.11", | ||
|
@@ -94,3 +77,72 @@ include = ["apify*"] | |
|
||
[tool.setuptools.package-data] | ||
apify = ["py.typed"] | ||
|
||
[tool.ruff] | ||
line-length = 150 | ||
select = ["ALL"] | ||
ignore = [ | ||
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {filename} | ||
"BLE001", # Do not catch blind exception | ||
"C901", # `{name}` is too complex | ||
"COM812", # This rule may cause conflicts when used with the formatter | ||
"D100", # Missing docstring in public module | ||
"D104", # Missing docstring in public package | ||
"EM", # flake8-errmsg | ||
"G004", # Logging statement uses f-string | ||
"ISC001", # This rule may cause conflicts when used with the formatter | ||
"FIX", # flake8-fixme | ||
"PGH003", # Use specific rule codes when ignoring type issues | ||
"PLR0911", # Too many return statements | ||
"PLR0913", # Too many arguments in function definition | ||
"PLR0915", # Too many statements | ||
"PTH", # flake8-use-pathlib | ||
"PYI034", # `__aenter__` methods in classes like `{name}` usually return `self` at runtime | ||
"PYI036", # The second argument in `__aexit__` should be annotated with `object` or `BaseException | None` | ||
"S102", # Use of `exec` detected | ||
"S105", # Possible hardcoded password assigned to | ||
"S106", # Possible hardcoded password assigned to argument: "{name}" | ||
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue | ||
"S303", # Use of insecure MD2, MD4, MD5, or SHA1 hash function | ||
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes | ||
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ... | ||
"TID252", # Relative imports from parent modules are bannedRuff | ||
"TRY003", # Avoid specifying long messages outside the exception class | ||
|
||
# TODO: Remove this once the following issue is fixed | ||
# https://github.com/apify/apify-sdk-python/issues/150 | ||
"SLF001", # Private member accessed: `{name}` | ||
] | ||
|
||
[tool.ruff.format] | ||
quote-style = "single" | ||
indent-style = "space" | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"**/__init__.py" = [ | ||
"F401", # Unused imports | ||
] | ||
"**/{scripts}/*" = [ | ||
"D", # Everything from the pydocstyle | ||
"INP001", # File {filename} is part of an implicit namespace package, add an __init__.py | ||
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable | ||
"T20", # flake8-print | ||
] | ||
"**/{tests}/*" = [ | ||
"D", # Everything from the pydocstyle | ||
"INP001", # File {filename} is part of an implicit namespace package, add an __init__.py | ||
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable | ||
"S101", # Use of assert detected | ||
"T20", # flake8-print | ||
"TRY301", # Abstract `raise` to an inner function | ||
] | ||
|
||
[tool.ruff.lint.flake8-quotes] | ||
docstring-quotes = "double" | ||
inline-quotes = "single" | ||
|
||
[tool.ruff.lint.isort] | ||
known-first-party = ["apify", "apify_client", "apify_shared"] | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" |
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,5 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from __future__ import annotations | ||
|
||
import re | ||
import sys | ||
|
||
|
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
Oops, something went wrong.