File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed
selenium/webdriver/common Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -230,10 +230,17 @@ pkg_files(
230230 "CHANGES" ,
231231 "MANIFEST.in" ,
232232 "README.rst" ,
233+ "pyproject.toml" ,
233234 "setup.py" ,
234235 ":license" ,
235236 ":selenium-pkg" ,
236237 ":selenium-pkginfo" ,
238+ "//rust:selenium_manager_srcs" ,
239+ ],
240+ excludes = [
241+ ":manager-linux" ,
242+ ":manager-macos" ,
243+ ":manager-windows" ,
237244 ],
238245 strip_prefix = strip_prefix .from_pkg (),
239246)
Original file line number Diff line number Diff line change 1+ [build-system ]
2+ requires = [" setuptools" , " setuptools-rust" ]
3+ build-backend = " setuptools.build_meta"
Original file line number Diff line number Diff line change 2020import platform
2121import subprocess
2222import sys
23+ import sysconfig
2324from pathlib import Path
2425from typing import List
2526
@@ -61,9 +62,16 @@ def _get_binary() -> Path:
6162 :Raises: WebDriverException if the platform is unsupported
6263 """
6364
65+ compiled_path = Path (__file__ ).parent .joinpath ("selenium-manager" )
66+ exe = sysconfig .get_config_var ("EXE" )
67+ if exe is not None :
68+ compiled_path = compiled_path .with_suffix (exe )
69+
6470 if (path := os .getenv ("SE_MANAGER_PATH" )) is not None :
6571 logger .debug ("Selenium Manager set by env SE_MANAGER_PATH to: %s" , path )
6672 path = Path (path )
73+ elif compiled_path .exists ():
74+ path = compiled_path
6775 else :
6876 allowed = {
6977 ("darwin" , "any" ): "macos/selenium-manager" ,
Original file line number Diff line number Diff line change 1919from os .path import dirname , join , abspath
2020from setuptools import setup
2121from setuptools .command .install import install
22+ from setuptools_rust import Binding , RustExtension
2223
2324
2425for scheme in INSTALL_SCHEMES .values ():
8384 "typing_extensions~= 4.9.0" ,
8485 "websocket-client==1.8.0" ,
8586 ],
87+ 'rust_extensions' : [
88+ RustExtension (
89+ {"selenium-manager" : "selenium.webdriver.common.selenium-manager" },
90+ binding = Binding .Exec
91+ )
92+ ],
8693 'zip_safe' : False
8794}
8895
Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ rust_library(
9595 deps = all_crate_deps (normal = True ),
9696)
9797
98+ filegroup (
99+ name = "selenium_manager_srcs" ,
100+ srcs = [
101+ "Cargo.lock" ,
102+ "Cargo.toml" ,
103+ ":selenium_manager_rs_srcs" ,
104+ ],
105+ visibility = ["//visibility:public" ],
106+ )
107+
108+ filegroup (
109+ name = "selenium_manager_rs_srcs" ,
110+ srcs = glob (["src/**/*.rs" ]),
111+ )
112+
98113rust_test (
99114 name = "unit" ,
100115 size = "small" ,
You can’t perform that action at this time.
0 commit comments