|
1 | 1 |
|
2 |
| -# Version: 0.18 |
| 2 | +# Version: 0.18-1 |
3 | 3 |
|
4 | 4 | """The Versioneer - like a rocketeer, but for versions.
|
5 | 5 |
|
@@ -1559,6 +1559,31 @@ def run(self):
|
1559 | 1559 | write_to_version_file(target_versionfile, versions)
|
1560 | 1560 | cmds["build_py"] = cmd_build_py
|
1561 | 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 | + |
1562 | 1587 | if "cx_Freeze" in sys.modules: # cx_freeze enabled?
|
1563 | 1588 | from cx_Freeze.dist import build_exe as _build_exe
|
1564 | 1589 | # nczeczulin reports that py2exe won't like the pep440-style string
|
|
0 commit comments