SeleniumBase/setup.py

337 lines
14 KiB
Python
Raw Normal View History

2023-01-19 13:07:06 +08:00
"""Setup steps for installing SeleniumBase dependencies and plugins.
(Uses selenium 4.x and is compatible with Python 3.6+)"""
2021-05-11 07:18:44 +08:00
from setuptools import setup, find_packages # noqa: F401
import os
import sys
2018-08-28 10:21:10 +08:00
this_dir = os.path.abspath(os.path.dirname(__file__))
2018-08-28 10:21:10 +08:00
long_description = None
2020-05-18 13:21:24 +08:00
total_description = None
2018-08-28 10:21:10 +08:00
try:
2021-05-04 10:38:13 +08:00
with open(os.path.join(this_dir, "README.md"), "rb") as f:
total_description = f.read().decode("utf-8")
description_lines = total_description.split("\n")
2020-05-18 13:21:24 +08:00
long_description_lines = []
for line in description_lines:
if not line.startswith("<meta ") and not line.startswith("<link "):
long_description_lines.append(line)
long_description = "\n".join(long_description_lines)
2018-08-28 10:21:10 +08:00
except IOError:
2021-02-01 04:28:45 +08:00
long_description = "A complete library for building end-to-end tests."
about = {}
# Get the package version from the seleniumbase/__version__.py file
2021-05-04 10:38:13 +08:00
with open(os.path.join(this_dir, "seleniumbase", "__version__.py"), "rb") as f:
exec(f.read().decode("utf-8"), about)
2015-12-05 05:11:53 +08:00
2021-05-04 10:38:13 +08:00
if sys.argv[-1] == "publish":
reply = None
input_method = input
2021-05-04 10:38:13 +08:00
confirm_text = ">>> Confirm release PUBLISH to PyPI? (yes/no): "
reply = str(input_method(confirm_text)).lower().strip()
if reply == "yes":
print("\n*** Checking code health with flake8:\n")
2022-12-17 06:26:22 +08:00
if sys.version_info >= (3, 9):
os.system("python -m pip install 'flake8==6.0.0'")
else:
os.system("python -m pip install 'flake8==5.0.4'")
2021-09-20 15:21:52 +08:00
flake8_status = os.system("flake8 --exclude=recordings,temp")
if flake8_status != 0:
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
sys.exit()
else:
print("*** No flake8 issues detected. Continuing...")
2021-11-18 08:35:46 +08:00
print("\n*** Removing existing distribution packages: ***\n")
2021-05-04 10:38:13 +08:00
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")
2021-11-18 08:35:46 +08:00
print("\n*** Installing build: *** (Required for PyPI uploads)\n")
2023-01-13 13:51:05 +08:00
os.system("python -m pip install --upgrade 'build>=0.10.0'")
print("\n*** Installing pkginfo: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'pkginfo>=1.9.6'")
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'twine>=4.0.2'")
2020-05-03 10:47:59 +08:00
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
2022-09-06 04:03:48 +08:00
os.system("python -m pip install --upgrade tqdm")
2021-11-18 08:35:46 +08:00
print("\n*** Rebuilding distribution packages: ***\n")
os.system("python -m build") # Create new tar/wheel
print("\n*** Publishing The Release to PyPI: ***\n")
2021-05-04 10:38:13 +08:00
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()
2015-12-05 05:11:53 +08:00
setup(
2021-05-04 10:38:13 +08:00
name="seleniumbase",
version=about["__version__"],
description="A complete web automation framework for end-to-end testing.",
2018-08-28 10:21:10 +08:00
long_description=long_description,
2021-05-04 10:38:13 +08:00
long_description_content_type="text/markdown",
url="https://github.com/seleniumbase/SeleniumBase",
2021-05-01 06:13:38 +08:00
project_urls={
"Changelog": "https://github.com/seleniumbase/SeleniumBase/releases",
2021-05-04 10:38:13 +08:00
"Download": "https://pypi.org/project/seleniumbase/#files",
2021-05-01 06:13:38 +08:00
"Gitter": "https://gitter.im/seleniumbase/SeleniumBase",
"Blog": "https://seleniumbase.com/",
"PyPI": "https://pypi.org/project/seleniumbase/",
2021-05-04 10:38:13 +08:00
"Source": "https://github.com/seleniumbase/SeleniumBase",
"Documentation": "https://seleniumbase.io/",
2021-05-01 06:13:38 +08:00
},
2020-05-03 10:30:18 +08:00
platforms=["Windows", "Linux", "Mac OS-X"],
2021-05-04 10:38:13 +08:00
author="Michael Mintz",
author_email="mdmintz@gmail.com",
maintainer="Michael Mintz",
2018-08-28 06:36:52 +08:00
license="MIT",
2022-01-09 09:30:43 +08:00
keywords="pytest automation selenium browser testing webdriver sbase",
2018-08-28 06:36:52 +08:00
classifiers=[
"Development Status :: 5 - Production/Stable",
2020-10-14 13:24:16 +08:00
"Environment :: Console",
"Environment :: MacOS X",
"Environment :: Win32 (MS Windows)",
"Environment :: Web Environment",
2020-05-03 10:30:18 +08:00
"Framework :: Pytest",
2019-06-26 15:31:45 +08:00
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
2020-05-03 10:30:18 +08:00
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
2018-08-28 06:36:52 +08:00
"Operating System :: Microsoft :: Windows",
2020-05-03 10:30:18 +08:00
"Operating System :: POSIX :: Linux",
2018-08-28 06:36:52 +08:00
"Programming Language :: Python",
2020-09-24 00:53:38 +08:00
"Programming Language :: Python :: 3",
2018-08-28 06:36:52 +08:00
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
2020-09-24 00:53:38 +08:00
"Programming Language :: Python :: 3.9",
2021-09-01 12:39:18 +08:00
"Programming Language :: Python :: 3.10",
2022-06-27 00:17:37 +08:00
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
2020-05-03 10:30:18 +08:00
"Topic :: Internet",
2021-12-24 05:07:15 +08:00
"Topic :: Internet :: WWW/HTTP :: Browsers",
2020-05-03 10:30:18 +08:00
"Topic :: Scientific/Engineering",
2022-01-12 11:41:50 +08:00
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Visualization",
2020-05-03 10:30:18 +08:00
"Topic :: Software Development",
"Topic :: Software Development :: Quality Assurance",
2022-01-12 11:41:50 +08:00
"Topic :: Software Development :: Code Generators",
2020-05-03 10:30:18 +08:00
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Acceptance",
"Topic :: Software Development :: Testing :: Traffic Generation",
"Topic :: Utilities",
2018-08-28 06:36:52 +08:00
],
2022-12-31 17:28:03 +08:00
python_requires=">=3.6",
install_requires=[
2023-01-20 11:54:51 +08:00
'pip>=21.3.1;python_version<"3.7"',
2023-04-27 04:14:02 +08:00
'pip>=23.1.2;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'packaging>=21.3;python_version<"3.7"',
2023-04-16 01:19:54 +08:00
'packaging>=23.1;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'setuptools>=59.6.0;python_version<"3.7"',
2023-04-27 04:14:02 +08:00
'setuptools>=67.7.2;python_version>="3.7"',
2023-02-03 14:43:24 +08:00
'keyring>=23.4.1;python_version<"3.8"',
'keyring>=23.13.1;python_version>="3.8"',
2023-01-20 11:54:51 +08:00
'tomli>=1.2.3;python_version<"3.7"',
2022-02-10 07:54:35 +08:00
'tomli>=2.0.1;python_version>="3.7"',
2023-03-04 14:17:23 +08:00
'tqdm>=4.64.1;python_version<"3.7"',
'tqdm>=4.65.0;python_version>="3.7"',
2022-11-05 10:19:06 +08:00
'wheel>=0.37.1;python_version<"3.7"',
2023-03-15 03:23:24 +08:00
'wheel>=0.40.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'attrs==22.1.0;python_version<"3.7"',
2023-04-19 13:53:54 +08:00
'attrs>=23.1.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
"PyYAML>=6.0",
"certifi>=2022.12.7",
'filelock>=3.4.1;python_version<"3.7"',
2023-04-19 13:53:54 +08:00
'filelock>=3.12.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'platformdirs>=2.4.0;python_version<"3.7"',
2023-04-29 11:40:19 +08:00
'platformdirs>=3.5.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'pyparsing>=3.0.7;python_version<"3.7"',
2023-04-09 09:16:25 +08:00
'pyparsing>=3.0.9;python_version>="3.7"',
2023-02-06 13:56:01 +08:00
'zipp==3.6.0;python_version<"3.7"',
2023-03-01 15:13:05 +08:00
'zipp>=3.15.0;python_version>="3.7"',
'more-itertools==8.14.0;python_version<"3.7"',
'more-itertools>=9.1.0;python_version>="3.7"',
2021-05-06 09:07:45 +08:00
"six==1.16.0",
2023-01-20 11:54:51 +08:00
"idna==3.4",
'chardet==4.0.0;python_version<"3.7"',
2023-04-27 04:14:02 +08:00
'chardet==5.1.0;python_version>="3.7"',
2023-01-13 13:51:46 +08:00
'charset-normalizer==2.0.12;python_version<"3.7"',
2023-04-27 04:14:02 +08:00
'charset-normalizer==3.1.0;python_version>="3.7"',
2022-11-30 15:49:37 +08:00
'urllib3==1.26.12;python_version<"3.7"',
2023-03-11 13:20:44 +08:00
'urllib3==1.26.15;python_version>="3.7"',
2022-07-12 04:01:35 +08:00
'requests==2.27.1;python_version<"3.7"',
2023-04-27 04:14:02 +08:00
'requests==2.29.0;python_version>="3.7"',
2023-05-02 12:51:26 +08:00
'requests-toolbelt==1.0.0',
"pynose==1.4.3",
2022-09-02 04:29:12 +08:00
'sniffio==1.3.0;python_version>="3.7"',
2022-09-26 11:22:00 +08:00
'h11==0.14.0;python_version>="3.7"',
2022-06-16 01:41:36 +08:00
'outcome==1.2.0;python_version>="3.7"',
2022-09-29 07:49:31 +08:00
'trio==0.22.0;python_version>="3.7"',
2023-03-22 09:53:14 +08:00
'trio-websocket==0.10.2;python_version>="3.7"',
2023-03-28 12:02:41 +08:00
'pyopenssl==23.1.1;python_version>="3.7"',
2022-08-24 09:15:12 +08:00
'wsproto==1.2.0;python_version>="3.7"',
2021-11-16 02:54:18 +08:00
'selenium==3.141.0;python_version<"3.7"',
2023-04-21 11:20:43 +08:00
'selenium==4.9.0;python_version>="3.7"',
'msedge-selenium-tools==3.141.3;python_version<"3.7"',
2022-10-30 10:04:23 +08:00
'cssselect==1.1.0;python_version<"3.7"',
'cssselect==1.2.0;python_version>="3.7"',
2021-11-16 04:19:42 +08:00
"sortedcontainers==2.4.0",
2023-01-20 11:54:51 +08:00
'fasteners==0.17.3;python_version<"3.7"',
2022-09-15 01:56:51 +08:00
'fasteners==0.18;python_version>="3.7"',
2021-06-18 23:52:43 +08:00
"execnet==1.9.0",
2023-01-13 13:51:46 +08:00
'iniconfig==1.1.1;python_version<"3.7"',
'iniconfig==2.0.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
"pluggy==1.0.0",
"py==1.11.0",
2023-01-13 13:51:46 +08:00
'pytest==7.0.1;python_version<"3.7"',
2023-04-16 01:19:54 +08:00
'pytest==7.3.1;python_version>="3.7"',
2023-02-18 15:10:17 +08:00
'pytest-forked==1.4.0;python_version<"3.7"',
'pytest-forked==1.6.0;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
"pytest-html==2.0.1", # Newer ones had issues
2023-01-13 13:51:46 +08:00
'pytest-metadata==1.11.0;python_version<"3.7"',
2022-11-02 14:25:49 +08:00
'pytest-metadata==2.0.4;python_version>="3.7"',
"pytest-ordering==0.6",
2023-01-13 13:51:46 +08:00
'pytest-rerunfailures==10.3;python_version<"3.7"',
2023-03-10 05:04:40 +08:00
'pytest-rerunfailures==11.1.2;python_version>="3.7"',
2023-01-13 13:51:46 +08:00
'pytest-xdist==2.5.0;python_version<"3.7"',
2023-03-12 23:38:36 +08:00
'pytest-xdist==3.2.1;python_version>="3.7"',
2023-03-28 04:35:21 +08:00
'parameterized==0.8.1;python_version<"3.7"',
'parameterized==0.9.0;python_version>="3.7"',
2023-02-06 13:56:01 +08:00
"sbvirtualdisplay==1.2.0",
2022-05-14 06:18:28 +08:00
"behave==1.2.6",
2023-02-18 15:10:17 +08:00
'soupsieve==2.3.2.post1;python_version<"3.7"',
2023-04-19 13:53:54 +08:00
'soupsieve==2.4.1;python_version>="3.7"',
2023-04-09 09:16:25 +08:00
"beautifulsoup4==4.12.2",
2023-01-20 11:54:51 +08:00
'cryptography==36.0.2;python_version<"3.7"',
2023-04-16 01:19:54 +08:00
'cryptography==40.0.2;python_version>="3.7"',
2023-04-11 11:46:43 +08:00
'pygments==2.14.0;python_version<"3.7"',
2023-04-19 13:53:54 +08:00
'pygments==2.15.1;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
'pyreadline3==3.4.1;platform_system=="Windows"',
2023-04-19 13:53:54 +08:00
"tabcompleter==1.2.0",
2023-04-27 04:14:02 +08:00
"pdbp==1.4.0",
2023-01-20 11:54:51 +08:00
'colorama==0.4.5;python_version<"3.7"',
2022-10-25 14:33:42 +08:00
'colorama==0.4.6;python_version>="3.7"',
2023-03-15 03:23:24 +08:00
'exceptiongroup==1.1.1;python_version>="3.7"',
2023-04-11 11:46:43 +08:00
'future-breakpoint==2.0.0;python_version<"3.7"',
2023-01-20 11:54:51 +08:00
'importlib-metadata==4.2.0;python_version<"3.8"',
2021-11-09 01:49:40 +08:00
"pycparser==2.21",
2023-01-20 11:54:51 +08:00
'pyotp==2.7.0;python_version<"3.7"',
2022-12-17 06:34:11 +08:00
'pyotp==2.8.0;python_version>="3.7"',
2022-07-01 03:23:27 +08:00
"cffi==1.15.1",
2023-01-20 11:54:51 +08:00
'typing-extensions==4.1.1;python_version<"3.7"',
2023-03-28 04:35:21 +08:00
'typing-extensions==4.5.0;python_version>="3.7" and python_version<"3.9"', # noqa: E501
2023-01-20 11:54:51 +08:00
'commonmark==0.9.1;python_version<"3.7"', # For old "rich"
2023-02-23 10:43:18 +08:00
'markdown-it-py==2.2.0;python_version>="3.7"', # For new "rich"
2023-01-20 11:54:51 +08:00
'mdurl==0.1.2;python_version>="3.7"', # For new "rich"
'rich==12.6.0;python_version<"3.7"',
2023-04-29 11:40:19 +08:00
'rich==13.3.5;python_version>="3.7"',
2018-08-30 13:57:40 +08:00
],
extras_require={
2023-03-01 15:13:05 +08:00
# pip install -e .[allure]
# Usage: pytest --alluredir=allure_results
# Serve: allure serve allure_results
"allure": [
'allure-pytest==2.9.45;python_version<"3.7"',
2023-04-29 11:40:19 +08:00
'allure-pytest==2.13.2;python_version>="3.7"',
2023-03-01 15:13:05 +08:00
'allure-python-commons==2.9.45;python_version<"3.7"',
2023-04-29 11:40:19 +08:00
'allure-python-commons==2.13.2;python_version>="3.7"',
2023-03-01 15:13:05 +08:00
'allure-behave==2.9.45;python_version<"3.7"',
2023-04-29 11:40:19 +08:00
'allure-behave==2.13.2;python_version>="3.7"',
2023-03-01 15:13:05 +08:00
],
# pip install -e .[coverage]
2022-03-18 11:51:24 +08:00
# Usage: coverage run -m pytest; coverage html; coverage report
"coverage": [
2023-01-20 11:54:51 +08:00
'coverage==6.2;python_version<"3.7"',
2023-05-02 12:51:26 +08:00
'coverage==7.2.5;python_version>="3.7"',
2023-01-20 11:54:51 +08:00
"pytest-cov==4.0.0",
],
2022-10-30 10:03:56 +08:00
# pip install -e .[flake8]
2022-03-18 11:51:24 +08:00
# Usage: flake8
2022-10-30 10:03:56 +08:00
"flake8": [
2023-01-20 11:54:51 +08:00
'flake8==5.0.4;python_version<"3.9"',
2022-12-17 06:28:30 +08:00
'flake8==6.0.0;python_version>="3.9"',
2023-01-20 11:54:51 +08:00
"mccabe==0.7.0",
'pyflakes==2.5.0;python_version<"3.9"',
2022-12-17 06:28:30 +08:00
'pyflakes==3.0.1;python_version>="3.9"',
2023-01-20 11:54:51 +08:00
'pycodestyle==2.9.1;python_version<"3.9"',
2022-12-17 06:28:30 +08:00
'pycodestyle==2.10.0;python_version>="3.9"',
],
2022-11-26 11:18:25 +08:00
# pip install -e .[ipdb]
2022-12-17 06:28:30 +08:00
# (Not needed for debugging anymore. SeleniumBase now includes "pdbp".)
2022-11-26 11:18:25 +08:00
"ipdb": [
2023-01-20 11:54:51 +08:00
"ipdb==0.13.11",
'ipython==7.16.3;python_version<"3.7"',
2022-12-17 06:28:30 +08:00
'ipython==7.34.0;python_version>="3.7"',
2022-11-26 11:18:25 +08:00
],
# pip install -e .[pdfminer]
"pdfminer": [
2023-01-20 11:54:51 +08:00
'pdfminer.six==20211012;python_version<"3.7"',
2022-11-08 02:53:29 +08:00
'pdfminer.six==20221105;python_version>="3.7"',
],
# pip install -e .[pillow]
"pillow": [
2023-01-20 11:54:51 +08:00
'Pillow==8.4.0;python_version<"3.7"',
2023-04-09 09:16:25 +08:00
'Pillow==9.5.0;python_version>="3.7"',
],
2022-10-30 10:03:56 +08:00
# pip install -e .[psutil]
"psutil": [
2022-12-17 06:28:30 +08:00
"psutil==5.9.4",
2022-10-30 10:03:56 +08:00
],
# pip install -e .[selenium-wire]
"selenium-wire": [
'selenium-wire==5.1.0;python_version>="3.7"',
'Brotli==1.0.9;python_version>="3.7"',
'blinker==1.5;python_version>="3.7"',
'h2==4.1.0;python_version>="3.7"',
'hpack==4.0.0;python_version>="3.7"',
'hyperframe==6.0.1;python_version>="3.7"',
'kaitaistruct==0.10;python_version>="3.7"',
'pyasn1==0.4.8;python_version>="3.7"',
'zstandard==0.19.0;python_version>="3.7"',
],
},
2018-08-30 13:57:40 +08:00
packages=[
"seleniumbase",
"sbase",
2022-05-14 06:17:25 +08:00
"seleniumbase.behave",
"seleniumbase.common",
"seleniumbase.config",
"seleniumbase.console_scripts",
"seleniumbase.core",
"seleniumbase.drivers",
"seleniumbase.extensions",
"seleniumbase.fixtures",
2021-09-20 15:21:52 +08:00
"seleniumbase.js_code",
"seleniumbase.masterqa",
"seleniumbase.plugins",
"seleniumbase.resources",
"seleniumbase.translate",
2022-09-02 04:28:52 +08:00
"seleniumbase.undetected",
"seleniumbase.utilities",
"seleniumbase.utilities.selenium_grid",
"seleniumbase.utilities.selenium_ide",
2018-08-30 13:57:40 +08:00
],
include_package_data=True,
2015-12-05 05:11:53 +08:00
entry_points={
"console_scripts": [
"seleniumbase = seleniumbase.console_scripts.run:main",
"sbase = seleniumbase.console_scripts.run:main", # Simplified name
],
"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",
2018-08-30 13:57:40 +08:00
],
"pytest11": ["seleniumbase = seleniumbase.plugins.pytest_plugin"],
},
2018-08-30 13:57:40 +08:00
)
2018-03-20 04:55:06 +08:00
# print(os.system("cat seleniumbase.egg-info/PKG-INFO"))
print("\n*** SeleniumBase Installation Complete! ***\n")