$42 GRAYBYTE WORDPRESS FILE MANAGER $43

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/req/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/req//pep723.py
import re
from typing import Any

from pip._internal.utils.compat import tomllib

REGEX = r"(?m)^# /// (?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$"


class PEP723Exception(ValueError):
    """Raised to indicate a problem when parsing PEP 723 metadata from a script"""

    def __init__(self, msg: str) -> None:
        self.msg = msg


def pep723_metadata(scriptfile: str) -> dict[str, Any]:
    with open(scriptfile) as f:
        script = f.read()

    name = "script"
    matches = list(
        filter(lambda m: m.group("type") == name, re.finditer(REGEX, script))
    )

    if len(matches) > 1:
        raise PEP723Exception(f"Multiple {name!r} blocks found in {scriptfile!r}")
    elif len(matches) == 1:
        content = "".join(
            line[2:] if line.startswith("# ") else line[1:]
            for line in matches[0].group("content").splitlines(keepends=True)
        )
        try:
            metadata = tomllib.loads(content)
        except Exception as exc:
            raise PEP723Exception(f"Failed to parse TOML in {scriptfile!r}") from exc
    else:
        raise PEP723Exception(
            f"File does not contain {name!r} metadata: {scriptfile!r}"
        )

    return metadata


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2026 8.59 AM
root / root
0755
__pycache__
--
3 Mar 2026 8.59 AM
root / root
0755
__init__.py
2.97 KB
13 Feb 2026 12.40 PM
root / root
0644
constructors.py
18.25 KB
13 Feb 2026 12.40 PM
root / root
0644
pep723.py
1.196 KB
13 Feb 2026 12.40 PM
root / root
0644
req_dependency_group.py
2.557 KB
13 Feb 2026 12.40 PM
root / root
0644
req_file.py
20.2 KB
13 Feb 2026 12.40 PM
root / root
0644
req_install.py
30.54 KB
13 Feb 2026 12.40 PM
root / root
0644
req_set.py
2.762 KB
13 Feb 2026 12.40 PM
root / root
0644
req_uninstall.py
23.534 KB
13 Feb 2026 12.40 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF