@@ -143,23 +143,14 @@ def patch_standard_packages(self, package_name="", to_movable=True):
143
143
"""patch Winpython packages in need"""
144
144
import filecmp
145
145
146
- # Adpating to PyPy
147
- if "pypy3" in Path (utils .get_python_executable (self .target )).name :
148
- site_package_place = "\\ site-packages\\ "
149
- else :
150
- site_package_place = "\\ Lib\\ site-packages\\ "
151
146
# 'pywin32' minimal post-install (pywin32_postinstall.py do too much)
152
147
if package_name .lower () == "pywin32" or package_name == "" :
153
- origin = self .target + site_package_place + "pywin32_system32"
154
-
155
- destin = self .target
156
- if Path (origin ).is_dir ():
148
+ origin = Path (self .target ) / "site-packages" / "pywin32_system32"
149
+ destin = Path (self .target )
150
+ if origin .is_dir ():
157
151
for name in os .listdir (origin ):
158
- here , there = (
159
- str (Path (origin ) / name ),
160
- str (Path (destin ) / name ),
161
- )
162
- if not Path (there ).exists () or not filecmp .cmp (here , there ):
152
+ here , there = (origin / name ), (destin / name )
153
+ if not there .exists () or not filecmp .cmp (here , there ):
163
154
shutil .copyfile (here , there )
164
155
# 'pip' to do movable launchers (around line 100) !!!!
165
156
# rational: https://github.com/pypa/pip/issues/2328
@@ -171,27 +162,21 @@ def patch_standard_packages(self, package_name="", to_movable=True):
171
162
sheb_mov1 = " executable = os.path.join(os.path.basename(get_executable()))"
172
163
sheb_mov2 = " executable = os.path.join('..',os.path.basename(get_executable()))"
173
164
174
- # Adpating to PyPy
175
- the_place = site_package_place + r"pip\_vendor\distlib\scripts.py"
165
+ the_place = Path (self .target ) / "lib" / "site-packages" / "pip" / "_vendor" / "distlib" / "scripts.py"
176
166
print (the_place )
177
167
if to_movable :
178
- utils .patch_sourcefile (self . target + the_place , sheb_fix , sheb_mov1 )
179
- utils .patch_sourcefile (self . target + the_place , sheb_mov2 , sheb_mov1 )
168
+ utils .patch_sourcefile (the_place , sheb_fix , sheb_mov1 )
169
+ utils .patch_sourcefile (the_place , sheb_mov2 , sheb_mov1 )
180
170
else :
181
- utils .patch_sourcefile (self . target + the_place , sheb_mov1 , sheb_fix )
182
- utils .patch_sourcefile (self . target + the_place , sheb_mov2 , sheb_fix )
171
+ utils .patch_sourcefile (the_place , sheb_mov1 , sheb_fix )
172
+ utils .patch_sourcefile (the_place , sheb_mov2 , sheb_fix )
183
173
184
174
# create movable launchers for previous package installations
185
175
self .patch_all_shebang (to_movable = to_movable )
186
176
if package_name .lower () == "spyder" or package_name == "" :
187
177
# spyder don't goes on internet without I ask
188
178
utils .patch_sourcefile (
189
- self .target + (site_package_place + r"spyderlib\config\main.py" ),
190
- "'check_updates_on_startup': True," ,
191
- "'check_updates_on_startup': False," ,
192
- )
193
- utils .patch_sourcefile (
194
- self .target + (site_package_place + r"spyder\config\main.py" ),
179
+ Path (self .target ) / "lib" / "site-packages" / "spyder" / "config" / "main.py" ,
195
180
"'check_updates_on_startup': True," ,
196
181
"'check_updates_on_startup': False," ,
197
182
)
0 commit comments