X Tutup
Skip to content

Commit 160ccb0

Browse files
committed
remove old method practice in make.py
1 parent bca13b4 commit 160ccb0

File tree

3 files changed

+11
-46
lines changed

3 files changed

+11
-46
lines changed

make.py

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -390,22 +390,6 @@ def get_package_fname(self, pattern):
390390
raise RuntimeError(
391391
'Could not find required package matching %s' % pattern)
392392

393-
def install_package(self, pattern, install_options=None):
394-
"""Install package matching pattern"""
395-
fname = self.get_package_fname(pattern)
396-
if fname not in [p.fname for p in self.installed_packages]:
397-
pack = wppm.Package(fname)
398-
if self.simulation:
399-
self.distribution._print(pack, "Installing")
400-
self.distribution._print_done()
401-
else:
402-
if install_options:
403-
self.distribution.install(pack, install_options)
404-
else:
405-
self.distribution.install(pack,
406-
install_options=self.install_options)
407-
self.installed_packages.append(pack)
408-
409393
def create_batch_script(self, name, contents):
410394
"""Create batch script %WINPYDIR%/name"""
411395
scriptdir = osp.join(self.winpydir, 'scripts')
@@ -531,19 +515,8 @@ def _print_done(self):
531515

532516
def _extract_python(self):
533517
"""Extracting Python installer, creating distribution object"""
534-
self._print("Extracting Python installer")
535-
os.mkdir(self.python_dir)
536-
if self.python_fname[-3:] == 'zip': # Python3.5
537-
utils.extract_archive(self.python_fname, targetdir=self.python_dir+r'\..')
538-
if self.winpyver < "3.6":
539-
# new Python 3.5 trick (https://bugs.python.org/issue23955)
540-
pyvenv_file = osp.join(self.python_dir, 'pyvenv.cfg')
541-
open(pyvenv_file, 'w').write('applocal=True\n')
542-
else:
543-
# new Python 3.6 trick (https://docs.python.org/3.6/using/windows.html#finding-modules)
544-
# (on hold since 2017-02-16, http://bugs.python.org/issue29578)
545-
pypath_file = osp.join(self.python_dir, 'python_onHold._pth')
546-
open(pypath_file, 'w').write('python36.zip\nDLLs\nLib\n.\nimport site\n')
518+
self._print("Extracting Python .zip version")
519+
utils.extract_archive(self.python_fname, targetdir=self.python_dir+r'\..')
547520
self._print_done()
548521

549522
def _add_msvc_files(self):
@@ -582,19 +555,6 @@ def _check_packages(self):
582555
(pack.name, ", ".join([p.version for p in duplicates])),
583556
file=sys.stderr)
584557

585-
def _install_all_other_packages(self):
586-
"""Try to install all other packages in wheeldir"""
587-
print("Installing other packages")
588-
my_list = []
589-
my_list += os.listdir(self.wheeldir)
590-
for fname in my_list:
591-
if osp.basename(fname) != osp.basename(self.python_fname):
592-
try:
593-
self.install_package(fname)
594-
except NotImplementedError:
595-
print("WARNING: unable to install package %s"
596-
% osp.basename(fname), file=sys.stderr)
597-
598558
def _copy_dev_tools(self):
599559
"""Copy dev tools"""
600560
self._print("Copying tools")
@@ -1417,7 +1377,7 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
14171377
# pre-patch current pip (until default python has pip 8.0.3)
14181378
self.distribution.patch_standard_packages('pip')
14191379
# not forced update of pip (FIRST) and setuptools here
1420-
for req in ('pip', 'setuptools'):
1380+
for req in ('pip', 'setuptools', 'winpython'):
14211381
actions = ["install","--upgrade", req]
14221382
if self.install_options is not None:
14231383
actions += self.install_options
@@ -1426,8 +1386,8 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
14261386
self.distribution.do_pip_action(actions)
14271387
self.distribution.patch_standard_packages(req)
14281388

1429-
# install packages in source_dirs (not using requirements.txt)
1430-
self._install_all_other_packages()
1389+
# no more directory base package install: use requirements.txt
1390+
#2019-05-03 removed self._install_all_other_packages()
14311391
if not self.simulation:
14321392
self._copy_dev_tools()
14331393
self._copy_dev_docs()

winpython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '1.12.20190502'
31+
__version__ = '2.0.20190503'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

winpython/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ def extract_archive(fname, targetdir=None, verbose=False):
429429
Return the temporary directory path"""
430430
if targetdir is None:
431431
targetdir = _create_temp_dir()
432+
else:
433+
try:
434+
os.mkdir(targetdir)
435+
except:
436+
pass
432437
if osp.splitext(fname)[1] in ('.zip', '.exe'):
433438
obj = zipfile.ZipFile(fname, mode="r")
434439
elif fname.endswith('.tar.gz'):

0 commit comments

Comments
 (0)
X Tutup