X Tutup
Skip to content

Commit 3d958cc

Browse files
committed
cleanup & simplification
1 parent 501d00d commit 3d958cc

File tree

2 files changed

+14
-53
lines changed

2 files changed

+14
-53
lines changed

make.py

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,20 +1425,19 @@ def make_all(build_number, release_level, pyver, architecture,
14251425
docsdirs=None):
14261426
"""Make WinPython distribution, for a given base directory and
14271427
architecture:
1428-
1429-
make_winpython(build_number, release_level, architecture,
1430-
basedir=None, verbose=False, remove_existing=True,
1431-
create_installer=True, simulation=False)
1432-
14331428
`build_number`: build number [int]
14341429
`release_level`: release level (e.g. 'beta1', '') [str]
14351430
`pyver`: python version ('3.4' or 3.5')
14361431
`architecture`: [int] (32 or 64)
1437-
`basedir`: where will be created tmp_wheel dir. and Winpython-xyz dir.
1438-
""" + utils.ROOTDIR_DOC
1432+
`basedir`: where will be created tmp_wheel and Winpython build
1433+
r'D:\Winpython\basedir34'.
1434+
`requirements`: the package list for pip r'D:\requirements.txt',
1435+
`install_options`: pip options r'--no-index --pre --trusted-host=None',
1436+
`find_links`: package directories r'D:\Winpython\packages.srcreq',
1437+
`source_dirs`: the python.zip + rebuilt winpython wheel package directory,
1438+
`toolsdirs`: r'D:\WinPython\basedir34\t.Slim',
1439+
`docsdirs`: r'D:\WinPython\basedir34\docs.Slim' """
14391440

1440-
if basedir is None:
1441-
basedir = utils.BASE_DIR
14421441

14431442
assert basedir is not None, "The *basedir* directory must be specified"
14441443
assert architecture in (32, 64)
@@ -1449,27 +1448,12 @@ def make_all(build_number, release_level, pyver, architecture,
14491448
if not osp.isdir(builddir):
14501449
os.mkdir(builddir)
14511450

1452-
# Create 1 wheel directory to receive all packages whished for build
1453-
wheeldir = osp.join(builddir, 'wheels_tmp_%s' % architecture)
1454-
if osp.isdir(wheeldir):
1455-
shutil.rmtree(wheeldir, onerror=utils.onerror)
1456-
os.mkdir(wheeldir)
1451+
# use source_dirs as the directory to re-build Winpython wheel
1452+
wheeldir = source_dirs
14571453

14581454
# Rebuild Winpython in this wheel dir
14591455
rebuild_winpython(basedir=basedir, targetdir=wheeldir, architecture=architecture)
14601456

1461-
# Copy Every package directory to the wheel directory
1462-
1463-
# Optional pre-defined source_dirs
1464-
source_dirs = transform_in_list(source_dirs, 'source_dirs=')
1465-
1466-
for m in list(set(source_dirs)):
1467-
if osp.isdir(m):
1468-
src_files = os.listdir(m)
1469-
for file_name in src_files:
1470-
full_file_name = os.path.join(m, file_name)
1471-
shutil.copy(full_file_name, wheeldir)
1472-
14731457
# Optional pre-defined toolsdirs
14741458
toolsdirs = transform_in_list(toolsdirs, 'toolsdirs=')
14751459

@@ -1526,7 +1510,7 @@ def make_all(build_number, release_level, pyver, architecture,
15261510
requirements=r'D:\Winpython\basedir34\barebone_requirements.txt',
15271511
install_options=r'--no-index --pre --trusted-host=None',
15281512
find_links=r'D:\Winpython\packages.srcreq',
1529-
source_dirs=r'D:\WinPython\basedir34\packages.src D:\WinPython\basedir34\packages.win-amd64',
1513+
source_dirs=r'D:\WinPython\basedir34\packages.win-amd64',
15301514
toolsdirs=r'D:\WinPython\basedir34\t.Slim',
15311515
docsdirs=r'D:\WinPython\basedir34\docs.Slim'
15321516
)

winpython/utils.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,6 @@
2929
from winpython.py3compat import winreg
3030

3131

32-
# Development only
33-
TOOLS_DIR = osp.abspath(osp.join(osp.dirname(__file__), os.pardir, 't'))
34-
if osp.isdir(TOOLS_DIR):
35-
os.environ['PATH'] += ';%s' % TOOLS_DIR
36-
ROOT_DIR = os.environ.get('WINPYTHONROOTDIR')
37-
BASE_DIR = os.environ.get('WINPYTHONBASEDIR')
38-
39-
ROOTDIR_DOC = """
40-
41-
The WinPython root directory (WINPYTHONROOTDIR environment variable which
42-
may be overriden with the `rootdir` option) contains the following folders:
43-
* (required) `packages.win32`: contains distutils 32-bit packages
44-
* (required) `packages.win-amd64`: contains distutils 64-bit packages
45-
* (optional) `packages.src`: contains distutils source distributions
46-
* (required) `tools`: contains architecture-independent tools
47-
* (optional) `tools.win32`: contains 32-bit-specific tools
48-
* (optional) `tools.win-amd64`: contains 64-bit-specific tools"""
49-
50-
5132
def onerror(function, path, excinfo):
5233
"""Error handler for `shutil.rmtree`.
5334
@@ -607,12 +588,8 @@ def do_script(this_script, python_exe=None, copy_to=None,
607588
tmpdir = r'D:\Tests\winpython_tests'
608589
if not osp.isdir(tmpdir):
609590
os.mkdir(tmpdir)
610-
print((extract_archive(osp.join(BASE_DIR, 'packages.win-amd64',
611-
'winpython-0.3dev.win-amd64.exe'),
591+
print((extract_archive(osp.join(r'D:\WinP\bd37', 'packages.win-amd64',
592+
'python-3.7.3.amd64.zip'),
612593
tmpdir)))
613-
# extract_exe(osp.join(tmpdir,
614-
# 'PyQwt-5.2.0-py2.6-x64-pyqt4.8.6-numpy1.6.1-1.exe'))
615-
# extract_exe(osp.join(tmpdir, 'PyQt-Py2.7-x64-gpl-4.8.6-1.exe'))
616594

617-
# path = r'D:\Pierre\_test\xlrd-0.8.0.tar.gz'
618-
# source_to_wininst(path)
595+

0 commit comments

Comments
 (0)
X Tutup