1
1
2
- # Version: 0.17
2
+ # Version: 0.18-1
3
3
4
4
"""The Versioneer - like a rocketeer, but for versions.
5
5
10
10
* https://github.com/warner/python-versioneer
11
11
* Brian Warner
12
12
* License: Public Domain
13
- * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, and pypy
13
+ * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
14
14
* [![Latest Version]
15
15
(https://pypip.in/version/versioneer/badge.svg?style=flat)
16
16
](https://pypi.python.org/pypi/versioneer/)
151
151
software (exactly equal to a known tag), the identifier will only contain the
152
152
stripped tag, e.g. "0.11".
153
153
154
- Other styles are available. See details.md in the Versioneer source tree for
155
- descriptions.
154
+ Other styles are available. See [ details.md](details.md) in the Versioneer
155
+ source tree for descriptions.
156
156
157
157
## Debugging
158
158
@@ -364,6 +364,7 @@ def get(parser, name):
364
364
class NotThisMethod (Exception ):
365
365
"""Exception raised if a method is not valid for the current scenario."""
366
366
367
+
367
368
# these dictionaries contain VCS-specific tools
368
369
LONG_VERSION_PY = {}
369
370
HANDLERS = {}
@@ -415,6 +416,8 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
415
416
print ("stdout was %s" % stdout )
416
417
return None , p .returncode
417
418
return stdout , p .returncode
419
+
420
+
418
421
LONG_VERSION_PY ['git' ] = '''
419
422
# This file helps to compute a version number in source trees obtained from
420
423
# git-archive tarball (such as those provided by githubs download-from-tag
@@ -423,7 +426,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
423
426
# that just contains the computed version number.
424
427
425
428
# This file is released into the public domain. Generated by
426
- # versioneer-0.17 (https://github.com/warner/python-versioneer)
429
+ # versioneer-0.18 (https://github.com/warner/python-versioneer)
427
430
428
431
"""Git implementation of _version.py."""
429
432
@@ -1176,8 +1179,9 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
1176
1179
(str (rootdirs ), parentdir_prefix ))
1177
1180
raise NotThisMethod ("rootdir doesn't start with parentdir_prefix" )
1178
1181
1182
+
1179
1183
SHORT_VERSION_PY = """
1180
- # This file was generated by 'versioneer.py' (0.17 ) from
1184
+ # This file was generated by 'versioneer.py' (0.18 ) from
1181
1185
# revision-control system data, or from the parent directory name of an
1182
1186
# unpacked source archive. Distribution tarballs contain a pre-generated copy
1183
1187
# of this file.
@@ -1555,6 +1559,31 @@ def run(self):
1555
1559
write_to_version_file (target_versionfile , versions )
1556
1560
cmds ["build_py" ] = cmd_build_py
1557
1561
1562
+ if "setuptools" in sys .modules :
1563
+ from setuptools .command .build_ext import build_ext as _build_ext
1564
+ else :
1565
+ from distutils .command .build_ext import build_ext as _build_ext
1566
+
1567
+ class cmd_build_ext (_build_ext ):
1568
+ def run (self ):
1569
+ root = get_root ()
1570
+ cfg = get_config_from_root (root )
1571
+ versions = get_versions ()
1572
+ _build_ext .run (self )
1573
+ if self .inplace :
1574
+ # build_ext --inplace will only build modules in
1575
+ # build/lib<..> dir with no _version.py to write to.
1576
+ # As in place builds will already have a _version.py
1577
+ # in the module dir, we do not need to write one.
1578
+ return
1579
+ # now locate _version.py in the new build/ directory and replace
1580
+ # it with an updated value
1581
+ target_versionfile = os .path .join (self .build_lib ,
1582
+ cfg .versionfile_source )
1583
+ print ("UPDATING %s" % target_versionfile )
1584
+ write_to_version_file (target_versionfile , versions )
1585
+ cmds ["build_ext" ] = cmd_build_ext
1586
+
1558
1587
if "cx_Freeze" in sys .modules : # cx_freeze enabled?
1559
1588
from cx_Freeze .dist import build_exe as _build_exe
1560
1589
# nczeczulin reports that py2exe won't like the pep440-style string
@@ -1808,6 +1837,7 @@ def scan_setup_py():
1808
1837
errors += 1
1809
1838
return errors
1810
1839
1840
+
1811
1841
if __name__ == "__main__" :
1812
1842
cmd = sys .argv [1 ]
1813
1843
if cmd == "setup" :
0 commit comments