code: def parse_version(fpath):
      """
      Statically parse the version number from a python file
      """
      import ast
  
      if not exists(fpath):
          raise ValueError("fpath={!r} does not exist".format(fpath))
      with open(fpath, "r") as file_:
          sourcecode = file_.read()
      pt = ast.parse(sourcecode)
  
      class VersionVisitor(ast.NodeVisitor):
          def visit_Assign(self, node):
              for target in node.targets:
                  if getattr(target, "id", None) == "__version__":
                      self.version = node.value.s
  
      visitor = VersionVisitor()
      visitor.visit(pt)
      return visitor.version
  
imports: from os.path import exists
  from os.path import sys
  from setuptools import setup, find_packages
label_desc: Use image node_id 1 for calling a global function with example usage: parse_version(fpath) and returns: visitor