791420737470b786992c7a6bc1663ff503977b3e,setup.py,,,#,9

Before Change




// Describe the version relative to last tag
command_git = ["git", "describe", "--match", "v[0-9]*"]
version_buf = check_output(command_git).rstrip()

// Exclude the "v" for PEP440 conformity, see
// https://www.python.org/dev/peps/pep-0440///public-version-identifiers
version_buf = version_buf[1:]

// Create a niftynet/info.py module that will keep the
// version descriptor returned by Git
info_module = open(os.path.join("niftynet", "info.py"), "w")
info_module.write("// -*- coding: utf-8 -*-\n")
info_module.write("NiftyNet version tracker.\n")
info_module.write("\n")
info_module.write("This module only holds the NiftyNet version,")
info_module.write(" generated using the \n")
info_module.write("``{}`` command.\n".format(" ".join(command_git)))
info_module.write("\n")
info_module.write("\n")
info_module.write("\n")
info_module.write("\n")
info_module.write("VERSION_DESCRIPTOR = "{}"\n".format(version_buf))
info_module.close()

// Regex for checking PEP 440 conformity
// https://www.python.org/dev/peps/pep-0440///id79
pep440_regex = re.compile(
    r"^\s*" + version.VERSION_PATTERN + r"\s*$",
    re.VERBOSE | re.IGNORECASE,
)

// Split the git describe output, as it may not be a tagged commit
tokens = version_buf.split("-")
if len(tokens) > 1:  // not a tagged commit
    // Format a developmental release identifier according to PEP440, see:
    // https://www.python.org/dev/peps/pep-0440///developmental-releases
    version_git = "{}.dev{}".format(tokens[0], tokens[1])

After Change



from utilities.get_niftynet_version import get_niftynet_git_version

version_buf, version_git, command_git = get_niftynet_git_version()

// Create a niftynet/info.py module that will keep the
// version descriptor returned by Git
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: NifTK/NiftyNet
Commit Name: 791420737470b786992c7a6bc1663ff503977b3e
Time: 2017-08-18
Author: d.shakir@ucl.ac.uk
File Name: setup.py
Class Name:
Method Name:


Project Name: NifTK/NiftyNet
Commit Name: 895187880fb16d41133942aae7a935698c6f0a8c
Time: 2017-08-18
Author: t.doel@ucl.ac.uk
File Name: niftynet/utilities/get_niftynet_version.py
Class Name:
Method Name: get_niftynet_version


Project Name: sahana/eden
Commit Name: 326bfca74288b4bc4ea373bb64c59f8be4181664
Time: 2018-05-25
Author: dominic@nursix.org
File Name: modules/s3/s3query.py
Class Name: S3URLQuery
Method Name: parse_expression