code: def get_setup_version(location, reponame, pkgname=None, archive_commit=None):
      
      import warnings
      pkgname = reponame if pkgname is None else pkgname
      if archive_commit is None:
          warnings.warn("No archive commit available; git archives will not contain version information")
      return Version.setup_version(os.path.dirname(os.path.abspath(location)),reponame,pkgname=pkgname,archive_commit=archive_commit)
docs: Helper for use in setup.py to get the current version from either
      git describe or the .version file (if available).
  
      Set pkgname to the package name if it is different from the
      repository name.
  
      To ensure git information is included in a git archive, add
      setup.py to .gitattributes (in addition to __init__):
      ```
      __init__.py export-subst
      setup.py export-subst
      ```
      Then supply "$Format:%h$" for archive_commit.