Skip to content

Commit

Permalink
Remove git status assert
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mara004 committed Jan 18, 2024
1 parent bb68b1a commit a8c3cd3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/packaging_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a8c3cd3

Please sign in to comment.