Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c13b4f0

Browse files
committed
fix a premature optimization, and remove further dead wood
1 parent 57f7007 commit c13b4f0

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

winpython/wppm.py

+2-27
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ def do_pip_action(self, actions: list[str] = None, install_options: list[str] =
126126
my_actions = actions or []
127127
executing = str(Path(self.target).parent / "scripts" / "env.bat")
128128
if Path(executing).is_file():
129-
complement = [r"&&", "cd", "/D", self.target, r"&&", utils.get_python_executable(self.target)]
129+
complement = [r"&&", "cd", "/D", self.target, r"&&", utils.get_python_executable(self.target), "-m", "pip"]
130130
else:
131131
executing = utils.get_python_executable(self.target)
132-
complement = ["-m", "pip"]
132+
complement = ["-m", "pip"]
133133
try:
134134
fname = utils.do_script(this_script=None, python_exe=executing, verbose=self.verbose, install_options=complement + my_actions + my_list)
135135
except RuntimeError as e:
@@ -195,32 +195,7 @@ def patch_standard_packages(self, package_name="", to_movable=True):
195195
"'check_updates_on_startup': True,",
196196
"'check_updates_on_startup': False,",
197197
)
198-
# workaround bad installers
199-
if package_name.lower() == "numba":
200-
self.create_pybat(["numba"])
201-
else:
202-
self.create_pybat(package_name.lower())
203-
204198

205-
def create_pybat(self, names="", contents=r"""@echo off
206-
..\python "%~dpn0" %*""",
207-
):
208-
"""Create launcher batch script when missing"""
209-
210-
scriptpy = Path(self.target) / "Scripts" # std Scripts of python
211-
os.makedirs(scriptpy, exist_ok=True)
212-
if not list(names) == names:
213-
my_list = [f for f in os.listdir(scriptpy) if "." not in f and f.startswith(names)]
214-
else:
215-
my_list = names
216-
for name in my_list:
217-
if scriptpy.is_dir() and (scriptpy / name).is_file():
218-
if (
219-
not (scriptpy / (name + ".exe")).is_file()
220-
and not (scriptpy / (name + ".bat")).is_file()
221-
):
222-
with open(scriptpy / (name + ".bat"), "w") as fd:
223-
fd.write(contents)
224199

225200
def handle_specific_packages(self, package):
226201
"""Packages requiring additional configuration"""

0 commit comments

Comments
 (0)