parameters: (egg_base, install_dir, egg_path)
return_statement: return path_to_setup
docstring: Generate a path from egg_base back to '.' where the
          setup script resides and ensure that path points to the
          setup path from $install_dir/$egg_path.
docstring_summary: Generate a path from egg_base back to '.' where the
          setup script resides and ensure that path points to the
          setup path from $install_dir/$egg_path.
docstring_tokens: Generate a path from egg_base back to . where the setup script resides and ensure that path points to the setup path from $install_dir / $egg_path .
function: def _resolve_setup_path(egg_base, install_dir, egg_path):
          """
          Generate a path from egg_base back to '.' where the
          setup script resides and ensure that path points to the
          setup path from $install_dir/$egg_path.
          """
          path_to_setup = egg_base.replace(os.sep, '/').rstrip('/')
          if path_to_setup != os.curdir:
              path_to_setup = '../' * (path_to_setup.count('/') + 1)
          resolved = pkg_resources.normalize_path(
              os.path.join(install_dir, egg_path, path_to_setup)
          )
          if resolved != pkg_resources.normalize_path(os.curdir):
              raise DistutilsOptionError(
                  "Can't get a consistent path to setup script from"
                  " installation directory", resolved,
                  pkg_resources.normalize_path(os.curdir))
          return path_to_setup
function_tokens: def _resolve_setup_path ( egg_base , install_dir , egg_path ) : path_to_setup = egg_base . replace ( os . sep , '/' ) . rstrip ( '/' ) if path_to_setup != os . curdir : path_to_setup = '../' * ( path_to_setup . count ( '/' ) + 1 ) resolved = pkg_resources . normalize_path ( os . path . join ( install_dir , egg_path , path_to_setup ) ) if resolved != pkg_resources . normalize_path ( os . curdir ) : raise DistutilsOptionError ( "Can't get a consistent path to setup script from" " installation directory" , resolved , pkg_resources . normalize_path ( os . curdir ) ) return path_to_setup