[project]

name = "grab"
version = "1.2.0"
description = "Web scraping framework"
readme = "README.md"
requires-python = ">=2.7"
license = "MIT"
license-files = ["LICENSE"]
keywords = ["pycurl", "multicurl", "curl", "network", "parsing", "grabbing",  "scraping"]
authors = [
    {name = "Gregory Petukhov", email = "lorien@lorien.name"}
]
# https://pypi.org/pypi?%3Aaction=list_classifiers
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 2",
    "Programming Language :: Python :: 2.7",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.0",
    "Programming Language :: Python :: 3.1",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.2",
    "Programming Language :: Python :: 3.3",
    "Programming Language :: Python :: 3.4",
    "Programming Language :: Python :: 3.5",
    "Programming Language :: Python :: 3.6",
    "Programming Language :: Python :: 3.7",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: Implementation :: CPython",
    "Topic :: Internet :: WWW/HTTP",
    "Topic :: Software Development :: Libraries :: Application Frameworks",
    "Topic :: Software Development :: Libraries :: Python Modules",
    #"Typing :: Typed",
]
dependencies = [
        "six",
        "user_agent",
        "selection>=2.0.1",
        'lxml;platform_system != "Windows" or python_version >= "3.13"',
        'pycurl;platform_system != "Windows" or python_version >= "3.13"',
        "defusedxml",
        'typing-extensions; python_version <= "2.7"',
        'unicodec>=0.2.0',
]
[project.optional-dependencies]
full = ["urllib3", "certifi"] # deprecated
urllib3 = ["urllib3", "certifi"]
pyquery = [
    'pyquery; platform_system != "Windows" and python_version >= "3.0"',
    'pyquery; platform_system == "Windows" and python_version >= "3.13"',
    'pyquery <= 1.4.1; platform_system != "Windows" and python_version <= "2.7"',
]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project.urls]
homepage = "http://github.com/lorien/grab"

[tool.setuptools]
packages=[
    "grab",
    "grab.script",
    "grab.spider",
    "grab.spider.cache_backend",
    "grab.spider.queue_backend",
    "grab.spider.network_service",
    "grab.transport",
    "grab.util",
]

[tool.setuptools.package-data]
#"*" = ["py.typed"]
#"user_agent.data" = ["*.json"]

[tool.isort]
profile = "black"
line_length = 88
# skip_gitignore = true # throws errors in stderr when ".git" dir does not exist

[tool.pylint.main]
jobs=4
extension-pkg-whitelist="lxml"
disable="missing-docstring,broad-except,too-few-public-methods,consider-using-f-string,fixme"
variable-rgx="[a-z_][a-z0-9_]{1,30}$"
attr-rgx="[a-z_][a-z0-9_]{1,30}$"
argument-rgx="[a-z_][a-z0-9_]{1,30}$"
max-line-length=88
max-args=9
load-plugins=[
    "pylint.extensions.check_elif",
    "pylint.extensions.comparison_placement",
    "pylint.extensions.consider_ternary_expression",
    "pylint.extensions.docstyle",
    "pylint.extensions.for_any_all",
    "pylint.extensions.overlapping_exceptions",
    "pylint.extensions.redefined_loop_name",
    "pylint.extensions.redefined_variable_type",
    "pylint.extensions.set_membership",
    "pylint.extensions.typing",
]

[tool.pytest.ini_options]
testpaths = ["tests"]


[tool.ruff]
lint.select = ["ALL"]
lint.ignore = [
    # py27 compat begins
    "ANN001", # Missing type annotation for function argument
    "ANN201", # Missing return type annotation for public function
    #"ANN003", # Missing type annotation for `**kwargs`
    "ANN202", # Missing return type annotation for private function
    #"ANN204", # Missing return type annotation for special method
    #"B904", # Use `raise from` to specify exception cause
    #"B904", # Within an `except` clause, raise exceptions with `raise ... from err`
    #"UP025", # Remove unicode literals from strings
    #"UP004", # Class inherits from `object`
    ## or `raise ... from None` to distinguish them from errors in exception handling
    #"UP009", # UTF-8 encoding declaration is unnecessary
    #"UP035", # Import from `collections.abc` instead
    #"UP013", # Convert from `TypedDict` functional to class syntax
    # py27 compat ends
    "A003", # Class attribute `type` is shadowing a python builtin
    "ANN401", # Dynamically typed expressions (typing.Any) are disallowed
    "BLE001", # Do not catch blind exception: `Exception`
    "COM812", # Trailing comma missing
    "D100", # Missing docstring in public module
    "D101", # Missing docstring in public class
    "D102", # Missing docstring in public method1
    "D103", # Missing docstring in public function
    "D104", # Missing docstring in public package
    "D105", # Missing docstring in magic method,
    "D107", # Missing docstring in `__init__`
    "D203", # 1 blank line required before class docstring
    "D213", # Multi-line docstring summary should start at the second line
    "EM101", # Check for raw usage of a string literal in Exception raising
    "EM102", # Check for raw usage of an f-string literal in Exception raising
    "EM103", # Check for raw usage of .format on a string literal in Exception raising
    "F401", # Imported but unused
    "FBT", # Boolean arg/value in function definition
    "PTH", # A plugin finding use of functions that can be replaced by pathlib module
    "S101", # Use of `assert` detected
    "T201", # print found	
    "T203", # pprint found
    "TCH", # Move import into a type-checking block
    "TRY003", # Avoid specifying long messages outside the exception class
    "UP032", # Use f-string instead of format call
    "ERA001", # Found commented-out code
    "RUF001", # String contains ambiguous unicode character
    "TD002", # Missing author in TODO
    "TD003", # Missing issue link on the line following this TODO
    "FIX002", # Line contains TODO
    "RUF003", # Comment contains ambiguous
    "RUF012", # Mutable class attributes should be annotated
    "TRY400", #  Use `logging.exception` instead of `logging.error`
    "PERF401", # Use a list comprehension to create a transformed list
    "RUF100", # [*] Unused `noqa` directive
]
lint.pylint.max-args=9
target-version = "py37"
extend-exclude = ["var"]
