Skip to content

Commit a7e94d6

Browse files
committed
Merge remote-tracking branch 'upstream/maint/3.2.x'
2 parents 2e5b434 + a1a55ff commit a7e94d6

File tree

6 files changed

+120
-76
lines changed

6 files changed

+120
-76
lines changed

.github/workflows/misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Miscellaneous checks
22

33
# This file runs doctests on the documentation and style checks
44

5-
on: [push]
5+
on: [push, pull_request]
66

77
defaults:
88
run:

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Pre-release checks
22

33
# This file tests against pre-release wheels for dependencies
44

5-
on: [push]
5+
on: [push, pull_request]
66

77
defaults:
88
run:

.github/workflows/stable.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Stable tests
66
# * Dependencies: minimum requirements, optional requirements
77
# * Installation methods: setup.py, sdist, wheel, archive
88

9-
on: [push]
9+
on: [push, pull_request]
1010

1111
defaults:
1212
run:
@@ -21,7 +21,7 @@ jobs:
2121
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
2222
python-version: [3.6, 3.7, 3.8, 3.9]
2323
architecture: ['x64', 'x86']
24-
install: ['setup']
24+
install: ['pip']
2525
check: ['test']
2626
pip-flags: ['']
2727
depends: ['REQUIREMENTS']
@@ -54,7 +54,7 @@ jobs:
5454
# Clean install imports only with package-declared dependencies
5555
- os: ubuntu-latest
5656
python-version: 3.6
57-
install: setup
57+
install: pip
5858
check: skiptests
5959
pip-flags: ''
6060
depends: ''

nibabel/_version.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# that just contains the computed version number.
77

88
# This file is released into the public domain. Generated by
9-
# versioneer-0.18 (https://github.com/warner/python-versioneer)
9+
# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer)
1010

1111
"""Git implementation of _version.py."""
1212

@@ -58,7 +58,7 @@ class NotThisMethod(Exception):
5858

5959

6060
def register_vcs_handler(vcs, method): # decorator
61-
"""Decorator to mark a method as the handler for a particular VCS."""
61+
"""Create decorator to mark a method as the handler of a VCS."""
6262
def decorate(f):
6363
"""Store f in HANDLERS[vcs][method]."""
6464
if vcs not in HANDLERS:
@@ -94,9 +94,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
9494
if verbose:
9595
print("unable to find command, tried %s" % (commands,))
9696
return None, None
97-
stdout = p.communicate()[0].strip()
98-
if sys.version_info[0] >= 3:
99-
stdout = stdout.decode()
97+
stdout = p.communicate()[0].strip().decode()
10098
if p.returncode != 0:
10199
if verbose:
102100
print("unable to run %s (error)" % dispcmd)
@@ -174,6 +172,10 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
174172
raise NotThisMethod("Short version file found")
175173
date = keywords.get("date")
176174
if date is not None:
175+
# Use only the last line. Previous lines may contain GPG signature
176+
# information.
177+
date = date.splitlines()[-1]
178+
177179
# git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
178180
# datestamp. However we prefer "%ci" (which expands to an "ISO-8601
179181
# -like" string, which we must then edit to make compliant), because
@@ -314,6 +316,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
314316
# commit date: see ISO-8601 comment in git_versions_from_keywords()
315317
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
316318
cwd=root)[0].strip()
319+
# Use only the last line. Previous lines may contain GPG signature
320+
# information.
321+
date = date.splitlines()[-1]
317322
pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
318323

319324
return pieces
@@ -352,18 +357,18 @@ def render_pep440(pieces):
352357

353358

354359
def render_pep440_pre(pieces):
355-
"""TAG[.post.devDISTANCE] -- No -dirty.
360+
"""TAG[.post0.devDISTANCE] -- No -dirty.
356361
357362
Exceptions:
358-
1: no tags. 0.post.devDISTANCE
363+
1: no tags. 0.post0.devDISTANCE
359364
"""
360365
if pieces["closest-tag"]:
361366
rendered = pieces["closest-tag"]
362367
if pieces["distance"]:
363-
rendered += ".post.dev%d" % pieces["distance"]
368+
rendered += ".post0.dev%d" % pieces["distance"]
364369
else:
365370
# exception #1
366-
rendered = "0.post.dev%d" % pieces["distance"]
371+
rendered = "0.post0.dev%d" % pieces["distance"]
367372
return rendered
368373

369374

@@ -399,7 +404,7 @@ def render_pep440_old(pieces):
399404
400405
The ".dev0" means dirty.
401406
402-
Eexceptions:
407+
Exceptions:
403408
1: no tags. 0.postDISTANCE[.dev0]
404409
"""
405410
if pieces["closest-tag"]:

tools/ci/build_archive.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ elif [ "$INSTALL_TYPE" == "wheel" ]; then
2121
elif [ "$INSTALL_TYPE" == "archive" ]; then
2222
export ARCHIVE="package.tar.gz"
2323
git archive -o $ARCHIVE HEAD
24+
elif [ "$INSTALL_TYPE" == "pip" ]; then
25+
export ARCHIVE="."
2426
fi
2527

2628
set +eux

0 commit comments

Comments
 (0)