1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
[build-system]
requires = ["setuptools", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[project]
name = "selenium"
version = "4.33.0"
license = { text = "Apache 2.0" }
description = "Official Python bindings for Selenium WebDriver."
readme = "README.rst"
requires-python = "~=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"urllib3[socks]~=2.4.0",
"trio~=0.30.0",
"trio-websocket~=0.12.2",
"certifi>=2025.4.26",
"typing_extensions~=4.13.2",
"websocket-client~=1.8.0",
]
[project.urls]
homepage = "https://www.selenium.dev"
source = "https://github.com/SeleniumHQ/selenium/tree/trunk/py"
download = "https://pypi.org/project/selenium"
changelog = "https://github.com/SeleniumHQ/selenium/blob/trunk/py/CHANGES"
documentation = "https://www.selenium.dev/documentation/webdriver"
issues = "https://github.com/SeleniumHQ/selenium/issues"
[tool.setuptools]
zip-safe = false
[tool.setuptools.packages.find]
include = ["selenium*"]
exclude = ["test*"]
namespaces = true
# include-package-data is `true` by default in pyproject.toml
[[tool.setuptools-rust.bins]]
target = "selenium.webdriver.common.selenium-manager"
[tool.setuptools.package-data]
"*" = [
"*.py",
"*.rst",
"*.json",
"*.xpi",
"*.js",
"py.typed",
"prune*",
"selenium.egg-info*",
"selenium-manager",
"selenium-manager.exe",
"CHANGES",
"LICENSE"
]
[tool.pytest.ini_options]
console_output_style = "progress"
faulthandler_timeout = 60
log_cli = true
trio_mode = true
markers = [
"xfail_chrome: Tests expected to fail in Chrome",
"xfail_edge: Tests expected to fail in Edge",
"xfail_firefox: Tests expected to fail in Firefox",
"xfail_ie: Tests expected to fail in IE",
"xfail_remote: Tests expected to fail with Remote webdriver",
"xfail_safari: Tests expected to fail in Safari",
"xfail_webkitgtk: Tests expected to fail in WebKitGTK",
"xfail_wpewebkit: Tests expected to fail in WPEWebKit",
"no_driver_after_test: If there are no drivers after the test it will create a new one."
]
python_files = ["test_*.py", "*_test.py", "*_tests.py"]
testpaths = ["test"]
# mypy global options
[tool.mypy]
exclude = "selenium/webdriver/common/devtools"
# The aim in future here is we would be able to turn (most) of these flags on, however the typing technical
# debt is quite colossal right now. For now we should maybe get everything working with the config here
# then look at going after partially or completely untyped defs as a phase-2.
files = "selenium"
# warn about per-module sections in the config file that do not match any files processed.
warn_unused_configs = true
# disallows subclassing of typing.Any.
disallow_subclassing_any = false
# disallow usage of generic types that do not specify explicit type parameters.
disallow_any_generics = false
# disallow calling functions without type annotations from functions that have type annotations.
disallow_untyped_calls = false
# disallow defining functions without type annotations or with incomplete annotations.
disallow_untyped_defs = false
# disallow defining functions with incomplete type annotations.
disallow_incomplete_defs = false
# type-checks the interior of functions without type annotations.
check_untyped_defs = false
# reports an error whenever a function with type annotations is decorated with a decorator without annotations.
disallow_untyped_decorators = false
# changes the treatment of arguments with a default value of None by not implicitly making their type `typing.Optional`.
no_implicit_optional = false
# warns about casting an expression to it's inferred type.
warn_redundant_casts = true
# warns about unneeded `# type: ignore` comments.
warn_unused_ignores = true
# warns when returning a value with typing.Any from a function with a non typing.Any return type.
warn_return_any = false
# Shows a warning when encountering any code inferred to be unreachable after performing type analysis.
warn_unreachable = false
# mypy module specific options
[[tool.mypy.trio_websocket]]
# suppress error messages about imports that cannot be resolved.
ignore_missing_imports = true
[[tool.mypy._winreg]]
# suppress error messages about imports that cannot be resolved.
ignore_missing_imports = true
[tool.ruff]
extend-exclude = [
"selenium/webdriver/common/devtools/",
"generate.py",
]
line-length = 120
respect-gitignore = true
target-version = "py39"
[tool.ruff.lint]
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022"]
fixable = ["ALL"]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 120
|