diff options
Diffstat (limited to 'dev-python/selenium')
-rw-r--r-- | dev-python/selenium/Manifest | 4 | ||||
-rw-r--r-- | dev-python/selenium/selenium-4.23.1-r1.ebuild | 135 | ||||
-rw-r--r-- | dev-python/selenium/selenium-4.23.1.ebuild | 83 |
3 files changed, 222 insertions, 0 deletions
diff --git a/dev-python/selenium/Manifest b/dev-python/selenium/Manifest index 2e0e56b09815..0f22329e622e 100644 --- a/dev-python/selenium/Manifest +++ b/dev-python/selenium/Manifest @@ -1,4 +1,8 @@ DIST selenium-4.22.0.tar.gz 9242392 BLAKE2B 15197221a53c597b412f805eed7f29f4c34a9d0596a069ea5a6df540b93c013815a59fe1730e8493f5ae854cbc03d5a6647eb57d825ecc68ad0b31949448acaa SHA512 a25c892495ed613c2cd96ab971f46cc101416a4928cffceaa9891c759a41d51df392999495d442a21b459d83a1b287c64c2cd5405b82e16464b56fcc75b2c595 +DIST selenium-4.23.1.tar.gz 945830 BLAKE2B 7931156bc8b79484433cb6a9bd7d49852981e3662a8e75f1f48d683644bac1c78e616e33965c611f50203a6a6f0f5bd09501c16816afe7a7c27b2a9e72a10a14 SHA512 3f9cda92c606ce7a32ecb6f1ef434501368fdab8673a0f23a39d78b80e80b732fafb6e29842ab5301d31cd8eaa907561b91a96cf67e181daeae3378e6a0e9a5b DIST selenium-selenium-4.22.0.gh.tar.gz 77094998 BLAKE2B 1d74be914debec94e3b9fe41ce40e7432426c7f30a848c63ad82e616fc3dd7dce8e544c33a90e28ca268988b9035aabe41805277085095cc1c65bd38e09117e5 SHA512 f71721b614fa3e346a75ca2391fb03067520d746e1433a75ba896eb6bbe621064bcab7d50337989ccb60d13c493e2df2b3b1bd73cc8dcaf3b62dc4f4ebfaa086 +DIST selenium-selenium-4.23.1-python.gh.tar.gz 77116002 BLAKE2B dad444b109d2494b3442c81187fa6c9d3db2565183304f76d2badf2444e0545727c6f4bf08be0a5102692b9c018b3354a4063758253275624f9f4d6ff6d49254 SHA512 e7d4dc8f14fe9cae3d8e362a03b5068536d64e8484e151187ae9c917350e1f299977fb1521066998fba5cd845c5167a8440d02b15547d066a40d3e79cac1f50d EBUILD selenium-4.22.0-r1.ebuild 2058 BLAKE2B 73f0bc976b6d1f288913cb5119649d596e92dd64f95203b7b7e9fdadb2d310834dcc419d96e556135d52d92058eeb0412fce671f6874d9da7158e0ae44996e79 SHA512 cff979ab7b0ce5930b7fda0a38143a290bb88eec46335c180afb6860164ff6faa5a120211f5067d618b34711c413a75cd3781e9fdbb96605bd34baffba119b55 +EBUILD selenium-4.23.1-r1.ebuild 4201 BLAKE2B 51caece84c6fb8c32d9825b344f96fb2c874ba60e67903287b89f70d9c78b5b225349beac96d4340acb2eb70f0d93b62c6e3453262914e023d510c2bb54ef82e SHA512 add3585d3203f8a68cb3afa298d2c38e58ced7b388e1db0831940e1d832e6d0a682c9c1948f0af4cf2f29727b3c1026e025f4fc023cb39c94b1ac706de990686 +EBUILD selenium-4.23.1.ebuild 2265 BLAKE2B 75d274eb10c9817d1a514e9c06c647348288985b74028fdac9ab25a09f85bf4d8eb1d79e5b5df90a0add7e11189788e8d341109284d064918e1ae8419a859611 SHA512 37222e482636ea18e4d8f8767935b6db09d3542fdc6cc1f49665de64f6e128d79aaeef60c4453832a5b3a914ce41798614f4f56eb05bd996614a2654a5d5e21a MISC metadata.xml 383 BLAKE2B d437d1631cefdba12fe2c3ce38ddff34bf9dd2bbc777d5d3425556bda76865711c991c9e3a735130a1d55cb7c6578b083ecb473c28706a2d45563b31bdbe6d1b SHA512 c087323da996b9ad4d0bf8f00306cf044d5daab194b60af029cb1ce06bf60c660fd5959b7914e6f1103143c3e4533d293a6d3bd0ec1c95163eba09d8a19c13a1 diff --git a/dev-python/selenium/selenium-4.23.1-r1.ebuild b/dev-python/selenium/selenium-4.23.1-r1.ebuild new file mode 100644 index 000000000000..dfe9e9aac1fe --- /dev/null +++ b/dev-python/selenium/selenium-4.23.1-r1.ebuild @@ -0,0 +1,135 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_TESTED=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_13 ) + +inherit distutils-r1 pypi + +# upstream sometimes tags it as ${P}, sometimes as ${P}-python, sigh +TEST_TAG=${P}-python +TEST_P=selenium-${TEST_TAG} + +DESCRIPTION="Python language binding for Selenium Remote Control" +HOMEPAGE=" + https://www.seleniumhq.org/ + https://github.com/SeleniumHQ/selenium/tree/trunk/py/ + https://pypi.org/project/selenium/ +" +SRC_URI+=" + test? ( + https://github.com/SeleniumHQ/selenium/archive/${TEST_TAG}.tar.gz + -> ${TEST_P}.gh.tar.gz + ) +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="test-rust" + +RDEPEND=" + >=dev-python/certifi-2021.10.8[${PYTHON_USEDEP}] + <dev-python/trio-1[${PYTHON_USEDEP}] + >=dev-python/trio-0.17[${PYTHON_USEDEP}] + <dev-python/trio-websocket-1[${PYTHON_USEDEP}] + >=dev-python/trio-websocket-0.9[${PYTHON_USEDEP}] + <dev-python/typing-extensions-5[${PYTHON_USEDEP}] + >=dev-python/typing-extensions-4.9[${PYTHON_USEDEP}] + <dev-python/urllib3-3[${PYTHON_USEDEP}] + >=dev-python/urllib3-1.26[${PYTHON_USEDEP}] + <dev-python/websocket-client-2[${PYTHON_USEDEP}] + >=dev-python/websocket-client-1.8.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/pytest-mock[${PYTHON_USEDEP}] + test-rust? ( + dev-python/pytest-rerunfailures[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] + dev-util/selenium-manager + net-misc/geckodriver + || ( + www-client/firefox + www-client/firefox-bin + ) + ) + ) +" + +distutils_enable_tests pytest + +src_prepare() { + distutils-r1_src_prepare + + # do not build selenium-manager implicitly + sed -e '/setuptools_rust/d' \ + -e '/rust_extensions/,/\]/d' \ + -i setup.py || die +} + +python_test() { + if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then + einfo "Skipping tests on ${EPYTHON}" + return + fi + + local EPYTEST_DESELECT=( + # expects vanilla certifi + test/unit/selenium/webdriver/remote/remote_connection_tests.py::test_get_connection_manager_for_certs_and_timeout + ) + local pytest_args=( + # https://github.com/SeleniumHQ/selenium/blob/selenium-4.8.2-python/py/test/runner/run_pytest.py#L20-L24 + # seriously? + -o "python_files=*_tests.py test_*.py" + -p pytest_mock + ) + if use test-rust; then + local -x PATH=${T}/bin:${PATH} + local -x SE_MANAGER_PATH="$(type -P selenium-manager)" + + local EPYTEST_XDIST=1 + pytest_args+=( + -p rerunfailures --reruns=5 + + --driver=firefox + --browser-binary="$(type -P firefox || type -P firefox-bin)" + --driver-binary="$(type -P geckodriver)" + --headless=true + ) + + EPYTEST_DESELECT+=( + # expects prebuilt executables for various systems + test/selenium/webdriver/common/selenium_manager_tests.py::test_uses_windows + test/selenium/webdriver/common/selenium_manager_tests.py::test_uses_linux + test/selenium/webdriver/common/selenium_manager_tests.py::test_uses_mac + test/selenium/webdriver/common/selenium_manager_tests.py::test_errors_if_invalid_os + + # TODO: these don't respect --*-binary and try to fetch versions + test/selenium/webdriver/firefox + test/selenium/webdriver/marionette/mn_context_tests.py::test_context_sets_correct_context_and_returns + test/selenium/webdriver/marionette/mn_context_tests.py::test_context_sets_correct_context_and_returns + test/selenium/webdriver/marionette/mn_options_tests.py::TestIntegration::test_we_can_pass_options + test/selenium/webdriver/marionette/mn_set_context_tests.py::test_we_can_switch_context_to_chrome + + # TODO + test/selenium/webdriver/common/bidi_script_tests.py + test/selenium/webdriver/marionette/mn_options_tests.py::TestUnit::test_binary + test/selenium/webdriver/marionette/mn_options_tests.py::TestUnit::test_ctor + test/selenium/webdriver/marionette/mn_options_tests.py::TestUnit::test_prefs + test/selenium/webdriver/marionette/mn_options_tests.py::TestUnit::test_to_capabilities + ) + else + EPYTEST_DESELECT+=( + test/selenium + ) + fi + + cd "${WORKDIR}/${TEST_P}/py" || die + rm -rf selenium || die + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest "${pytest_args[@]}" +} diff --git a/dev-python/selenium/selenium-4.23.1.ebuild b/dev-python/selenium/selenium-4.23.1.ebuild new file mode 100644 index 000000000000..ee892f3209ac --- /dev/null +++ b/dev-python/selenium/selenium-4.23.1.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_TESTED=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_13 ) + +inherit distutils-r1 pypi + +# upstream sometimes tags it as ${P}, sometimes as ${P}-python, sigh +TEST_TAG=${P}-python +TEST_P=selenium-${TEST_TAG} + +DESCRIPTION="Python language binding for Selenium Remote Control" +HOMEPAGE=" + https://www.seleniumhq.org/ + https://github.com/SeleniumHQ/selenium/tree/trunk/py/ + https://pypi.org/project/selenium/ +" +SRC_URI+=" + test? ( + https://github.com/SeleniumHQ/selenium/archive/${TEST_TAG}.tar.gz + -> ${TEST_P}.gh.tar.gz + ) +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +RDEPEND=" + >=dev-python/certifi-2021.10.8[${PYTHON_USEDEP}] + <dev-python/trio-1[${PYTHON_USEDEP}] + >=dev-python/trio-0.17[${PYTHON_USEDEP}] + <dev-python/trio-websocket-1[${PYTHON_USEDEP}] + >=dev-python/trio-websocket-0.9[${PYTHON_USEDEP}] + <dev-python/typing-extensions-5[${PYTHON_USEDEP}] + >=dev-python/typing-extensions-4.9[${PYTHON_USEDEP}] + <dev-python/urllib3-3[${PYTHON_USEDEP}] + >=dev-python/urllib3-1.26[${PYTHON_USEDEP}] + <dev-python/websocket-client-2[${PYTHON_USEDEP}] + >=dev-python/websocket-client-1.8.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/pytest-mock[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_prepare() { + distutils-r1_src_prepare + + # do not build selenium-manager implicitly + sed -e '/setuptools_rust/d' \ + -e '/rust_extensions/,/\]/d' \ + -i setup.py || die +} + +python_test() { + if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then + einfo "Skipping tests on ${EPYTHON}" + return + fi + + local EPYTEST_DESELECT=( + # TODO: we may need extra setup or deps + test/selenium + + # expects vanilla certifi + test/unit/selenium/webdriver/remote/remote_connection_tests.py::test_get_connection_manager_for_certs_and_timeout + ) + + cd "${WORKDIR}/${TEST_P}/py" || die + rm -rf selenium || die + # https://github.com/SeleniumHQ/selenium/blob/selenium-4.8.2-python/py/test/runner/run_pytest.py#L20-L24 + # seriously? + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest -o "python_files=*_tests.py test_*.py" -p pytest_mock +} |