File tree 5 files changed +40
-0
lines changed
selenium/webdriver/common
5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -230,10 +230,17 @@ pkg_files(
230
230
"CHANGES" ,
231
231
"MANIFEST.in" ,
232
232
"README.rst" ,
233
+ "pyproject.toml" ,
233
234
"setup.py" ,
234
235
":license" ,
235
236
":selenium-pkg" ,
236
237
":selenium-pkginfo" ,
238
+ "//rust:selenium_manager_srcs" ,
239
+ ],
240
+ excludes = [
241
+ ":manager-linux" ,
242
+ ":manager-macos" ,
243
+ ":manager-windows" ,
237
244
],
238
245
strip_prefix = strip_prefix .from_pkg (),
239
246
)
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 20
20
import platform
21
21
import subprocess
22
22
import sys
23
+ import sysconfig
23
24
from pathlib import Path
24
25
from typing import List
25
26
@@ -61,9 +62,16 @@ def _get_binary() -> Path:
61
62
:Raises: WebDriverException if the platform is unsupported
62
63
"""
63
64
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
+
64
70
if (path := os .getenv ("SE_MANAGER_PATH" )) is not None :
65
71
logger .debug ("Selenium Manager set by env SE_MANAGER_PATH to: %s" , path )
66
72
path = Path (path )
73
+ elif compiled_path .exists ():
74
+ path = compiled_path
67
75
else :
68
76
allowed = {
69
77
("darwin" , "any" ): "macos/selenium-manager" ,
Original file line number Diff line number Diff line change 19
19
from os .path import dirname , join , abspath
20
20
from setuptools import setup
21
21
from setuptools .command .install import install
22
+ from setuptools_rust import Binding , RustExtension
22
23
23
24
24
25
for scheme in INSTALL_SCHEMES .values ():
83
84
"typing_extensions~= 4.9.0" ,
84
85
"websocket-client==1.8.0" ,
85
86
],
87
+ 'rust_extensions' : [
88
+ RustExtension (
89
+ {"selenium-manager" : "selenium.webdriver.common.selenium-manager" },
90
+ binding = Binding .Exec
91
+ )
92
+ ],
86
93
'zip_safe' : False
87
94
}
88
95
Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ rust_library(
95
95
deps = all_crate_deps (normal = True ),
96
96
)
97
97
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
+
98
113
rust_test (
99
114
name = "unit" ,
100
115
size = "small" ,
You can’t perform that action at this time.
0 commit comments