From f4b8147ef65d1aa40cd4b6d1aa2d7a3d8a72fa53 Mon Sep 17 00:00:00 2001 From: Jaiveer Singh <84546269+jaiveersinghNV@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:49:50 -0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Supports=20adding=20additional=20cont?= =?UTF-8?q?ext=20required=20to=20build,=20and=20uses=20branch=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 -- sphinx_multiversion/main.py | 30 ++++++++++++------------------ 2 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1618f16..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -sphinx_multiversion.egg-info/ -__pycache__/ diff --git a/sphinx_multiversion/main.py b/sphinx_multiversion/main.py index 04cd1d6..1ea845c 100644 --- a/sphinx_multiversion/main.py +++ b/sphinx_multiversion/main.py @@ -171,12 +171,6 @@ def main(argv=None): action="store_true", help="dump generated metadata and exit", ) - parser.add_argument( - "--additional-context", - nargs="*", - default=[], - help="additional paths-from-gitroot that must be copied to build docs", - ) args, argv = parser.parse_known_args(argv) if args.noconfig: return 1 @@ -244,17 +238,15 @@ def main(argv=None): for gitref in gitrefs: # Clone Git repo repopath = os.path.join(tmp, gitref.commit) - for dir in (cwd_relative, *args.additional_context): - try: - git.copy_tree(str(gitroot), gitroot.as_uri(), repopath, gitref, dir) - except (OSError, subprocess.CalledProcessError): - logger.error( - "Failed to copy git tree %s for %s to %s", - dir, - gitref.refname, - repopath, - ) - continue + try: + git.copy_tree(str(gitroot), gitroot.as_uri(), repopath, gitref) + except (OSError, subprocess.CalledProcessError): + logger.error( + "Failed to copy git tree for %s to %s", + gitref.refname, + repopath, + ) + continue # Find config confpath = os.path.join(repopath, confdir) @@ -347,6 +339,8 @@ def main(argv=None): *defines, "-D", "smv_current_version={}".format(version_name), + "-c", + confdir_absolute, "-w", os.path.join(tmp, "smv-err.log"), data["sourcedir"], @@ -375,7 +369,7 @@ def main(argv=None): } ) subprocess.check_call(cmd, cwd=current_cwd, env=env) - + if args.warningfile: with open(args.warningfile, mode="a") as wf: with open(os.path.join(tmp, "smv-err.log"), mode="r") as err_log: