From patchwork Tue May 12 20:09:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8521: pyoxidizer: formatting bazel definitions From: phabricator X-Patchwork-Id: 46307 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Tue, 12 May 2020 20:09:53 +0000 rdamazio created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This meets the Bazel style guide: https://docs.bazel.build/versions/master/skylark/bzl-style.html and was mostly done automatically with buildifier. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8521 AFFECTED FILES rust/hgcli/pyoxidizer.bzl CHANGE DETAILS To: rdamazio, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl --- a/rust/hgcli/pyoxidizer.bzl +++ b/rust/hgcli/pyoxidizer.bzl @@ -3,19 +3,16 @@ # Code to run in Python interpreter. RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()" - set_build_path(ROOT + "/build/pyoxidizer") - def make_distribution(): return default_python_distribution() - def make_distribution_windows(): - return default_python_distribution(flavor="standalone_dynamic") - + return default_python_distribution(flavor = "standalone_dynamic") def make_exe(dist): + """Builds a Rust-wrapped Mercurial binary.""" config = PythonInterpreterConfig( raw_allocator = "system", run_eval = RUN_CODE, @@ -58,23 +55,20 @@ # On Windows, we install extra packages for convenience. if "windows" in BUILD_TARGET_TRIPLE: exe.add_python_resources( - dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]) + dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]), ) return exe - def make_manifest(dist, exe): m = FileManifest() m.add_python_resource(".", exe) return m - def make_embedded_resources(exe): return exe.to_embedded_resources() - register_target("distribution_posix", make_distribution) register_target("distribution_windows", make_distribution_windows)