Skip to content

Commit

Permalink
[CI] Work around lack of name in setup.py in recent Mercurial
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Oct 25, 2024
1 parent 4fb9f8d commit 9827742
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CI/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,15 @@ def __init__(self, os_and_version):
" mercurial-{}/mercurial/exewrapper.c".format(version)
)

if len(version) == 40 or parse_version(version) >= parse_version("6.9"):
# Newer versions of Mercurial removed the name in the setup() call
# to move it into pyproject.toml, but we remove that file.
# Without the name, `pip wheel` creates a package for `UNKNOWN`.
pre_command.append(
"sed -i 's/version=setupversion/name=\"mercurial\", \\0/'"
" mercurial-{}/setup.py".format(version)
)

h = hashlib.sha1(env.hexdigest.encode())
h.update(artifact.encode())
if os.endswith("osx"):
Expand Down

0 comments on commit 9827742

Please sign in to comment.