From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.922.1577993154613891392 for ; Thu, 02 Jan 2020 11:25:54 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ashley.e.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 11:25:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,387,1571727600"; d="scan'208";a="244690516" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by fmsmga004.fm.intel.com with ESMTP; 02 Jan 2020 11:25:53 -0800 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 11:25:53 -0800 Received: from orsmsx116.amr.corp.intel.com ([169.254.7.30]) by ORSMSX153.amr.corp.intel.com ([169.254.12.176]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 11:25:52 -0800 From: "Desimone, Ashley E" To: "Desimone, Nathaniel L" , "devel@edk2.groups.io" CC: "Pandya, Puja" , "Bjorge, Erik C" , Bret Barkelew Subject: Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Fix PYTHON_VERSION usage Thread-Topic: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Fix PYTHON_VERSION usage Thread-Index: AQHVvFoj7cMTWndYEUO77Dk7oZNmzafXzBhA Date: Thu, 2 Jan 2020 19:25:52 +0000 Message-ID: <4CF3A9EB60ABDA47BE7821A4DA3A0A3353CCB7BA@ORSMSX116.amr.corp.intel.com> References: <20191227020521.9149-1-nathaniel.l.desimone@intel.com> In-Reply-To: <20191227020521.9149-1-nathaniel.l.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: ashley.e.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ashley DeSimone -----Original Message----- From: Desimone, Nathaniel L=20 Sent: Thursday, December 26, 2019 6:05 PM To: devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Desimone, Ashle= y E ; Pandya, Puja ; Bj= orge, Erik C ; Bret Barkelew Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Fix PYTHON_VERSION usage From: Nate DeSimone PYTHON_VERSION in set_version_and_build_wheels.py is only being used for Wi= ndows right now. This patch adds Linux support. Cc: Ashley DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Signed-off-by: Nate DeSimone --- build-scripts/set_version_and_build_wheels.py | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/build-scripts/set_version_and_build_wheels.py b/build-scripts/= set_version_and_build_wheels.py index 6fd5ab5..6d5b8d0 100755 --- a/build-scripts/set_version_and_build_wheels.py +++ b/build-scripts/set_version_and_build_wheels.py @@ -18,7 +18,7 @@ import re from subprocess import call, check_call from xml.etree import ElementTree -PYTHON_VERSION=3D"-3" +PYTHON_VERSION=3D"3" # # Environment detection @@ -38,13 +38,13 @@ elif os.name =3D=3D "posix": else: raise EnvironmentError("Unsupported OS") -setup_py_version_data =3D re.compile("\s*version=3D'([\d.]+)',") -assembly_file_version_data =3D re.compile("\s*\[\s*assembly:\s*AssemblyFil= eVersion\s*\(\"([\d.]+)\"\)\s*\]") -version_number_data =3D re.compile("(\d+)\.(\d+)\.(\d+)\.(\d+)") -file_version_data =3D re.compile("FILEVERSION\s*(\d+),\s*(\d+),\s*(\d+),\s= *(\d+)") -product_version_data =3D re.compile("PRODUCTVERSION\s*(\d+),\s*(\d+),\s*(\= d+),\s*(\d+)") -file_version_string_data =3D re.compile("\s*VALUE\s*\"FileVersion\"\s*,\s*= \"([\d.]+)\"") -product_version_string_data =3D re.compile("\s*VALUE\s*\"ProductVersion\"\= s*,\s*\"([\d.]+)\"") +setup_py_version_data =3D re.compile(r"\s*version=3D'([\d.]+)',") +assembly_file_version_data =3D=20 +re.compile(r"\s*\[\s*assembly:\s*AssemblyFileVersion\s*\(\"([\d.]+)\"\) +\s*\]") version_number_data =3D re.compile(r"(\d+)\.(\d+)\.(\d+)\.(\d+)") +file_version_data =3D=20 +re.compile(r"FILEVERSION\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)") +product_version_data =3D=20 +re.compile(r"PRODUCTVERSION\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)") +file_version_string_data =3D=20 +re.compile(r"\s*VALUE\s*\"FileVersion\"\s*,\s*\"([\d.]+)\"") +product_version_string_data =3D=20 +re.compile(r"\s*VALUE\s*\"ProductVersion\"\s*,\s*\"([\d.]+)\"") wheel_package =3D re.compile("^([^-]+)-") def get_current_version_number(): @@ -77,7 +77,7 @@ def set_version_number_setup_py(package_version): def set_version_number_assembly_info(version): assembly_info_files =3D [] - for root, dirnames, filenames in os.walk(".."): + for root, _, filenames in os.walk(".."): for filename in filenames: if fnmatch.fnmatch(filename, "AssemblyInfo.cs"): assembly_info_files.append(os.path.join(root, filename)) @= @ -113,11 +113,11 @@ def _set_version_number_and_wheels_cr_tools_installer_= config(package_version, wh present_wheels.append(found_wheel[0]) for found_wheel in wheels: if found_wheel[0] not in present_wheels: - new_element =3D ElementTree.SubElement(py_vers= ion, "Wheel", - {"Name": = found_wheel[0], - "Path": = found_wheel[1], - "Version= ": package_version, - "Uninsta= llAllOtherCopies": "false"}) + ElementTree.SubElement(py_version, "Wheel", + {"Name": found_wheel[0]= , + "Path": found_wheel[1]= , + "Version": package_ver= sion, + =20 + "UninstallAllOtherCopies": "false"}) elif root_element.tag =3D=3D "Python": py_version =3D root_element present_wheels =3D [] @@ -130,11 +130,11 @@ def _set_version_number_and_wheels_cr_tools_installer= _config(package_version, wh present_wheels.append(found_wheel[0]) for found_wheel in wheels: if found_wheel[0] not in present_wheels: - new_element =3D ElementTree.SubElement(py_version, "Wh= eel", - {"Name": found_wh= eel[0], - "Path": found_wh= eel[1], - "Version": packa= ge_version, - "UninstallAllOth= erCopies": "false"}) + ElementTree.SubElement(py_version, "Wheel", + {"Name": found_wheel[0], + "Path": found_wheel[1], + "Version": package_version, + "UninstallAllOtherCopies":=20 + "false"}) tree.write(file_path) print("Installer config regenerated successfully") @@ -199,16 +199,16 @@ def build_wheels(extension_pkgs): dir_path =3D os.path.dirname(os.path.abspath(os.path.dirname(__file__)= )) file_path =3D os.path.join(dir_path, "setup.py") if ostype =3D=3D WIN: - check_call("py {} \"{}\" bdist_wheel".format(PYTHON_VERSION, file_= path), shell=3DTrue, cwd=3Ddir_path) + check_call("py -{} \"{}\" bdist_wheel".format(PYTHON_VERSION,=20 + file_path), shell=3DTrue, cwd=3Ddir_path) else: - check_call('python3 "{}" bdist_wheel'.format(file_path), shell=3DT= rue, cwd=3Ddir_path) + check_call('python{} "{}" bdist_wheel'.format(PYTHON_VERSION,=20 + file_path), shell=3DTrue, cwd=3Ddir_path) for pkg in extension_pkgs: ext_dir_path =3D os.path.abspath(pkg) ext_file_path =3D os.path.join(ext_dir_path, 'setup.py') if ostype =3D=3D WIN: - check_call("py {} \"{}\" bdist_wheel".format(PYTHON_VERSION, e= xt_file_path), shell=3DTrue, cwd=3Dext_dir_path) + check_call("py -{} \"{}\"=20 + bdist_wheel".format(PYTHON_VERSION, ext_file_path), shell=3DTrue,=20 + cwd=3Dext_dir_path) else: - check_call('python3 "{}" bdist_wheel'.format(ext_file_path), s= hell=3DTrue, cwd=3Dext_dir_path) + check_call('python{} "{}"=20 + bdist_wheel'.format(PYTHON_VERSION, ext_file_path), shell=3DTrue,=20 + cwd=3Dext_dir_path) print("Wheels built successfully") def copy_wheels_and_set_xml(package_version, extension_pkgs): -- 2.20.1