1+ [build-system ]
2+ requires = [" hatchling" ]
3+ build-backend = " hatchling.build"
4+
15[project ]
26name = " apify_shared"
37version = " 1.5.1"
48description = " Tools and constants shared across Apify projects."
5- readme = " README.md"
6- license = { text = " Apache Software License" }
79authors = [{ name = " Apify Technologies s.r.o." , email = " support@apify.com" }]
8- keywords = [" apify" , " api" , " shared" , " scraping" , " automation" ]
9-
10+ license = { file = " LICENSE" }
11+ readme = " README.md"
12+ requires-python = " >=3.10"
1013classifiers = [
1114 " Development Status :: 5 - Production/Stable" ,
1215 " Environment :: Console" ,
@@ -19,110 +22,94 @@ classifiers = [
1922 " Programming Language :: Python :: 3.13" ,
2023 " Topic :: Software Development :: Libraries" ,
2124]
22-
23- requires-python = " >=3.10"
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" ,
4734]
35+ dependencies = []
4836
4937[project .urls ]
5038"Apify Homepage" = " https://apify.com"
5139"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"
54-
55- [build-system ]
56- build-backend = " setuptools.build_meta"
57- requires = [" setuptools>=68.0.0" , " wheel" ]
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"
5843
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+ " pre-commit~=4.3.0" ,
49+ " pytest-asyncio~=1.1.0" ,
50+ " pytest-cov~=6.2.0" ,
51+ " pytest-timeout~=2.4.0" ,
52+ " pytest-xdist~=3.8.0" ,
53+ " pytest~=8.4.0" ,
54+ " ruff~=0.12.0" ,
55+ " setuptools" , # setuptools are used by pytest, but not explicitly required
6256
63- [tool .setuptools .package-data ]
64- apify_shared = [" py.typed" ]
57+ ]
6558
6659[tool .ruff ]
6760line-length = 120
61+ include = [" src/**/*.py" , " tests/**/*.py" ]
62+
63+ [tool .ruff .lint ]
6864select = [" ALL" ]
6965ignore = [
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
66+ " COM812" , # This rule may cause conflicts when used with the formatter
67+ " D100" , # Missing docstring in public module
68+ " D104" , # Missing docstring in public package
69+ " D107" , # Missing docstring in `__init__`
70+ " D203" , # One blank line required before class docstring
71+ " D213" , # Multi-line docstring summary should start at the second line
72+ " D413" , # Missing blank line after last section
73+ " EM" , # flake8-errmsg
74+ " ISC001" , # This rule may cause conflicts when used with the formatter
75+ " S105" , # Possible hardcoded password assigned to
76+ " TRY003" , # Avoid specifying long messages outside the exception class
9577]
9678
97- [tool .ruff .format ]
98- quote-style = " single"
99- indent-style = " space"
100-
10179[tool .ruff .lint .per-file-ignores ]
10280"**/__init__.py" = [
10381 " F401" , # Unused imports
10482]
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- ]
11183"**/{tests}/*" = [
11284 " D" , # Everything from the pydocstyle
11385 " 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
11586 " S101" , # Use of assert detected
116- " T20" , # flake8-print
117- " TRY301" , # Abstract `raise` to an inner function
11887]
11988
89+ [tool .ruff .format ]
90+ quote-style = " single"
91+ indent-style = " space"
92+
12093[tool .ruff .lint .flake8-quotes ]
12194docstring-quotes = " double"
12295inline-quotes = " single"
12396
124- [tool .ruff .lint .isort ]
125- known-local-folder = [" apify_shared" ]
97+ [tool .pytest .ini_options ]
98+ addopts = " -ra"
99+ asyncio_default_fixture_loop_scope = " function"
100+ asyncio_mode = " auto"
101+ timeout = 300
126102
127- [tool .ruff .lint .pydocstyle ]
128- convention = " google"
103+ [tool .mypy ]
104+ python_version = " 3.10"
105+ files = [" src" , " tests" ]
106+ check_untyped_defs = true
107+ disallow_incomplete_defs = true
108+ disallow_untyped_calls = true
109+ disallow_untyped_decorators = true
110+ disallow_untyped_defs = true
111+ no_implicit_optional = true
112+ warn_redundant_casts = true
113+ warn_return_any = true
114+ warn_unreachable = true
115+ warn_unused_ignores = true
0 commit comments