|
| 1 | +[build-system] |
| 2 | +requires = ["hatchling"] |
| 3 | +build-backend = "hatchling.build" |
| 4 | + |
1 | 5 | [project] |
2 | 6 | name = "apify_shared" |
3 | 7 | version = "1.5.0" |
4 | 8 | description = "Tools and constants shared across Apify projects." |
5 | | -readme = "README.md" |
6 | | -license = { text = "Apache Software License" } |
7 | 9 | authors = [{ name = "Apify Technologies s.r.o.", email = "[email protected]" }] |
8 | | -keywords = ["apify", "api", "shared", "scraping", "automation"] |
9 | | - |
| 10 | +license = { file = "LICENSE" } |
| 11 | +readme = "README.md" |
| 12 | +requires-python = ">=3.10" |
10 | 13 | classifiers = [ |
11 | 14 | "Development Status :: 5 - Production/Stable", |
| 15 | + "Environment :: Console", |
12 | 16 | "Intended Audience :: Developers", |
13 | 17 | "License :: OSI Approved :: Apache Software License", |
14 | 18 | "Operating System :: OS Independent", |
15 | | - "Programming Language :: Python :: 3.8", |
16 | | - "Programming Language :: Python :: 3.9", |
17 | 19 | "Programming Language :: Python :: 3.10", |
18 | 20 | "Programming Language :: Python :: 3.11", |
19 | 21 | "Programming Language :: Python :: 3.12", |
| 22 | + "Programming Language :: Python :: 3.13", |
20 | 23 | "Topic :: Software Development :: Libraries", |
21 | 24 | ] |
22 | | - |
23 | | -requires-python = ">=3.8" |
24 | | - |
25 | | -# We use inclusive ordered comparison clause for non-Apify packages intentionally in order to enhance the Apify |
26 | | -# packages's compatibility with a wide range of external packages. This decision was discussed in detail in |
27 | | -# the following PR: https://github.com/apify/apify-sdk-python/pull/154 |
28 | | -dependencies = [] |
29 | | - |
30 | | -[project.optional-dependencies] |
31 | | -dev = [ |
32 | | - "build ~= 1.0.3", |
33 | | - "filelock ~= 3.12.4", |
34 | | - "mypy ~= 1.7.1", |
35 | | - "pre-commit ~= 3.4.0", |
36 | | - "pydoc-markdown ~= 4.8.2", |
37 | | - "pytest ~= 7.4.2", |
38 | | - "pytest-asyncio ~= 0.21.0", |
39 | | - "pytest-cov ~= 4.1.0", |
40 | | - "pytest-only ~= 2.0.0", |
41 | | - "pytest-timeout ~= 2.2.0", |
42 | | - "pytest-xdist ~= 3.3.1", |
43 | | - "respx ~= 0.20.1", |
44 | | - "ruff ~= 0.1.13", |
45 | | - "setuptools >= 68.0.0", |
46 | | - "twine ~= 5.1.1", |
| 25 | +keywords = [ |
| 26 | + "apify", |
| 27 | + "automation", |
| 28 | + "chrome", |
| 29 | + "crawlee", |
| 30 | + "crawler", |
| 31 | + "headless", |
| 32 | + "scraper", |
| 33 | + "scraping", |
47 | 34 | ] |
| 35 | +dependencies = [] |
48 | 36 |
|
49 | 37 | [project.urls] |
50 | 38 | "Apify Homepage" = "https://apify.com" |
51 | 39 | "Changelog" = "https://github.com/apify/apify-shared-python/blob/master/CHANGELOG.md" |
52 | | -"Issue tracker" = "https://github.com/apify/apify-shared-python/issues" |
53 | | -"Source" = "https://github.com/apify/apify-shared-python" |
| 40 | +"Discord" = "https://discord.com/invite/jyEM2PRvMU" |
| 41 | +"Issue Tracker" = "https://github.com/apify/apify-shared-python/issues" |
| 42 | +"Source Code" = "https://github.com/apify/apify-shared-python" |
54 | 43 |
|
55 | | -[build-system] |
56 | | -build-backend = "setuptools.build_meta" |
57 | | -requires = ["setuptools>=68.0.0", "wheel"] |
58 | | - |
59 | | -[tool.setuptools.packages.find] |
60 | | -include = ["apify_shared*"] |
61 | | -where = ["src"] |
| 44 | +[dependency-groups] |
| 45 | +dev = [ |
| 46 | + "dycw-pytest-only~=2.1.0", |
| 47 | + "mypy~=1.17.0", |
| 48 | + "pytest-asyncio~=1.1.0", |
| 49 | + "pytest-cov~=6.2.0", |
| 50 | + "pytest-timeout~=2.4.0", |
| 51 | + "pytest-xdist~=3.8.0", |
| 52 | + "pytest~=8.4.0", |
| 53 | + "ruff~=0.12.0", |
| 54 | + "setuptools", # setuptools are used by pytest, but not explicitly required |
62 | 55 |
|
63 | | -[tool.setuptools.package-data] |
64 | | -apify_shared = ["py.typed"] |
| 56 | +] |
65 | 57 |
|
66 | 58 | [tool.ruff] |
67 | 59 | line-length = 120 |
| 60 | +include = ["src/**/*.py", "tests/**/*.py"] |
| 61 | + |
| 62 | +[tool.ruff.lint] |
68 | 63 | select = ["ALL"] |
69 | 64 | ignore = [ |
70 | | - "ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {filename} |
71 | | - "BLE001", # Do not catch blind exception |
72 | | - "C901", # `{name}` is too complex |
73 | | - "COM812", # This rule may cause conflicts when used with the formatter |
74 | | - "D100", # Missing docstring in public module |
75 | | - "D104", # Missing docstring in public package |
76 | | - "EM", # flake8-errmsg |
77 | | - "G004", # Logging statement uses f-string |
78 | | - "ISC001", # This rule may cause conflicts when used with the formatter |
79 | | - "FIX", # flake8-fixme |
80 | | - "PGH003", # Use specific rule codes when ignoring type issues |
81 | | - "PLR0911", # Too many return statements |
82 | | - "PLR0913", # Too many arguments in function definition |
83 | | - "PLR0915", # Too many statements |
84 | | - "PTH", # flake8-use-pathlib |
85 | | - "PYI034", # `__aenter__` methods in classes like `{name}` usually return `self` at runtime |
86 | | - "PYI036", # The second argument in `__aexit__` should be annotated with `object` or `BaseException | None` |
87 | | - "S102", # Use of `exec` detected |
88 | | - "S105", # Possible hardcoded password assigned to |
89 | | - "S106", # Possible hardcoded password assigned to argument: "{name}" |
90 | | - "S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue |
91 | | - "S303", # Use of insecure MD2, MD4, MD5, or SHA1 hash function |
92 | | - "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes |
93 | | - "TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ... |
94 | | - "TRY003", # Avoid specifying long messages outside the exception class |
| 65 | + "COM812", # This rule may cause conflicts when used with the formatter |
| 66 | + "D100", # Missing docstring in public module |
| 67 | + "D104", # Missing docstring in public package |
| 68 | + "D107", # Missing docstring in `__init__` |
| 69 | + "D203", # One blank line required before class docstring |
| 70 | + "D213", # Multi-line docstring summary should start at the second line |
| 71 | + "D413", # Missing blank line after last section |
| 72 | + "EM", # flake8-errmsg |
| 73 | + "ISC001", # This rule may cause conflicts when used with the formatter |
| 74 | + "S105", # Possible hardcoded password assigned to |
| 75 | + "TRY003", # Avoid specifying long messages outside the exception class |
95 | 76 | ] |
96 | 77 |
|
97 | | -[tool.ruff.format] |
98 | | -quote-style = "single" |
99 | | -indent-style = "space" |
100 | | - |
101 | 78 | [tool.ruff.lint.per-file-ignores] |
102 | 79 | "**/__init__.py" = [ |
103 | 80 | "F401", # Unused imports |
104 | 81 | ] |
105 | | -"**/{scripts}/*" = [ |
106 | | - "D", # Everything from the pydocstyle |
107 | | - "INP001", # File {filename} is part of an implicit namespace package, add an __init__.py |
108 | | - "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable |
109 | | - "T20", # flake8-print |
110 | | -] |
111 | 82 | "**/{tests}/*" = [ |
112 | 83 | "D", # Everything from the pydocstyle |
113 | 84 | "INP001", # File {filename} is part of an implicit namespace package, add an __init__.py |
114 | | - "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable |
115 | 85 | "S101", # Use of assert detected |
116 | | - "T20", # flake8-print |
117 | | - "TRY301", # Abstract `raise` to an inner function |
118 | 86 | ] |
119 | 87 |
|
| 88 | +[tool.ruff.format] |
| 89 | +quote-style = "single" |
| 90 | +indent-style = "space" |
| 91 | + |
120 | 92 | [tool.ruff.lint.flake8-quotes] |
121 | 93 | docstring-quotes = "double" |
122 | 94 | inline-quotes = "single" |
123 | 95 |
|
124 | | -[tool.ruff.lint.isort] |
125 | | -known-local-folder = ["apify_shared"] |
| 96 | +[tool.pytest.ini_options] |
| 97 | +addopts = "-ra" |
| 98 | +asyncio_default_fixture_loop_scope = "function" |
| 99 | +asyncio_mode = "auto" |
| 100 | +timeout = 300 |
126 | 101 |
|
127 | | -[tool.ruff.lint.pydocstyle] |
128 | | -convention = "google" |
| 102 | +[tool.mypy] |
| 103 | +python_version = "3.10" |
| 104 | +files = ["src", "tests"] |
| 105 | +check_untyped_defs = true |
| 106 | +disallow_incomplete_defs = true |
| 107 | +disallow_untyped_calls = true |
| 108 | +disallow_untyped_decorators = true |
| 109 | +disallow_untyped_defs = true |
| 110 | +no_implicit_optional = true |
| 111 | +warn_redundant_casts = true |
| 112 | +warn_return_any = true |
| 113 | +warn_unreachable = true |
| 114 | +warn_unused_ignores = true |
0 commit comments