"""Setup steps for installing SeleniumBase dependencies and plugins. (Uses selenium 4.x and is compatible with Python 3.10+)""" from setuptools import setup, find_packages # noqa: F401 import os import sys this_dir = os.path.abspath(os.path.dirname(__file__)) long_description = None total_description = None try: with open(os.path.join(this_dir, "README.md"), mode="rb") as f: total_description = f.read().decode("utf-8") description_lines = total_description.split("\n") long_description_lines = [] for line in description_lines: if not line.startswith("=3.10") print("You are currently using Python %s\n" % current_ver) sys.exit() print("\n*** Checking code health with flake8:\n") os.system("python -m pip install 'flake8==7.4.1'") flake8_status = os.system( "flake8 --exclude=recordings,temp,venv,.venv" ) if flake8_status != 0: print("\nERROR! Fix flake8 issues before publishing to PyPI!\n") sys.exit() else: print("*** No flake8 issues detected. Continuing...") print("\n*** Removing existing distribution packages: ***\n") os.system("rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl") os.system("rm -rf build/bdist.*; rm -rf build/lib") print("\n*** Installing build: *** (Required for PyPI uploads)\n") os.system("python -m pip install --upgrade 'build'") print("\n*** Installing pkginfo: *** (Required for PyPI uploads)\n") os.system("python -m pip install --upgrade 'pkginfo'") print("\n*** Installing readme-renderer: *** (For PyPI uploads)\n") os.system("python -m pip install --upgrade 'readme-renderer'") print("\n*** Installing jaraco.classes: *** (For PyPI uploads)\n") os.system("python -m pip install --upgrade 'jaraco.classes'") print("\n*** Installing more-itertools: *** (For PyPI uploads)\n") os.system("python -m pip install --upgrade 'more-itertools'") print("\n*** Installing keyring, requests-toolbelt: *** (For PyPI)\n") os.system("python -m pip install --upgrade keyring requests-toolbelt") print("\n*** Installing twine: *** (Required for PyPI uploads)\n") os.system("python -m pip install --upgrade 'twine'") print("\n*** Rebuilding distribution packages: ***\n") os.system("python -m build") # Create new tar/wheel print("\n*** Publishing The Release to PyPI: ***\n") os.system("python -m twine upload dist/*") # Requires ~/.pypirc Keys print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n") else: print("\n>>> The Release was NOT PUBLISHED to PyPI! <<<\n") sys.exit() setup( name="seleniumbase", version=about["__version__"], description=( "SeleniumBase is a framework for web crawling, scraping, and testing. " "Supports pytest. CDP Mode adds stealth. Includes many tools." ), long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/seleniumbase/SeleniumBase", project_urls={ "Homepage": "https://github.com/seleniumbase/SeleniumBase", "Changelog": "https://github.com/seleniumbase/SeleniumBase/releases", "Download": "https://pypi.org/project/seleniumbase/#files", "Blog": "https://seleniumbase.com/", "Discord": "https://discord.gg/EdhQTn3EyE", "PyPI": "https://pypi.org/project/seleniumbase/", "Source": "https://github.com/seleniumbase/SeleniumBase", "Repository": "https://github.com/seleniumbase/SeleniumBase", "Documentation": "https://seleniumbase.io/", }, platforms=["Windows", "Linux", "Mac OS-X"], author="Michael Mintz", author_email="mdmintz@gmail.com", maintainer="Michael Mintz", license="MIT", keywords=[ "cdp", "mcp", "pytest", "selenium", "framework", "automation", "browser", "testing", "webdriver", "seleniumbase", "sbase", "web-crawling", "web-scraping", "stealth", "chromium", "playwright", "anti-detection", "captcha-bypass", "ai-agent", "llm-tools", "model-context-protocol", ], classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Environment :: Web Environment", "Framework :: Pytest", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP :: Browsers", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Image Processing", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing", "Topic :: Software Development :: Testing :: Acceptance", "Topic :: Software Development :: Testing :: Traffic Generation", "Topic :: Utilities", ], python_requires=">=3.10", install_requires=[ 'pip>=26.2.1', 'packaging>=26.3', 'setuptools>=84.0.0', 'wheel>=0.48.0', 'attrs>=26.1.0', 'certifi>=2026.7.22', 'exceptiongroup>=1.3.1', 'websockets~=16.1.1;python_version=="3.10"', 'websockets>=16.1.1;python_version>="3.11"', 'filelock>=4.0.8', 'fasteners>=0.20', 'mycdp>=1.4.0', 'pynose>=1.5.5', 'typing-extensions>=4.16.0', 'sbvirtualdisplay>=1.4.0', 'MarkupSafe>=3.0.3', 'Jinja2>=3.1.6', 'six>=1.17.0', 'parse>=1.22.2', 'parse-type>=0.6.6', 'colorama>=0.4.6', 'psutil>=7.2.2', 'pyyaml>=6.0.3', 'pygments>=2.20.1', 'pyreadline3>=3.5.4;platform_system=="Windows"', 'tabcompleter>=1.4.1', 'pdbp>=1.8.3', 'idna>=3.20', 'charset-normalizer>=3.5.2,<4', 'urllib3>=2.8.0,<3', 'requests~=2.34.2', 'sniffio==1.3.1', 'h11==0.16.0', 'outcome==1.3.0.post0', 'trio>=0.34.0,<1', 'trio-websocket~=0.12.2', 'wsproto~=1.3.2', 'websocket-client~=1.9.2', 'selenium==4.50.0', 'cssselect>=1.5.0,<2', 'sortedcontainers==2.4.0', 'execnet==2.1.2', 'iniconfig==2.3.0', 'pluggy==1.6.0', 'pytest==8.4.2;python_version<"3.11"', 'pytest==9.1.1;python_version>="3.11"', 'pytest-html==4.0.2', # Newer ones had issues 'pytest-metadata==3.1.1', 'pytest-ordering==0.6', 'pytest-rerunfailures==16.3;python_version=="3.10"', 'pytest-rerunfailures==16.7;python_version>="3.11"', 'pytest-xdist==3.8.0', 'parameterized==0.9.0', 'behave==1.2.6', # Newer ones had issues 'soupsieve~=2.10.0', 'beautifulsoup4~=4.15.0', 'pyotp~=2.10.0', 'python-xlib==0.33;platform_system=="Linux"', 'PyAutoGUI>=0.9.54;platform_system=="Linux"', 'markdown-it-py==4.2.0', 'mdurl==0.1.2', 'rich>=15.0.0,<16', ], extras_require={ # pip install -e .[allure] # Usage: pytest --alluredir=allure_results # Serve: allure serve allure_results "allure": [ 'allure-pytest>=2.16.0', 'allure-python-commons>=2.16.0', 'allure-behave>=2.16.0', ], # pip install -e .[coverage] # Usage: coverage run -m pytest; coverage html; coverage report "coverage": [ 'coverage>=7.16.2', 'pytest-cov>=7.1.0', ], # pip install -e .[flake8] # Usage: flake8 "flake8": [ 'flake8==7.4.1', 'mccabe==0.7.0', 'pyflakes==4.0.1', 'pycodestyle==2.15.0', ], # pip install -e .[mcp] # (Adds the "seleniumbase-mcp" console script: An MCP server that # exposes SeleniumBase's Pure CDP Mode as tools for MCP clients. # Example usage: `mcp dev server.py`) "mcp": [ "mcp[cli]>=2.2.0,<3.0.0", ], # pip install -e .[mss] # (An optional library for tile_windows() in CDP Mode.) "mss": [ 'mss==10.2.0', ], # pip install -e .[pdfminer] # (An optional library for parsing PDF files.) "pdfminer": [ 'pdfminer.six==20260107', 'cryptography==50.0.2', 'cffi==2.1.1', 'pycparser==3.0', ], # pip install -e .[pillow] # (An optional library for image-processing.) "pillow": [ 'Pillow>=12.3.0', ], # pip install -e .[pip-system-certs] # (If you see [SSL: CERTIFICATE_VERIFY_FAILED], then get this.) # (May help those with corporate self-signed certs on Windows.) "pip-system-certs": [ 'pip-system-certs>=4.0;platform_system=="Windows"', ], # pip install -e .[proxy] # Usage: proxy # (That starts a proxy server on "127.0.0.1:8899".) "proxy": [ 'proxy.py==2.4.3', # 2.4.4 did not have "Listening on ..." ], # pip install -e .[playwright] # (For the Playwright integration.) "playwright": [ 'playwright>=1.63.0', 'greenlet>=3.5.6', 'pyee>=13.0.1', ], # pip install -e .[pyautogui] # (Already a required dependency on Linux now.) "pyautogui": [ 'PyAutoGUI>=0.9.54;platform_system!="Linux"', ], # pip install -e .[uv] # (For the MCP integration and more.) "uv": [ "uv>=0.12.21" ], }, packages=[ "seleniumbase", "sbase", "mcp_servers", "seleniumbase.behave", "seleniumbase.common", "seleniumbase.config", "seleniumbase.console_scripts", "seleniumbase.core", "seleniumbase.drivers", "seleniumbase.drivers.cft_drivers", "seleniumbase.drivers.chs_drivers", "seleniumbase.drivers.opera_drivers", "seleniumbase.drivers.brave_drivers", "seleniumbase.drivers.comet_drivers", "seleniumbase.drivers.chromium_drivers", "seleniumbase.extensions", "seleniumbase.fixtures", "seleniumbase.js_code", "seleniumbase.masterqa", "seleniumbase.plugins", "seleniumbase.resources", "seleniumbase.translate", "seleniumbase.undetected", "seleniumbase.undetected.cdp_driver", "seleniumbase.utilities", "seleniumbase.utilities.selenium_grid", "seleniumbase.utilities.selenium_ide", ], include_package_data=True, entry_points={ "console_scripts": [ "seleniumbase = seleniumbase.console_scripts.run:main", "sbase = seleniumbase.console_scripts.run:main", # Simplified name "seleniumbase-mcp = mcp_servers.server:main", # Requires [mcp] ], "nose.plugins": [ "base_plugin = seleniumbase.plugins.base_plugin:Base", "selenium = seleniumbase.plugins.selenium_plugin:SeleniumBrowser", "page_source = seleniumbase.plugins.page_source:PageSource", "screen_shots = seleniumbase.plugins.screen_shots:ScreenShots", "test_info = seleniumbase.plugins.basic_test_info:BasicTestInfo", ( "db_reporting = " "seleniumbase.plugins.db_reporting_plugin:DBReporting" ), "s3_logging = seleniumbase.plugins.s3_logging_plugin:S3Logging", ], "pytest11": ["seleniumbase = seleniumbase.plugins.pytest_plugin"], }, ) # print(os.system("cat seleniumbase.egg-info/PKG-INFO")) print("\n*** SeleniumBase Installation Complete! ***\n")