pytest_wdl/utils.py
def find_in_classpath(glob: str) -> Optional[Path]:
    """
    Attempts to find a .jar file matching the specified glob pattern in the
    Java classpath.

    Args:
        glob: JAR filename pattern

    Returns:
        Path to the JAR file, or None if a matching file is not found.
    """
    classpath = os.environ.get(ENV_CLASSPATH, DEFAULT_CLASSPATH)

    for path_str in classpath.split(os.pathsep):
        path = ensure_path(path_str)
        if path.exists():
            if path.is_dir():
                matches = list(path.glob(glob))
                if matches:
                    if len(matches) > 1:
                        LOG.warning(
                            "Found multiple jar files matching pattern %s: %s;"
                            "returning the first one.",
                            glob,
                            matches,
                        )
                    return matches[0]
            elif path.exists() and fnmatch.fnmatch(path.name, glob):
                return path

    Attempts to find a .jar file matching the specified glob pattern in the
    Java classpath.

    Args:
        glob: JAR filename pattern

    Returns:
        Path to the JAR file, or None if a matching file is not found.
    
Attempts to find a .jar file matching the specified glob pattern in the
Java classpath.
Attempts to find a . jar file matching the specified glob pattern in the Java classpath .
def find_in_classpath(glob: str) -> Optional[Path]:
    classpath = os.environ.get(ENV_CLASSPATH, DEFAULT_CLASSPATH)
    for path_str in classpath.split(os.pathsep):
        path = ensure_path(path_str)
        if path.exists():
            if path.is_dir():
                matches = list(path.glob(glob))
                if matches:
                    if len(matches) > 1:
                        LOG.warning(
                            "Found multiple jar files matching pattern %s: %s;"
                            "returning the first one.",
                            glob,
                            matches,
                        )
                    return matches[0]
            elif path.exists() and fnmatch.fnmatch(path.name, glob):
                return path
def find_in_classpath ( glob : str ) -> Optional [ Path ] : classpath = os . environ . get ( ENV_CLASSPATH , DEFAULT_CLASSPATH ) for path_str in classpath . split ( os . pathsep ) : path = ensure_path ( path_str ) if path . exists ( ) : if path . is_dir ( ) : matches = list ( path . glob ( glob ) ) if matches : if len ( matches ) > 1 : LOG . warning ( "Found multiple jar files matching pattern %s: %s;" "returning the first one." , glob , matches , ) return matches [ 0 ] elif path . exists ( ) and fnmatch . fnmatch ( path . name , glob ) : return path
Attempts to find a .jar file matching the specified glob pattern in the
Java classpath.
Attempts to find a . jar file matching the specified glob pattern in the Java classpath .
"""
    Attempts to find a .jar file matching the specified glob pattern in the
    Java classpath.

    Args:
        glob: JAR filename pattern

    Returns:
        Path to the JAR file, or None if a matching file is not found.
    """
Path to the JAR file, or None if a matching file is not found.
Path to the JAR file or None if a matching file is not found .
glob
str
JAR filename pattern
JAR filename pattern