From a8c3cd37dbf960ff6b921f7b9612190693004dfe Mon Sep 17 00:00:00 2001 From: geisserml Date: Thu, 18 Jan 2024 20:23:48 +0100 Subject: [PATCH] Remove `git status` assert On CI, there is an uncommitted file `RELEASE.md`, so the output looks like this ``` M pyproject.toml ?? RELEASE.md ``` causing our assertion to fail. A possible fix would be to pass `--untracked-files=no`. However, it seems more straightforward to just remove the assert. Callers should refrain from abusing `SDIST_IGNORE_DIRTY`, though. --- setup.py | 2 -- setupsrc/pypdfium2_setup/packaging_base.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bea7cfd3c..6660a2b76 100644 --- a/setup.py +++ b/setup.py @@ -106,8 +106,6 @@ def run_setup(modnames, pl_name, pdfium_ver): if helpers_info["dirty"]: # ignore dirty state due to craft_packages::tmp_ctypesgen_pin() if int(os.environ.get("SDIST_IGNORE_DIRTY", 0)): - status = run_cmd(["git", "status", "--porcelain"], capture=True, cwd=ProjectDir).strip() - assert status == "M pyproject.toml" helpers_info["dirty"] = False else: print("!!! Warning: sdist built without ctypesgen pin?", file=sys.stderr) diff --git a/setupsrc/pypdfium2_setup/packaging_base.py b/setupsrc/pypdfium2_setup/packaging_base.py index 0c93a3a65..6c80d2afb 100644 --- a/setupsrc/pypdfium2_setup/packaging_base.py +++ b/setupsrc/pypdfium2_setup/packaging_base.py @@ -212,7 +212,7 @@ def parse_given_tag(full_tag): info = dict() - # TODO looks like `git describe --dirty` does not account for new committable files, but this could be relevant - consider evaluating dirty ourselves by checking if `git status --porcelain` is non-empty + # NOTE `git describe --dirty` does not account for new unregistered files tag = full_tag dirty = tag.endswith("-dirty") if dirty: