From nobody Fri May 3 19:51:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52579+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52579+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1577412326; cv=none; d=zohomail.com; s=zohoarc; b=Ix79kCMUa1ZRLrDLjlh6gMvGB6lRwJJX4KTyhtDh4ArVgjg/YarVVFSIAjZuiEQ7A3I1xlCAdFFypw+mOYMqnqXOiY0cIcjnV8gdq95GgcqDDpqWi2G5l2Zlxhl2wOuXlB+m+d+RJ5Zdurvd+FlAsD3BRj7pg4vBQTVcZwR/pWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577412326; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=tjTH4KsVUKBRn9FeVx74RS1bWIJbe8IxhoHFjOnNqXM=; b=aEKw8oIJgwOayZOneIGnhl1Kp9rSbE9YIak8sqg1PWm1/C/i3Lk3C0LrnQK5Lq/BdG/tqIpXEnsaJpHZ+KDaKOW5DNnHE5YVXoahcIgTmLSVHhQGEvv3Ujo2zi9cnpOJfCq6XXcEBI0OK4lnKnsgXnRqsw/d5aDE2Vada56PLlU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52579+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157741232657766.81204478816016; Thu, 26 Dec 2019 18:05:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id XRb6YY1788612xb1hTtFRx2r; Thu, 26 Dec 2019 18:05:26 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.27221.1577412325607967574 for ; Thu, 26 Dec 2019 18:05:25 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Dec 2019 18:05:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,361,1571727600"; d="scan'208";a="219994405" X-Received: from jlendah-mobl1.amr.corp.intel.com ([10.254.188.175]) by orsmga006.jf.intel.com with ESMTP; 26 Dec 2019 18:05:24 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Ashley DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: Fix PYTHON_VERSION usage Date: Thu, 26 Dec 2019 18:05:21 -0800 Message-Id: <20191227020521.9149-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com X-Gm-Message-State: 4TiTVUdZRRNLsvkZWeO63qNVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1577412326; bh=FrWyx4btXEQpE7uSyDDc2RMNjWltFZXfS56qYuOEvuE=; h=Cc:Date:From:Reply-To:Subject:To; b=dhx1Znow1UNcgeEoSo4KWom9lruXKmLvPiw7QHL+aJfv6GBFITXFvxEist7ISdBlpwO zPMzba9rQqSPiLWFhA1C5YwH8407o+3BYcdeqjXWRrNyZuUUAb9fW0mMEIQcDmg5bdsfM QavKjFQQfS3nyIFgpiTU2wLk2L7tuEKeEoU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Nate DeSimone PYTHON_VERSION in set_version_and_build_wheels.py is only being used for Windows right now. This patch adds Linux support. Cc: Ashley DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Signed-off-by: Nate DeSimone Reviewed-by: Ashley 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 re.compile(r"\s*\[\s*assembly:\s*AssemblyFi= leVersion\s*\(\"([\d.]+)\"\)\s*\]") +version_number_data =3D re.compile(r"(\d+)\.(\d+)\.(\d+)\.(\d+)") +file_version_data =3D re.compile(r"FILEVERSION\s*(\d+),\s*(\d+),\s*(\d+),\= s*(\d+)") +product_version_data =3D re.compile(r"PRODUCTVERSION\s*(\d+),\s*(\d+),\s*(= \d+),\s*(\d+)") +file_version_string_data =3D re.compile(r"\s*VALUE\s*\"FileVersion\"\s*,\s= *\"([\d.]+)\"") +product_version_string_data =3D 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, + "UninstallAllOtherCopi= es": "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": "fa= lse"}) 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, 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, 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 -{} \"{}\" bdist_wheel".format(PYTHON_VERSION, = ext_file_path), shell=3DTrue, cwd=3Dext_dir_path) else: - check_call('python3 "{}" bdist_wheel'.format(ext_file_path), s= hell=3DTrue, cwd=3Dext_dir_path) + check_call('python{} "{}" bdist_wheel'.format(PYTHON_VERSION, = ext_file_path), shell=3DTrue, cwd=3Dext_dir_path) print("Wheels built successfully") def copy_wheels_and_set_xml(package_version, extension_pkgs): -- 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52579): https://edk2.groups.io/g/devel/message/52579 Mute This Topic: https://groups.io/mt/69280779/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-