From b3db213b1abe23aa1d70896dcaa1e76fb8cdfc7b Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 19 Nov 2021 22:58:08 -0500 Subject: [PATCH] build (client): Remove pygit2 dependency --- requirements39.txt | 1 - tools/buildspark.py | 31 +++---------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/requirements39.txt b/requirements39.txt index 4511706b8..bd0a2b7b5 100644 --- a/requirements39.txt +++ b/requirements39.txt @@ -8,7 +8,6 @@ mccabe==0.6.1 platformdirs==2.3.0 pycodestyle==2.7.0 pycparser==2.20 -pygit2==1.6.1 pylint==2.10.2 toml==0.10.2 wrapt==1.12.1 diff --git a/tools/buildspark.py b/tools/buildspark.py index 8dbdfcf53..e0e7343e4 100644 --- a/tools/buildspark.py +++ b/tools/buildspark.py @@ -1,6 +1,5 @@ import argparse import os -import pygit2 import subprocess import shutil @@ -100,14 +99,6 @@ def _get_arg_parser(): nargs='?', help='The directory in which to put build files') - parser.add_argument( - '--cache-branch', - help='Whether or not to build in a directory named ' + - "'build.' (which is then symlinked to the normal " + - "'build' directory)", - action='store_true', - required=False) - _add_toggle_opt( parser, 'clean', @@ -126,20 +117,13 @@ def _rmdir_or_unlink(dir): shutil.rmtree(dir) -def _create_and_link_build_dir(build_dir, dbuild_dir, clean): +def _create_and_link_build_dir(build_dir, clean): if not os.path.exists(build_dir): os.makedirs(build_dir) elif clean: _rmdir_or_unlink(build_dir) os.makedirs(build_dir) - if build_dir != dbuild_dir: - if clean: - _rmdir_or_unlink(dbuild_dir) - elif os.path.islink(dbuild_dir): - os.unlink(dbuild_dir) - os.symlink(build_dir, dbuild_dir) - def _exit(code=0, msg=None): if msg is not None: @@ -164,16 +148,8 @@ if __name__ == "__main__": os.environ[ 'spark_build_python_path'] = fr'{SparkPaths.tools()}\..\externals\windows\bin\python' - repo = pygit2.Repository(SparkPaths.root()) args_dict = vars(args) - build_dir = _get_arg(args_dict, 'output_dir') - if build_dir is None: - if _get_arg(args_dict, 'cache_branch'): - branch_name = os.path.basename(repo.head.name) - build_dir = f'build.{branch_name}' - else: - build_dir = SparkPaths.default_build() - + build_dir = _get_arg(args_dict, 'output_dir') or SparkPaths.default_build() clean = args.clean if build_dir is None: print(args) @@ -181,8 +157,7 @@ if __name__ == "__main__": try: build_dir = os.path.realpath(build_dir) - dbuild_dir = SparkPaths.default_build() - _create_and_link_build_dir(build_dir, dbuild_dir, clean) + _create_and_link_build_dir(build_dir, clean) _configure_libspark(build_dir) except Exception as e: _exit(e)