|
@@ -83,7 +83,7 @@ To use it: |
|
|
import os, sys, re |
|
|
import os, sys, re |
|
|
from distutils.core import Command |
|
|
from distutils.core import Command |
|
|
from distutils.command.sdist import sdist as _sdist |
|
|
from distutils.command.sdist import sdist as _sdist |
|
|
from distutils.command.build import build as _build |
|
|
|
|
|
|
|
|
from distutils.command.build_py import build_py as _build_py |
|
|
|
|
|
|
|
|
versionfile_source = None |
|
|
versionfile_source = None |
|
|
versionfile_build = None |
|
|
versionfile_build = None |
|
@@ -578,11 +578,10 @@ class cmd_version(Command): |
|
|
ver = get_version(verbose=True) |
|
|
ver = get_version(verbose=True) |
|
|
print("Version is currently: %s" % ver) |
|
|
print("Version is currently: %s" % ver) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cmd_build(_build): |
|
|
|
|
|
|
|
|
class cmd_build_py(_build_py): |
|
|
def run(self): |
|
|
def run(self): |
|
|
versions = get_versions(verbose=True) |
|
|
versions = get_versions(verbose=True) |
|
|
_build.run(self) |
|
|
|
|
|
|
|
|
_build_py.run(self) |
|
|
# now locate _version.py in the new build/ directory and replace it |
|
|
# now locate _version.py in the new build/ directory and replace it |
|
|
# with an updated value |
|
|
# with an updated value |
|
|
target_versionfile = os.path.join(self.build_lib, versionfile_build) |
|
|
target_versionfile = os.path.join(self.build_lib, versionfile_build) |
|
@@ -651,6 +650,6 @@ class cmd_update_files(Command): |
|
|
def get_cmdclass(): |
|
|
def get_cmdclass(): |
|
|
return {'version': cmd_version, |
|
|
return {'version': cmd_version, |
|
|
'update_files': cmd_update_files, |
|
|
'update_files': cmd_update_files, |
|
|
'build': cmd_build, |
|
|
|
|
|
|
|
|
'build_py': cmd_build_py, |
|
|
'sdist': cmd_sdist, |
|
|
'sdist': cmd_sdist, |
|
|
} |
|
|
} |