MCPcopy Create free account
hub / github.com/cztomczak/cefpython / make_packages

Function make_packages

tools/build_distrib.py:568–616  ·  view source on GitHub ↗

Make setup and wheel packages.

(python, arch, all_pythons)

Source from the content-addressed store, hash-verified

566
567
568def make_packages(python, arch, all_pythons):
569 """Make setup and wheel packages."""
570 print("[build_distrib.py] Make setup package for {arch}..."
571 .format(arch=arch))
572
573 # Call make_installer.py
574 make_installer_py = os.path.join(TOOLS_DIR, "make_installer.py")
575 installer_command = ("\"{python}\" {make_installer_py} {version}"
576 .format(python=python["executable"],
577 make_installer_py=make_installer_py,
578 version=VERSION))
579 pcode = subprocess.call(installer_command, cwd=BUILD_DIR, shell=True)
580 if pcode != 0:
581 print("[build_distrib.py] ERROR: failed to make setup package for"
582 " {arch}".format(arch=arch))
583 sys.exit(1)
584
585 # Pack setup package and move to distrib dir
586 print("[build_distrib.py] Pack setup package for {arch}..."
587 .format(arch=arch))
588 setup_basename = get_setup_installer_basename(
589 VERSION, get_os_postfix2_for_arch(arch))
590 setup_dir = os.path.join(BUILD_DIR, setup_basename)
591 check_cpp_extension_dependencies_issue359(setup_dir, all_pythons)
592 archive = pack_directory(setup_dir, BUILD_DIR)
593 shutil.move(archive, DISTRIB_DIR)
594
595 # Make wheel package
596 print("[build_distrib.py] Make wheel package for {arch}..."
597 .format(arch=arch))
598 wheel_args = "bdist_wheel --universal"
599 wheel_command = ("\"{python}\" setup.py {wheel_args}"
600 .format(python=python["executable"],
601 wheel_args=wheel_args))
602 pcode = subprocess.call(wheel_command, cwd=setup_dir, shell=True)
603 if pcode != 0:
604 print("[build_distrib.py] ERROR: failed to make wheel package for"
605 " {arch}".format(arch=arch))
606 sys.exit(1)
607
608 # Move wheel package
609 files = glob.glob(os.path.join(setup_dir, "dist", "*.whl"))
610 assert len(files) == 1, ".whl file not found"
611 shutil.move(files[0], DISTRIB_DIR)
612
613 # Delete setup directory
614 print("[build_distrib.py] Delete setup directory: {setup_dir}/"
615 .format(setup_dir=os.path.basename(setup_dir)))
616 shutil.rmtree(setup_dir)
617
618
619def check_cpp_extension_dependencies_issue359(setup_dir, all_pythons):

Callers 1

mainFunction · 0.85

Calls 5

get_os_postfix2_for_archFunction · 0.85
pack_directoryFunction · 0.85
moveMethod · 0.80

Tested by

no test coverage detected