def METHOD_NAME(git_repo='cctbx_project', basename='cctbx_version',
                         version=None, setup_template=None):
  '''
  Function for creating the files containing the version. This
  function is called by bootstrap.py after downloading the git
  repository. The development version is the date of the commit and
  the commit information from "git describe". Files containing an
  official release version can created by providing the version as an
  argument
  Parameters
  ----------
  git_repo: str
    The git repository to be versioned. This is the directory name in
    "modules" (e.g. cctbx_project)
  basename: str
    The basename for the filenames. It is also the name of the defintion
    in the C++ header. The ".txt" and ".h" extensions will be added to
    the filenames.
  version: str
    If set, this argument is used as the version
  setup_template: str
    A template for the setup.py file. There should be a {version} field.
  Returns
  -------
  filenames: str
    A tuple containing the three filenames. The first is the plain text
    file, the second is a C++ header file, and the last is a setup.py
    file. These files are located in the git repository. The plain text
    and header cab be copied to the build directory in libtbx_refresh.py.
  '''
  path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', git_repo)
  if not os.path.isdir(path):
    raise RuntimeError('The {path} directory does not exist.'.format(path=path))
  if version is None:
    tagged = False  # True for tagged release
    # create {y}.{m}.dev{d}+{n}.{h} formatted version
    y = None  # year
    m = None  # month
    d = None  # day
    n = None  # number of commits since last tag
    h = None  # g + hash of commit
    # check for release tag
    try:
      output = subprocess.check_output(['git', 'describe'], cwd=path).decode('utf8')
      output = output.split('-')
      if len(output) == 1:  # tagged release does not have -
        tagged = True
        version = output[0][1:].strip()  # remove first v
      else:
        n = int(output[-2])
        h = output[-1].strip()
    except subprocess.CalledProcessError:
      pass
    # create local version
    if not tagged:
      try:
        t = subprocess.check_output(['git', 'log', '-1', '--pretty=%ci'], cwd=path).decode('utf8')
        t = t.split()[0].split('-')
        y = int(t[0])
        m = int(t[1])
        d = int(t[2])
      except subprocess.CalledProcessError:
        t = time.localtime()
        y = t.tm_year
        m = t.tm_mon
        d = t.tm_mday
      version = '{y}.{m}.dev{d}'.format(y=y, m=m, d=d)
      # add latest commit information as local version
      if n is not None and h is not None:
        version += '+{n}.{h}'.format(n=n, h=h)
      else:
        version += '+unknown'
  # write plain text
  txt_filename = os.path.join(path, basename + '.txt')
  with open(txt_filename, 'w') as f:
    f.write(version)
  # write C++ header
  header_template = '''\