예제 #1
0
def update_version_py():
    if not os.path.isdir(".git"):
        print_("This does not appear to be a Git repository.")
        return
    try:
        p = subprocess.Popen(["git", "describe",
                              "--tags", "--dirty", "--always"],
                             stdout=subprocess.PIPE)
    except EnvironmentError:
        print_("unable to run git, leaving ecdsa/_version.py alone")
        return
    stdout = p.communicate()[0]
    if p.returncode != 0:
        print_("unable to run git, leaving ecdsa/_version.py alone")
        return
    # we use tags like "python-ecdsa-0.5", so strip the prefix
    assert stdout.startswith("python-ecdsa-")
    ver = stdout[len("python-ecdsa-"):].strip()
    f = open("ecdsa/_version.py", "w")
    f.write(VERSION_PY % ver)
    f.close()
    print_("set ecdsa/_version.py to '%s'" % ver)
예제 #2
0
def update_version_py():
    if not os.path.isdir(".git"):
        print_("This does not appear to be a Git repository.")
        return
    try:
        p = subprocess.Popen(
            ["git", "describe", "--tags", "--dirty", "--always"],
            stdout=subprocess.PIPE)
    except EnvironmentError:
        print_("unable to run git, leaving ecdsa/_version.py alone")
        return
    stdout = p.communicate()[0]
    if p.returncode != 0:
        print_("unable to run git, leaving ecdsa/_version.py alone")
        return
    # we use tags like "python-ecdsa-0.5", so strip the prefix
    assert stdout.startswith("python-ecdsa-")
    ver = stdout[len("python-ecdsa-"):].strip()
    f = open("ecdsa/_version.py", "w")
    f.write(VERSION_PY % ver)
    f.close()
    print_("set ecdsa/_version.py to '%s'" % ver)
예제 #3
0
 def run(self):
     update_version_py()
     print_("Version is now", get_version())
예제 #4
0
 def run(self):
     update_version_py()
     print_("Version is now", get_version())