提交 1a014483 authored 作者: Michał Górny's avatar Michał Górny 提交者: Brandon T. Willard

Update versioneer to fix build_ext bug

Update the generated versioneer fixes to the current git, in order to pull a bugfix that fixes the support for calling `build_ext` prior to `build_py`. This is part of Gentoo's workflow, and the current version of generated files is requiring us to use workarounds.
上级 45642af3
......@@ -6,7 +6,7 @@
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.21 (https://github.com/python-versioneer/python-versioneer)
# versioneer-0.23.dev0 (https://github.com/python-versioneer/python-versioneer)
"""Git implementation of _version.py."""
......@@ -16,6 +16,7 @@ import re
import subprocess
import sys
from typing import Callable, Dict
import functools
def get_keywords():
......@@ -73,6 +74,14 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
"""Call the given command(s)."""
assert isinstance(commands, list)
process = None
popen_kwargs = {}
if sys.platform == "win32":
# This hides the console window if pythonw.exe is used
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
popen_kwargs["startupinfo"] = startupinfo
for command in commands:
try:
dispcmd = str([command] + args)
......@@ -80,7 +89,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
process = subprocess.Popen([command] + args, cwd=cwd, env=env,
stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
else None), **popen_kwargs)
break
except OSError:
e = sys.exc_info()[1]
......@@ -228,10 +237,15 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
version string, meaning we're inside a checked out source tree.
"""
GITS = ["git"]
TAG_PREFIX_REGEX = "*"
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
TAG_PREFIX_REGEX = r"\*"
# GIT_DIR can interfere with correct operation of Versioneer.
# It may be intended to be passed to the Versioneer-versioned project,
# but that should not change where we get our version from.
env = os.environ.copy()
env.pop("GIT_DIR", None)
runner = functools.partial(runner, env=env)
_, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
......@@ -240,12 +254,12 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
print("Directory %s not under git control" % root)
raise NotThisMethod("'git rev-parse --git-dir' returned error")
MATCH_ARGS = ["--match", "%s*" % tag_prefix] if tag_prefix else []
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match",
"%s%s" % (tag_prefix, TAG_PREFIX_REGEX)],
"--always", "--long", *MATCH_ARGS],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论