OXIESEC PANEL
- Current Dir:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
setuptools
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:06 AM
rwxr-xr-x
📄
__init__.py
10.2 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
__pycache__
-
02/07/2025 10:01:50 PM
rwxr-xr-x
📄
_core_metadata.py
9.57 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
_distutils
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
_entry_points.py
2.26 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
_imp.py
2.38 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
_importlib.py
223 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
_itertools.py
657 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
_normalization.py
4.43 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
_path.py
2.62 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
_reqs.py
1.4 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
_shutil.py
1.46 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
_vendor
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
archive_util.py
7.2 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
build_meta.py
19.97 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
cli-32.exe
11.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
cli-64.exe
14 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
cli-arm64.exe
13.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
cli.exe
11.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
command
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📁
compat
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📁
config
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
dep_util.py
659 bytes
12/20/2023 03:43:55 PM
rw-r--r--
📄
depends.py
5.83 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
discovery.py
20.76 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
dist.py
37.79 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
errors.py
2.95 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
extension.py
6.53 KB
12/18/2024 10:23:15 AM
rw-r--r--
📁
extern
-
02/16/2024 08:50:18 PM
rwxr-xr-x
📄
glob.py
5.92 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
gui-32.exe
11.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
gui-64.exe
14 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
gui-arm64.exe
13.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
gui.exe
11.5 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
installer.py
4.99 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
launch.py
820 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
logging.py
1.23 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
modified.py
568 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
monkey.py
3.63 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
msvc.py
40.37 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
namespaces.py
3.1 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
package_index.py
38.45 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
py312compat.py
330 bytes
12/20/2023 03:43:55 PM
rw-r--r--
📄
sandbox.py
14.56 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
script (dev).tmpl
218 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
script.tmpl
138 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📁
tests
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
unicode_utils.py
3.12 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
version.py
161 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
warnings.py
3.71 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
wheel.py
8.43 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
windows_support.py
726 bytes
12/18/2024 10:23:15 AM
rw-r--r--
Editing: _normalization.py
Close
""" Helpers for normalization as expected in wheel/sdist/module file names and core metadata """ import re import packaging # https://packaging.python.org/en/latest/specifications/core-metadata/#name _VALID_NAME = re.compile(r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.I) _UNSAFE_NAME_CHARS = re.compile(r"[^A-Z0-9._-]+", re.I) _NON_ALPHANUMERIC = re.compile(r"[^A-Z0-9]+", re.I) _PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I) def safe_identifier(name: str) -> str: """Make a string safe to be used as Python identifier. >>> safe_identifier("12abc") '_12abc' >>> safe_identifier("__editable__.myns.pkg-78.9.3_local") '__editable___myns_pkg_78_9_3_local' """ safe = re.sub(r'\W|^(?=\d)', '_', name) assert safe.isidentifier() return safe def safe_name(component: str) -> str: """Escape a component used as a project name according to Core Metadata. >>> safe_name("hello world") 'hello-world' >>> safe_name("hello?world") 'hello-world' >>> safe_name("hello_world") 'hello_world' """ # See pkg_resources.safe_name return _UNSAFE_NAME_CHARS.sub("-", component) def safe_version(version: str) -> str: """Convert an arbitrary string into a valid version string. Can still raise an ``InvalidVersion`` exception. To avoid exceptions use ``best_effort_version``. >>> safe_version("1988 12 25") '1988.12.25' >>> safe_version("v0.2.1") '0.2.1' >>> safe_version("v0.2?beta") '0.2b0' >>> safe_version("v0.2 beta") '0.2b0' >>> safe_version("ubuntu lts") Traceback (most recent call last): ... packaging.version.InvalidVersion: Invalid version: 'ubuntu.lts' """ v = version.replace(' ', '.') try: return str(packaging.version.Version(v)) except packaging.version.InvalidVersion: attempt = _UNSAFE_NAME_CHARS.sub("-", v) return str(packaging.version.Version(attempt)) def best_effort_version(version: str) -> str: """Convert an arbitrary string into a version-like string. Fallback when ``safe_version`` is not safe enough. >>> best_effort_version("v0.2 beta") '0.2b0' >>> best_effort_version("ubuntu lts") '0.dev0+sanitized.ubuntu.lts' >>> best_effort_version("0.23ubuntu1") '0.23.dev0+sanitized.ubuntu1' >>> best_effort_version("0.23-") '0.23.dev0+sanitized' >>> best_effort_version("0.-_") '0.dev0+sanitized' >>> best_effort_version("42.+?1") '42.dev0+sanitized.1' """ # See pkg_resources._forgiving_version try: return safe_version(version) except packaging.version.InvalidVersion: v = version.replace(' ', '.') match = _PEP440_FALLBACK.search(v) if match: safe = match["safe"] rest = v[len(safe) :] else: safe = "0" rest = version safe_rest = _NON_ALPHANUMERIC.sub(".", rest).strip(".") local = f"sanitized.{safe_rest}".strip(".") return safe_version(f"{safe}.dev0+{local}") def safe_extra(extra: str) -> str: """Normalize extra name according to PEP 685 >>> safe_extra("_FrIeNdLy-._.-bArD") 'friendly-bard' >>> safe_extra("FrIeNdLy-._.-bArD__._-") 'friendly-bard' """ return _NON_ALPHANUMERIC.sub("-", extra).strip("-").lower() def filename_component(value: str) -> str: """Normalize each component of a filename (e.g. distribution/version part of wheel) Note: ``value`` needs to be already normalized. >>> filename_component("my-pkg") 'my_pkg' """ return value.replace("-", "_").strip("_") def filename_component_broken(value: str) -> str: """ Produce the incorrect filename component for compatibility. See pypa/setuptools#4167 for detailed analysis. TODO: replace this with filename_component after pip 24 is nearly-ubiquitous. >>> filename_component_broken('foo_bar-baz') 'foo-bar-baz' """ return value.replace('_', '-') def safer_name(value: str) -> str: """Like ``safe_name`` but can be used as filename component for wheel""" # See bdist_wheel.safer_name return filename_component(safe_name(value)) def safer_best_effort_version(value: str) -> str: """Like ``best_effort_version`` but can be used as filename component for wheel""" # See bdist_wheel.safer_verion # TODO: Replace with only safe_version in the future (no need for best effort) return filename_component(best_effort_version(value))