File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 55from pathlib import Path
66
77import pytest
8- from setuptools .dist import Distribution
98
109import s5cmd
1110
@@ -28,15 +27,20 @@ def test_module(tool):
2827
2928
3029def _get_scripts ():
31- dist = Distribution ( "s5cmd" )
30+ # Collect all "scripts" directories from sysconfig schemes
3231 scripts_paths = [
3332 Path (sysconfig .get_path ("scripts" , scheme )).resolve ()
3433 for scheme in sysconfig .get_scheme_names ()
3534 ]
3635 scripts = []
37- for file in dist .files :
38- if file .locate ().parent .resolve (strict = True ) in scripts_paths :
39- scripts .append (file .locate ().resolve (strict = True ))
36+ for scripts_dir in scripts_paths :
37+ # Skip non-existent dirs to avoid Resolve errors
38+ if not scripts_dir .exists ():
39+ continue
40+ # Add regular files in the scripts dir (resolve to absolute Path)
41+ for f in scripts_dir .iterdir ():
42+ if f .is_file ():
43+ scripts .append (f .resolve ())
4044 return scripts
4145
4246
You can’t perform that action at this time.
0 commit comments