Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/about.json +252 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/files +439 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/git +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/hash_input.json +4 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/index.json +16 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/link.json +6 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/paths.json +0 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/repodata_record.json +24 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/_distutils_hack/__init__.py +239 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/_distutils_hack/override.py +1 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/PKG-INFO +140 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/SOURCES.txt +509 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/dependency_links.txt +1 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/entry_points.txt +51 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/requires.txt +82 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/top_level.txt +2 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/__init__.py +256 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_core_metadata.py +337 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_discovery.py +33 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/__init__.py +14 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_log.py +3 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_macos_compat.py +12 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_modified.py +95 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_msvccompiler.py +16 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/archive_util.py +284 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/ccompiler.py +26 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/cmd.py +535 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/core.py +289 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/cygwinccompiler.py +31 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/debug.py +5 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dep_util.py +14 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dir_util.py +232 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dist.py +1384 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/errors.py +108 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/extension.py +258 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/fancy_getopt.py +471 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/file_util.py +228 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/filelist.py +431 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/log.py +56 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/spawn.py +130 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/sysconfig.py +598 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/text_file.py +286 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/unixccompiler.py +9 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/util.py +506 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/version.py +348 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/versionpredicate.py +175 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/zosccompiler.py +3 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_entry_points.py +94 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_imp.py +87 -0
- micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_importlib.py +9 -0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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"channels": [
|
| 3 |
+
"https://conda.anaconda.org/conda-forge"
|
| 4 |
+
],
|
| 5 |
+
"conda_build_version": "26.1.0",
|
| 6 |
+
"conda_version": "26.1.1",
|
| 7 |
+
"description": "Setuptools is a fully-featured, actively-maintained, and stable library\ndesigned to facilitate packaging Python projects.\n",
|
| 8 |
+
"dev_url": "https://github.com/pypa/setuptools",
|
| 9 |
+
"doc_source_url": "https://github.com/pypa/setuptools/tree/master/docs",
|
| 10 |
+
"doc_url": "http://pythonhosted.org/setuptools/",
|
| 11 |
+
"env_vars": {
|
| 12 |
+
"CIO_TEST": "<not set>"
|
| 13 |
+
},
|
| 14 |
+
"extra": {
|
| 15 |
+
"copy_test_source_files": true,
|
| 16 |
+
"final": true,
|
| 17 |
+
"flow_run_id": "azure_20260309.2.1",
|
| 18 |
+
"recipe-maintainers": [
|
| 19 |
+
"xhochy",
|
| 20 |
+
"rgommers",
|
| 21 |
+
"jakirkham",
|
| 22 |
+
"msarahan",
|
| 23 |
+
"ocefpaf",
|
| 24 |
+
"nicoddemus",
|
| 25 |
+
"isuruf"
|
| 26 |
+
],
|
| 27 |
+
"remote_url": "https://github.com/conda-forge/setuptools-feedstock",
|
| 28 |
+
"sha": "f5d57673366c72887df498499e979b688f5eb6aa"
|
| 29 |
+
},
|
| 30 |
+
"home": "https://github.com/pypa/setuptools",
|
| 31 |
+
"identifiers": [],
|
| 32 |
+
"keywords": [],
|
| 33 |
+
"license": "MIT",
|
| 34 |
+
"license_family": "MIT",
|
| 35 |
+
"license_file": "LICENSE",
|
| 36 |
+
"root_pkgs": [
|
| 37 |
+
"hpack 4.1.0 pyhd8ed1ab_0",
|
| 38 |
+
"ripgrep 15.1.0 hdab8a38_0",
|
| 39 |
+
"readchar 4.2.1 pyhe01879c_0",
|
| 40 |
+
"attrs 25.4.0 pyhcf101f3_1",
|
| 41 |
+
"libfreetype6 2.14.2 h73754d4_0",
|
| 42 |
+
"charset-normalizer 3.4.5 pyhd8ed1ab_0",
|
| 43 |
+
"dbus 1.16.2 h24cb091_1",
|
| 44 |
+
"pyyaml 6.0.3 py312h8a5da7c_1",
|
| 45 |
+
"jinja2 3.1.6 pyhcf101f3_1",
|
| 46 |
+
"c-ares 1.34.6 hb03c661_0",
|
| 47 |
+
"conda-package-streaming 0.12.0 pyhd8ed1ab_0",
|
| 48 |
+
"h2 4.3.0 pyhcf101f3_0",
|
| 49 |
+
"liblzma 5.8.2 hb03c661_0",
|
| 50 |
+
"traitlets 5.14.3 pyhd8ed1ab_1",
|
| 51 |
+
"pkginfo 1.12.1.2 pyhd8ed1ab_0",
|
| 52 |
+
"evalidate 2.0.5 pyhe01879c_0",
|
| 53 |
+
"patchelf 0.17.2 h58526e2_0",
|
| 54 |
+
"typing_extensions 4.15.0 pyhcf101f3_0",
|
| 55 |
+
"patch 2.8 hb03c661_1002",
|
| 56 |
+
"libgcc-ng 15.2.0 h69a702a_18",
|
| 57 |
+
"libmamba-spdlog 2.5.0 h12fcf84_0",
|
| 58 |
+
"anyio 4.12.1 pyhcf101f3_0",
|
| 59 |
+
"ncurses 6.5 h2d0b736_3",
|
| 60 |
+
"libxml2-16 2.15.2 hca6bf5a_0",
|
| 61 |
+
"msgpack-python 1.1.2 py312hd9148b4_1",
|
| 62 |
+
"sniffio 1.3.1 pyhd8ed1ab_2",
|
| 63 |
+
"anaconda-auth 0.13.0 pyhd8ed1ab_0",
|
| 64 |
+
"libnsl 2.0.1 hb9d3cd8_1",
|
| 65 |
+
"libpng 1.6.55 h421ea60_0",
|
| 66 |
+
"git 2.53.0 pl5321h6d3cee1_0",
|
| 67 |
+
"colorama 0.4.6 pyhd8ed1ab_1",
|
| 68 |
+
"lz4-c 1.10.0 h5888daf_1",
|
| 69 |
+
"libxml2 2.15.2 he237659_0",
|
| 70 |
+
"libmamba 2.5.0 hd28c85e_0",
|
| 71 |
+
"beautifulsoup4 4.14.3 pyha770c72_0",
|
| 72 |
+
"idna 3.11 pyhd8ed1ab_0",
|
| 73 |
+
"tomli 2.4.0 pyhcf101f3_0",
|
| 74 |
+
"archspec 0.2.5 pyhd8ed1ab_0",
|
| 75 |
+
"urllib3 2.6.3 pyhd8ed1ab_0",
|
| 76 |
+
"conda 26.1.1 py312h7900ff3_0",
|
| 77 |
+
"annotated-doc 0.0.4 pyhcf101f3_0",
|
| 78 |
+
"libglib 2.86.4 h6548e54_1",
|
| 79 |
+
"icu 78.2 h33c6efd_0",
|
| 80 |
+
"conda-libmamba-solver 25.11.0 pyhd8ed1ab_1",
|
| 81 |
+
"libzlib 1.3.1 hb9d3cd8_2",
|
| 82 |
+
"jsonpatch 1.33 pyhd8ed1ab_1",
|
| 83 |
+
"pip 26.0.1 pyh8b19718_0",
|
| 84 |
+
"libxcb 1.17.0 h8a09558_0",
|
| 85 |
+
"pillow 12.1.1 py312h50c33e8_0",
|
| 86 |
+
"_libgcc_mutex 0.1 conda_forge",
|
| 87 |
+
"tzdata 2025c hc9c84f9_1",
|
| 88 |
+
"conda-index 0.7.0 pyhd8ed1ab_0",
|
| 89 |
+
"rpds-py 0.30.0 py312h868fb18_0",
|
| 90 |
+
"python 3.12.13 hd63d673_0_cpython",
|
| 91 |
+
"importlib_resources 6.5.2 pyhd8ed1ab_0",
|
| 92 |
+
"yaml-cpp 0.8.0 h59595ed_0",
|
| 93 |
+
"hyperframe 6.1.0 pyhd8ed1ab_0",
|
| 94 |
+
"certifi 2026.2.25 pyhd8ed1ab_0",
|
| 95 |
+
"httpx 0.28.1 pyhd8ed1ab_0",
|
| 96 |
+
"zipp 3.23.0 pyhcf101f3_1",
|
| 97 |
+
"lcms2 2.18 h0c24ade_0",
|
| 98 |
+
"importlib-metadata 8.7.0 pyhe01879c_1",
|
| 99 |
+
"boltons 25.0.0 pyhd8ed1ab_0",
|
| 100 |
+
"filelock 3.25.0 pyhd8ed1ab_0",
|
| 101 |
+
"bzip2 1.0.8 hda65f42_9",
|
| 102 |
+
"platformdirs 4.9.2 pyhcf101f3_0",
|
| 103 |
+
"pydantic-core 2.41.5 py312h868fb18_1",
|
| 104 |
+
"click 8.3.1 pyh8f84b5b_1",
|
| 105 |
+
"typer 0.24.0 pyhcf101f3_0",
|
| 106 |
+
"libexpat 2.7.4 hecca717_0",
|
| 107 |
+
"ca-certificates 2026.2.25 hbd8a1cb_0",
|
| 108 |
+
"xorg-libxdmcp 1.1.5 hb03c661_1",
|
| 109 |
+
"shellingham 1.5.4 pyhd8ed1ab_2",
|
| 110 |
+
"semver 3.0.4 pyhcf101f3_1",
|
| 111 |
+
"pluggy 1.6.0 pyhf9edf01_1",
|
| 112 |
+
"annotated-types 0.7.0 pyhd8ed1ab_1",
|
| 113 |
+
"ruamel.yaml 0.18.17 py312h5253ce2_2",
|
| 114 |
+
"psutil 7.2.2 py312h5253ce2_0",
|
| 115 |
+
"wheel 0.46.3 pyhd8ed1ab_0",
|
| 116 |
+
"liblzma-devel 5.8.2 hb03c661_0",
|
| 117 |
+
"libsqlite 3.52.0 hf4e2dac_0",
|
| 118 |
+
"httpcore 1.0.9 pyh29332c3_0",
|
| 119 |
+
"pkce 1.0.3 pyhd8ed1ab_1",
|
| 120 |
+
"tqdm 4.67.3 pyh8f84b5b_0",
|
| 121 |
+
"cffi 2.0.0 py312h460c074_1",
|
| 122 |
+
"jaraco.functools 4.4.0 pyhcf101f3_1",
|
| 123 |
+
"referencing 0.37.0 pyhcf101f3_0",
|
| 124 |
+
"libtiff 4.7.1 h9d88235_1",
|
| 125 |
+
"simdjson 4.2.4 hb700be7_0",
|
| 126 |
+
"rich 14.3.3 pyhcf101f3_0",
|
| 127 |
+
"libdeflate 1.25 h17f619e_0",
|
| 128 |
+
"jupyter_core 5.9.1 pyhc90fa1f_0",
|
| 129 |
+
"readline 8.3 h853b02a_0",
|
| 130 |
+
"pyjwt 2.11.0 pyhd8ed1ab_0",
|
| 131 |
+
"openjpeg 2.5.4 h55fea9a_0",
|
| 132 |
+
"libedit 3.1.20250104 pl5321h7949ede_0",
|
| 133 |
+
"py-lief 0.17.1 py312h1289d80_0",
|
| 134 |
+
"h11 0.16.0 pyhcf101f3_1",
|
| 135 |
+
"exceptiongroup 1.3.1 pyhd8ed1ab_0",
|
| 136 |
+
"_openmp_mutex 4.5 20_gnu",
|
| 137 |
+
"cpp-expected 1.3.1 h171cf75_0",
|
| 138 |
+
"tini 0.19.0 h166bdaf_1",
|
| 139 |
+
"jsonschema-specifications 2025.9.1 pyhcf101f3_0",
|
| 140 |
+
"libfreetype 2.14.2 ha770c72_0",
|
| 141 |
+
"lerc 4.0.0 h0aef613_1",
|
| 142 |
+
"more-itertools 10.8.0 pyhcf101f3_1",
|
| 143 |
+
"spdlog 1.17.0 hab81395_1",
|
| 144 |
+
"libssh2 1.11.1 hcf80075_0",
|
| 145 |
+
"pycparser 2.22 pyh29332c3_1",
|
| 146 |
+
"ruamel.yaml.clib 0.2.15 py312h5253ce2_1",
|
| 147 |
+
"python-dateutil 2.9.0.post0 pyhe01879c_2",
|
| 148 |
+
"requests-toolbelt 1.0.0 pyhd8ed1ab_1",
|
| 149 |
+
"markupsafe 3.0.3 py312h8a5da7c_1",
|
| 150 |
+
"libwebp-base 1.6.0 hd42ef1d_0",
|
| 151 |
+
"markdown-it-py 4.0.0 pyhd8ed1ab_0",
|
| 152 |
+
"libxcrypt 4.4.36 hd590300_1",
|
| 153 |
+
"libuuid 2.41.3 h5347b49_0",
|
| 154 |
+
"libcurl 8.18.0 hcf29cc6_1",
|
| 155 |
+
"cryptography 46.0.5 py312ha4b625e_0",
|
| 156 |
+
"yaml 0.2.5 h280c20c_3",
|
| 157 |
+
"libffi 3.5.2 h3435931_0",
|
| 158 |
+
"ld_impl_linux-64 2.45.1 default_hbd61a6d_101",
|
| 159 |
+
"zstandard 0.25.0 py312h5253ce2_1",
|
| 160 |
+
"liblief 0.17.1 hecca717_0",
|
| 161 |
+
"setuptools 82.0.0 pyh332efcf_0",
|
| 162 |
+
"xorg-libxau 1.0.12 hb03c661_1",
|
| 163 |
+
"jsonpointer 3.0.0 pyhcf101f3_3",
|
| 164 |
+
"jsonschema 4.26.0 pyhcf101f3_0",
|
| 165 |
+
"libnghttp2 1.67.0 had1ee68_0",
|
| 166 |
+
"lzo 2.10 h280c20c_1002",
|
| 167 |
+
"nlohmann_json-abi 3.12.0 h0f90c79_1",
|
| 168 |
+
"libsolv 0.7.35 h9463b59_0",
|
| 169 |
+
"libstdcxx-ng 15.2.0 hdf11a46_18",
|
| 170 |
+
"python-fastjsonschema 2.21.2 pyhe01879c_0",
|
| 171 |
+
"pygments 2.19.2 pyhd8ed1ab_0",
|
| 172 |
+
"backports.tarfile 1.2.0 pyhcf101f3_2",
|
| 173 |
+
"frozendict 2.4.7 py312h4c3975b_0",
|
| 174 |
+
"chardet 5.2.0 pyhd8ed1ab_3",
|
| 175 |
+
"distro 1.9.0 pyhd8ed1ab_1",
|
| 176 |
+
"soupsieve 2.8.3 pyhd8ed1ab_0",
|
| 177 |
+
"six 1.17.0 pyhe01879c_1",
|
| 178 |
+
"anaconda-client 1.14.1 pyhcf101f3_0",
|
| 179 |
+
"jaraco.classes 3.4.0 pyhcf101f3_3",
|
| 180 |
+
"pydantic-settings 2.13.1 pyhd8ed1ab_0",
|
| 181 |
+
"krb5 1.22.2 ha1258a1_0",
|
| 182 |
+
"reproc 14.2.5.post0 hb9d3cd8_0",
|
| 183 |
+
"mamba 2.5.0 h9835478_0",
|
| 184 |
+
"keyring 25.7.0 pyha804496_0",
|
| 185 |
+
"secretstorage 3.4.1 py312h7900ff3_0",
|
| 186 |
+
"defusedxml 0.7.1 pyhd8ed1ab_0",
|
| 187 |
+
"typing-inspection 0.4.2 pyhd8ed1ab_1",
|
| 188 |
+
"libiconv 1.18 h3b78370_2",
|
| 189 |
+
"keyutils 1.6.3 hb9d3cd8_0",
|
| 190 |
+
"pycosat 0.6.6 py312h4c3975b_3",
|
| 191 |
+
"tomlkit 0.14.0 pyha770c72_0",
|
| 192 |
+
"brotli-python 1.2.0 py312hdb49522_1",
|
| 193 |
+
"fmt 12.1.0 hff5e90c_0",
|
| 194 |
+
"nbformat 5.10.4 pyhd8ed1ab_1",
|
| 195 |
+
"libev 4.33 hd590300_2",
|
| 196 |
+
"python-libarchive-c 5.3 pyhe01879c_1",
|
| 197 |
+
"pytz 2025.2 pyhd8ed1ab_0",
|
| 198 |
+
"xz 5.8.2 ha02ee65_0",
|
| 199 |
+
"libstdcxx 15.2.0 h934c35e_18",
|
| 200 |
+
"libgcc 15.2.0 he0feb66_18",
|
| 201 |
+
"truststore 0.10.4 pyhcf101f3_0",
|
| 202 |
+
"libarchive 3.8.5 gpl_hc2c16d8_100",
|
| 203 |
+
"conda-build 26.1.0 pyh31ec981_2",
|
| 204 |
+
"packaging 26.0 pyhcf101f3_0",
|
| 205 |
+
"typing-extensions 4.15.0 h396c80c_0",
|
| 206 |
+
"menuinst 2.4.2 py312h7900ff3_0",
|
| 207 |
+
"xz-tools 5.8.2 hb03c661_0",
|
| 208 |
+
"python_abi 3.12 8_cp312",
|
| 209 |
+
"pixi 0.65.0 ha759004_0",
|
| 210 |
+
"anaconda-cli-base 0.8.1 pyhc364b38_1",
|
| 211 |
+
"perl 5.32.1 7_hd590300_perl5",
|
| 212 |
+
"reproc-cpp 14.2.5.post0 h5888daf_0",
|
| 213 |
+
"pcre2 10.47 haa7fec5_0",
|
| 214 |
+
"backports.zstd 1.3.0 py312h90b7ffd_0",
|
| 215 |
+
"jaraco.context 6.1.0 pyhcf101f3_0",
|
| 216 |
+
"pthread-stubs 0.4 hb9d3cd8_1002",
|
| 217 |
+
"mbedtls 3.6.3.1 h5888daf_0",
|
| 218 |
+
"conda-package-handling 2.4.0 pyh7900ff3_2",
|
| 219 |
+
"zlib-ng 2.3.3 hceb46e0_1",
|
| 220 |
+
"mdurl 0.1.2 pyhd8ed1ab_1",
|
| 221 |
+
"openssl 3.6.1 h35e630c_1",
|
| 222 |
+
"pysocks 1.7.1 pyha55dd90_7",
|
| 223 |
+
"backports 1.0 pyhd8ed1ab_5",
|
| 224 |
+
"pybind11-abi 11 hc364b38_1",
|
| 225 |
+
"zstd 1.5.7 hb78ec9c_6",
|
| 226 |
+
"pydantic 2.12.5 pyhcf101f3_1",
|
| 227 |
+
"su-exec 0.2 h166bdaf_1003",
|
| 228 |
+
"jeepney 0.9.0 pyhd8ed1ab_0",
|
| 229 |
+
"requests 2.32.5 pyhcf101f3_1",
|
| 230 |
+
"libjpeg-turbo 3.1.2 hb03c661_0",
|
| 231 |
+
"tk 8.6.13 noxft_h366c992_103",
|
| 232 |
+
"python-dotenv 1.2.2 pyhcf101f3_0",
|
| 233 |
+
"libmambapy 2.5.0 py312h1ca65c7_0",
|
| 234 |
+
"xz-gpl-tools 5.8.2 ha02ee65_0",
|
| 235 |
+
"libgomp 15.2.0 he0feb66_18",
|
| 236 |
+
"deprecated 1.3.1 pyhd8ed1ab_1",
|
| 237 |
+
"wrapt 2.1.2 py312h4c3975b_0",
|
| 238 |
+
"conda-env 2.6.0 1",
|
| 239 |
+
"conda-oci-mirror 0.2.3 pyhd8ed1ab_0",
|
| 240 |
+
"rattler-build 0.58.4 ha759004_0",
|
| 241 |
+
"conda-forge-metadata 0.13.0 pyhcf101f3_0",
|
| 242 |
+
"rattler-build-conda-compat 1.4.11 pyhd8ed1ab_0",
|
| 243 |
+
"shyaml 0.6.2 pyhd3deb0d_0",
|
| 244 |
+
"joblib 1.5.3 pyhd8ed1ab_0",
|
| 245 |
+
"jq 1.8.1 h73b1eb8_0",
|
| 246 |
+
"oniguruma 6.9.10 hb9d3cd8_0",
|
| 247 |
+
"oras-py 0.1.14 pyhd8ed1ab_0",
|
| 248 |
+
"conda-forge-ci-setup 4.24.2 py312hef7310e_101"
|
| 249 |
+
],
|
| 250 |
+
"summary": "Download, build, install, upgrade, and uninstall Python packages",
|
| 251 |
+
"tags": []
|
| 252 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/files
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
site-packages/_distutils_hack/__init__.py
|
| 2 |
+
site-packages/_distutils_hack/override.py
|
| 3 |
+
site-packages/distutils-precedence.pth
|
| 4 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/PKG-INFO
|
| 5 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/SOURCES.txt
|
| 6 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/dependency_links.txt
|
| 7 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/entry_points.txt
|
| 8 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/requires.txt
|
| 9 |
+
site-packages/setuptools-82.0.1-py3.10.egg-info/top_level.txt
|
| 10 |
+
site-packages/setuptools/__init__.py
|
| 11 |
+
site-packages/setuptools/_core_metadata.py
|
| 12 |
+
site-packages/setuptools/_discovery.py
|
| 13 |
+
site-packages/setuptools/_distutils/__init__.py
|
| 14 |
+
site-packages/setuptools/_distutils/_log.py
|
| 15 |
+
site-packages/setuptools/_distutils/_macos_compat.py
|
| 16 |
+
site-packages/setuptools/_distutils/_modified.py
|
| 17 |
+
site-packages/setuptools/_distutils/_msvccompiler.py
|
| 18 |
+
site-packages/setuptools/_distutils/archive_util.py
|
| 19 |
+
site-packages/setuptools/_distutils/ccompiler.py
|
| 20 |
+
site-packages/setuptools/_distutils/cmd.py
|
| 21 |
+
site-packages/setuptools/_distutils/command/__init__.py
|
| 22 |
+
site-packages/setuptools/_distutils/command/_framework_compat.py
|
| 23 |
+
site-packages/setuptools/_distutils/command/bdist.py
|
| 24 |
+
site-packages/setuptools/_distutils/command/bdist_dumb.py
|
| 25 |
+
site-packages/setuptools/_distutils/command/bdist_rpm.py
|
| 26 |
+
site-packages/setuptools/_distutils/command/build.py
|
| 27 |
+
site-packages/setuptools/_distutils/command/build_clib.py
|
| 28 |
+
site-packages/setuptools/_distutils/command/build_ext.py
|
| 29 |
+
site-packages/setuptools/_distutils/command/build_py.py
|
| 30 |
+
site-packages/setuptools/_distutils/command/build_scripts.py
|
| 31 |
+
site-packages/setuptools/_distutils/command/check.py
|
| 32 |
+
site-packages/setuptools/_distutils/command/clean.py
|
| 33 |
+
site-packages/setuptools/_distutils/command/config.py
|
| 34 |
+
site-packages/setuptools/_distutils/command/install.py
|
| 35 |
+
site-packages/setuptools/_distutils/command/install_data.py
|
| 36 |
+
site-packages/setuptools/_distutils/command/install_egg_info.py
|
| 37 |
+
site-packages/setuptools/_distutils/command/install_headers.py
|
| 38 |
+
site-packages/setuptools/_distutils/command/install_lib.py
|
| 39 |
+
site-packages/setuptools/_distutils/command/install_scripts.py
|
| 40 |
+
site-packages/setuptools/_distutils/command/sdist.py
|
| 41 |
+
site-packages/setuptools/_distutils/compat/__init__.py
|
| 42 |
+
site-packages/setuptools/_distutils/compat/numpy.py
|
| 43 |
+
site-packages/setuptools/_distutils/compat/py39.py
|
| 44 |
+
site-packages/setuptools/_distutils/compilers/C/base.py
|
| 45 |
+
site-packages/setuptools/_distutils/compilers/C/cygwin.py
|
| 46 |
+
site-packages/setuptools/_distutils/compilers/C/errors.py
|
| 47 |
+
site-packages/setuptools/_distutils/compilers/C/msvc.py
|
| 48 |
+
site-packages/setuptools/_distutils/compilers/C/tests/test_base.py
|
| 49 |
+
site-packages/setuptools/_distutils/compilers/C/tests/test_cygwin.py
|
| 50 |
+
site-packages/setuptools/_distutils/compilers/C/tests/test_mingw.py
|
| 51 |
+
site-packages/setuptools/_distutils/compilers/C/tests/test_msvc.py
|
| 52 |
+
site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py
|
| 53 |
+
site-packages/setuptools/_distutils/compilers/C/unix.py
|
| 54 |
+
site-packages/setuptools/_distutils/compilers/C/zos.py
|
| 55 |
+
site-packages/setuptools/_distutils/core.py
|
| 56 |
+
site-packages/setuptools/_distutils/cygwinccompiler.py
|
| 57 |
+
site-packages/setuptools/_distutils/debug.py
|
| 58 |
+
site-packages/setuptools/_distutils/dep_util.py
|
| 59 |
+
site-packages/setuptools/_distutils/dir_util.py
|
| 60 |
+
site-packages/setuptools/_distutils/dist.py
|
| 61 |
+
site-packages/setuptools/_distutils/errors.py
|
| 62 |
+
site-packages/setuptools/_distutils/extension.py
|
| 63 |
+
site-packages/setuptools/_distutils/fancy_getopt.py
|
| 64 |
+
site-packages/setuptools/_distutils/file_util.py
|
| 65 |
+
site-packages/setuptools/_distutils/filelist.py
|
| 66 |
+
site-packages/setuptools/_distutils/log.py
|
| 67 |
+
site-packages/setuptools/_distutils/spawn.py
|
| 68 |
+
site-packages/setuptools/_distutils/sysconfig.py
|
| 69 |
+
site-packages/setuptools/_distutils/tests/__init__.py
|
| 70 |
+
site-packages/setuptools/_distutils/tests/compat/__init__.py
|
| 71 |
+
site-packages/setuptools/_distutils/tests/compat/py39.py
|
| 72 |
+
site-packages/setuptools/_distutils/tests/support.py
|
| 73 |
+
site-packages/setuptools/_distutils/tests/test_archive_util.py
|
| 74 |
+
site-packages/setuptools/_distutils/tests/test_bdist.py
|
| 75 |
+
site-packages/setuptools/_distutils/tests/test_bdist_dumb.py
|
| 76 |
+
site-packages/setuptools/_distutils/tests/test_bdist_rpm.py
|
| 77 |
+
site-packages/setuptools/_distutils/tests/test_build.py
|
| 78 |
+
site-packages/setuptools/_distutils/tests/test_build_clib.py
|
| 79 |
+
site-packages/setuptools/_distutils/tests/test_build_ext.py
|
| 80 |
+
site-packages/setuptools/_distutils/tests/test_build_py.py
|
| 81 |
+
site-packages/setuptools/_distutils/tests/test_build_scripts.py
|
| 82 |
+
site-packages/setuptools/_distutils/tests/test_check.py
|
| 83 |
+
site-packages/setuptools/_distutils/tests/test_clean.py
|
| 84 |
+
site-packages/setuptools/_distutils/tests/test_cmd.py
|
| 85 |
+
site-packages/setuptools/_distutils/tests/test_config_cmd.py
|
| 86 |
+
site-packages/setuptools/_distutils/tests/test_core.py
|
| 87 |
+
site-packages/setuptools/_distutils/tests/test_dir_util.py
|
| 88 |
+
site-packages/setuptools/_distutils/tests/test_dist.py
|
| 89 |
+
site-packages/setuptools/_distutils/tests/test_extension.py
|
| 90 |
+
site-packages/setuptools/_distutils/tests/test_file_util.py
|
| 91 |
+
site-packages/setuptools/_distutils/tests/test_filelist.py
|
| 92 |
+
site-packages/setuptools/_distutils/tests/test_install.py
|
| 93 |
+
site-packages/setuptools/_distutils/tests/test_install_data.py
|
| 94 |
+
site-packages/setuptools/_distutils/tests/test_install_headers.py
|
| 95 |
+
site-packages/setuptools/_distutils/tests/test_install_lib.py
|
| 96 |
+
site-packages/setuptools/_distutils/tests/test_install_scripts.py
|
| 97 |
+
site-packages/setuptools/_distutils/tests/test_log.py
|
| 98 |
+
site-packages/setuptools/_distutils/tests/test_modified.py
|
| 99 |
+
site-packages/setuptools/_distutils/tests/test_sdist.py
|
| 100 |
+
site-packages/setuptools/_distutils/tests/test_spawn.py
|
| 101 |
+
site-packages/setuptools/_distutils/tests/test_sysconfig.py
|
| 102 |
+
site-packages/setuptools/_distutils/tests/test_text_file.py
|
| 103 |
+
site-packages/setuptools/_distutils/tests/test_util.py
|
| 104 |
+
site-packages/setuptools/_distutils/tests/test_version.py
|
| 105 |
+
site-packages/setuptools/_distutils/tests/test_versionpredicate.py
|
| 106 |
+
site-packages/setuptools/_distutils/tests/unix_compat.py
|
| 107 |
+
site-packages/setuptools/_distutils/text_file.py
|
| 108 |
+
site-packages/setuptools/_distutils/unixccompiler.py
|
| 109 |
+
site-packages/setuptools/_distutils/util.py
|
| 110 |
+
site-packages/setuptools/_distutils/version.py
|
| 111 |
+
site-packages/setuptools/_distutils/versionpredicate.py
|
| 112 |
+
site-packages/setuptools/_distutils/zosccompiler.py
|
| 113 |
+
site-packages/setuptools/_entry_points.py
|
| 114 |
+
site-packages/setuptools/_imp.py
|
| 115 |
+
site-packages/setuptools/_importlib.py
|
| 116 |
+
site-packages/setuptools/_itertools.py
|
| 117 |
+
site-packages/setuptools/_normalization.py
|
| 118 |
+
site-packages/setuptools/_path.py
|
| 119 |
+
site-packages/setuptools/_reqs.py
|
| 120 |
+
site-packages/setuptools/_scripts.py
|
| 121 |
+
site-packages/setuptools/_shutil.py
|
| 122 |
+
site-packages/setuptools/_static.py
|
| 123 |
+
site-packages/setuptools/_vendor/.lock
|
| 124 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/INSTALLER
|
| 125 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE
|
| 126 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA
|
| 127 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/RECORD
|
| 128 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/REQUESTED
|
| 129 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/WHEEL
|
| 130 |
+
site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/top_level.txt
|
| 131 |
+
site-packages/setuptools/_vendor/autocommand/__init__.py
|
| 132 |
+
site-packages/setuptools/_vendor/autocommand/autoasync.py
|
| 133 |
+
site-packages/setuptools/_vendor/autocommand/autocommand.py
|
| 134 |
+
site-packages/setuptools/_vendor/autocommand/automain.py
|
| 135 |
+
site-packages/setuptools/_vendor/autocommand/autoparse.py
|
| 136 |
+
site-packages/setuptools/_vendor/autocommand/errors.py
|
| 137 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/INSTALLER
|
| 138 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/LICENSE
|
| 139 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA
|
| 140 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/RECORD
|
| 141 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/REQUESTED
|
| 142 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/WHEEL
|
| 143 |
+
site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/top_level.txt
|
| 144 |
+
site-packages/setuptools/_vendor/backports/__init__.py
|
| 145 |
+
site-packages/setuptools/_vendor/backports/tarfile/__init__.py
|
| 146 |
+
site-packages/setuptools/_vendor/backports/tarfile/__main__.py
|
| 147 |
+
site-packages/setuptools/_vendor/backports/tarfile/compat/__init__.py
|
| 148 |
+
site-packages/setuptools/_vendor/backports/tarfile/compat/py38.py
|
| 149 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/INSTALLER
|
| 150 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/METADATA
|
| 151 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/RECORD
|
| 152 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/REQUESTED
|
| 153 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/WHEEL
|
| 154 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/licenses/LICENSE
|
| 155 |
+
site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/top_level.txt
|
| 156 |
+
site-packages/setuptools/_vendor/importlib_metadata/__init__.py
|
| 157 |
+
site-packages/setuptools/_vendor/importlib_metadata/_adapters.py
|
| 158 |
+
site-packages/setuptools/_vendor/importlib_metadata/_collections.py
|
| 159 |
+
site-packages/setuptools/_vendor/importlib_metadata/_compat.py
|
| 160 |
+
site-packages/setuptools/_vendor/importlib_metadata/_functools.py
|
| 161 |
+
site-packages/setuptools/_vendor/importlib_metadata/_itertools.py
|
| 162 |
+
site-packages/setuptools/_vendor/importlib_metadata/_meta.py
|
| 163 |
+
site-packages/setuptools/_vendor/importlib_metadata/_text.py
|
| 164 |
+
site-packages/setuptools/_vendor/importlib_metadata/_typing.py
|
| 165 |
+
site-packages/setuptools/_vendor/importlib_metadata/compat/__init__.py
|
| 166 |
+
site-packages/setuptools/_vendor/importlib_metadata/compat/py311.py
|
| 167 |
+
site-packages/setuptools/_vendor/importlib_metadata/compat/py39.py
|
| 168 |
+
site-packages/setuptools/_vendor/importlib_metadata/diagnose.py
|
| 169 |
+
site-packages/setuptools/_vendor/importlib_metadata/py.typed
|
| 170 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/INSTALLER
|
| 171 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/LICENSE
|
| 172 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/METADATA
|
| 173 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/RECORD
|
| 174 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/REQUESTED
|
| 175 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/WHEEL
|
| 176 |
+
site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/top_level.txt
|
| 177 |
+
site-packages/setuptools/_vendor/jaraco/context/__init__.py
|
| 178 |
+
site-packages/setuptools/_vendor/jaraco/context/py.typed
|
| 179 |
+
site-packages/setuptools/_vendor/jaraco/functools/__init__.py
|
| 180 |
+
site-packages/setuptools/_vendor/jaraco/functools/__init__.pyi
|
| 181 |
+
site-packages/setuptools/_vendor/jaraco/functools/py.typed
|
| 182 |
+
site-packages/setuptools/_vendor/jaraco/text/Lorem ipsum.txt
|
| 183 |
+
site-packages/setuptools/_vendor/jaraco/text/__init__.py
|
| 184 |
+
site-packages/setuptools/_vendor/jaraco/text/layouts.py
|
| 185 |
+
site-packages/setuptools/_vendor/jaraco/text/show-newlines.py
|
| 186 |
+
site-packages/setuptools/_vendor/jaraco/text/strip-prefix.py
|
| 187 |
+
site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py
|
| 188 |
+
site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py
|
| 189 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/INSTALLER
|
| 190 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/METADATA
|
| 191 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/RECORD
|
| 192 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/REQUESTED
|
| 193 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/WHEEL
|
| 194 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/licenses/LICENSE
|
| 195 |
+
site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/top_level.txt
|
| 196 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/INSTALLER
|
| 197 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/METADATA
|
| 198 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/RECORD
|
| 199 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/REQUESTED
|
| 200 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/WHEEL
|
| 201 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/licenses/LICENSE
|
| 202 |
+
site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/top_level.txt
|
| 203 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/INSTALLER
|
| 204 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/METADATA
|
| 205 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/RECORD
|
| 206 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/REQUESTED
|
| 207 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/WHEEL
|
| 208 |
+
site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/licenses/LICENSE
|
| 209 |
+
site-packages/setuptools/_vendor/more_itertools/__init__.py
|
| 210 |
+
site-packages/setuptools/_vendor/more_itertools/__init__.pyi
|
| 211 |
+
site-packages/setuptools/_vendor/more_itertools/more.py
|
| 212 |
+
site-packages/setuptools/_vendor/more_itertools/more.pyi
|
| 213 |
+
site-packages/setuptools/_vendor/more_itertools/py.typed
|
| 214 |
+
site-packages/setuptools/_vendor/more_itertools/recipes.py
|
| 215 |
+
site-packages/setuptools/_vendor/more_itertools/recipes.pyi
|
| 216 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/INSTALLER
|
| 217 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/METADATA
|
| 218 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/RECORD
|
| 219 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/REQUESTED
|
| 220 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/WHEEL
|
| 221 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE
|
| 222 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE.APACHE
|
| 223 |
+
site-packages/setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE.BSD
|
| 224 |
+
site-packages/setuptools/_vendor/packaging/__init__.py
|
| 225 |
+
site-packages/setuptools/_vendor/packaging/_elffile.py
|
| 226 |
+
site-packages/setuptools/_vendor/packaging/_manylinux.py
|
| 227 |
+
site-packages/setuptools/_vendor/packaging/_musllinux.py
|
| 228 |
+
site-packages/setuptools/_vendor/packaging/_parser.py
|
| 229 |
+
site-packages/setuptools/_vendor/packaging/_structures.py
|
| 230 |
+
site-packages/setuptools/_vendor/packaging/_tokenizer.py
|
| 231 |
+
site-packages/setuptools/_vendor/packaging/licenses/__init__.py
|
| 232 |
+
site-packages/setuptools/_vendor/packaging/licenses/_spdx.py
|
| 233 |
+
site-packages/setuptools/_vendor/packaging/markers.py
|
| 234 |
+
site-packages/setuptools/_vendor/packaging/metadata.py
|
| 235 |
+
site-packages/setuptools/_vendor/packaging/py.typed
|
| 236 |
+
site-packages/setuptools/_vendor/packaging/pylock.py
|
| 237 |
+
site-packages/setuptools/_vendor/packaging/requirements.py
|
| 238 |
+
site-packages/setuptools/_vendor/packaging/specifiers.py
|
| 239 |
+
site-packages/setuptools/_vendor/packaging/tags.py
|
| 240 |
+
site-packages/setuptools/_vendor/packaging/utils.py
|
| 241 |
+
site-packages/setuptools/_vendor/packaging/version.py
|
| 242 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/INSTALLER
|
| 243 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/METADATA
|
| 244 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/RECORD
|
| 245 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/REQUESTED
|
| 246 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/WHEEL
|
| 247 |
+
site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/licenses/LICENSE
|
| 248 |
+
site-packages/setuptools/_vendor/platformdirs/__init__.py
|
| 249 |
+
site-packages/setuptools/_vendor/platformdirs/__main__.py
|
| 250 |
+
site-packages/setuptools/_vendor/platformdirs/android.py
|
| 251 |
+
site-packages/setuptools/_vendor/platformdirs/api.py
|
| 252 |
+
site-packages/setuptools/_vendor/platformdirs/macos.py
|
| 253 |
+
site-packages/setuptools/_vendor/platformdirs/py.typed
|
| 254 |
+
site-packages/setuptools/_vendor/platformdirs/unix.py
|
| 255 |
+
site-packages/setuptools/_vendor/platformdirs/version.py
|
| 256 |
+
site-packages/setuptools/_vendor/platformdirs/windows.py
|
| 257 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/INSTALLER
|
| 258 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/METADATA
|
| 259 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/RECORD
|
| 260 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/REQUESTED
|
| 261 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/WHEEL
|
| 262 |
+
site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/licenses/LICENSE
|
| 263 |
+
site-packages/setuptools/_vendor/tomli/__init__.py
|
| 264 |
+
site-packages/setuptools/_vendor/tomli/_parser.py
|
| 265 |
+
site-packages/setuptools/_vendor/tomli/_re.py
|
| 266 |
+
site-packages/setuptools/_vendor/tomli/_types.py
|
| 267 |
+
site-packages/setuptools/_vendor/tomli/py.typed
|
| 268 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/INSTALLER
|
| 269 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/METADATA
|
| 270 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/RECORD
|
| 271 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/REQUESTED
|
| 272 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/WHEEL
|
| 273 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/entry_points.txt
|
| 274 |
+
site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/licenses/LICENSE.txt
|
| 275 |
+
site-packages/setuptools/_vendor/wheel/__init__.py
|
| 276 |
+
site-packages/setuptools/_vendor/wheel/__main__.py
|
| 277 |
+
site-packages/setuptools/_vendor/wheel/_bdist_wheel.py
|
| 278 |
+
site-packages/setuptools/_vendor/wheel/_commands/__init__.py
|
| 279 |
+
site-packages/setuptools/_vendor/wheel/_commands/convert.py
|
| 280 |
+
site-packages/setuptools/_vendor/wheel/_commands/pack.py
|
| 281 |
+
site-packages/setuptools/_vendor/wheel/_commands/tags.py
|
| 282 |
+
site-packages/setuptools/_vendor/wheel/_commands/unpack.py
|
| 283 |
+
site-packages/setuptools/_vendor/wheel/_metadata.py
|
| 284 |
+
site-packages/setuptools/_vendor/wheel/_setuptools_logging.py
|
| 285 |
+
site-packages/setuptools/_vendor/wheel/bdist_wheel.py
|
| 286 |
+
site-packages/setuptools/_vendor/wheel/macosx_libfile.py
|
| 287 |
+
site-packages/setuptools/_vendor/wheel/metadata.py
|
| 288 |
+
site-packages/setuptools/_vendor/wheel/wheelfile.py
|
| 289 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/INSTALLER
|
| 290 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/METADATA
|
| 291 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/RECORD
|
| 292 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/REQUESTED
|
| 293 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/WHEEL
|
| 294 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/licenses/LICENSE
|
| 295 |
+
site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/top_level.txt
|
| 296 |
+
site-packages/setuptools/_vendor/zipp/__init__.py
|
| 297 |
+
site-packages/setuptools/_vendor/zipp/_functools.py
|
| 298 |
+
site-packages/setuptools/_vendor/zipp/compat/__init__.py
|
| 299 |
+
site-packages/setuptools/_vendor/zipp/compat/overlay.py
|
| 300 |
+
site-packages/setuptools/_vendor/zipp/compat/py310.py
|
| 301 |
+
site-packages/setuptools/_vendor/zipp/compat/py313.py
|
| 302 |
+
site-packages/setuptools/_vendor/zipp/glob.py
|
| 303 |
+
site-packages/setuptools/archive_util.py
|
| 304 |
+
site-packages/setuptools/build_meta.py
|
| 305 |
+
site-packages/setuptools/cli-32.exe
|
| 306 |
+
site-packages/setuptools/cli-64.exe
|
| 307 |
+
site-packages/setuptools/cli-arm64.exe
|
| 308 |
+
site-packages/setuptools/cli.exe
|
| 309 |
+
site-packages/setuptools/command/__init__.py
|
| 310 |
+
site-packages/setuptools/command/_requirestxt.py
|
| 311 |
+
site-packages/setuptools/command/alias.py
|
| 312 |
+
site-packages/setuptools/command/bdist_egg.py
|
| 313 |
+
site-packages/setuptools/command/bdist_rpm.py
|
| 314 |
+
site-packages/setuptools/command/bdist_wheel.py
|
| 315 |
+
site-packages/setuptools/command/build.py
|
| 316 |
+
site-packages/setuptools/command/build_clib.py
|
| 317 |
+
site-packages/setuptools/command/build_ext.py
|
| 318 |
+
site-packages/setuptools/command/build_py.py
|
| 319 |
+
site-packages/setuptools/command/develop.py
|
| 320 |
+
site-packages/setuptools/command/dist_info.py
|
| 321 |
+
site-packages/setuptools/command/easy_install.py
|
| 322 |
+
site-packages/setuptools/command/editable_wheel.py
|
| 323 |
+
site-packages/setuptools/command/egg_info.py
|
| 324 |
+
site-packages/setuptools/command/install.py
|
| 325 |
+
site-packages/setuptools/command/install_egg_info.py
|
| 326 |
+
site-packages/setuptools/command/install_lib.py
|
| 327 |
+
site-packages/setuptools/command/install_scripts.py
|
| 328 |
+
site-packages/setuptools/command/rotate.py
|
| 329 |
+
site-packages/setuptools/command/saveopts.py
|
| 330 |
+
site-packages/setuptools/command/sdist.py
|
| 331 |
+
site-packages/setuptools/command/setopt.py
|
| 332 |
+
site-packages/setuptools/command/test.py
|
| 333 |
+
site-packages/setuptools/compat/__init__.py
|
| 334 |
+
site-packages/setuptools/compat/py310.py
|
| 335 |
+
site-packages/setuptools/compat/py311.py
|
| 336 |
+
site-packages/setuptools/compat/py312.py
|
| 337 |
+
site-packages/setuptools/compat/py39.py
|
| 338 |
+
site-packages/setuptools/config/NOTICE
|
| 339 |
+
site-packages/setuptools/config/__init__.py
|
| 340 |
+
site-packages/setuptools/config/_apply_pyprojecttoml.py
|
| 341 |
+
site-packages/setuptools/config/_validate_pyproject/NOTICE
|
| 342 |
+
site-packages/setuptools/config/_validate_pyproject/__init__.py
|
| 343 |
+
site-packages/setuptools/config/_validate_pyproject/error_reporting.py
|
| 344 |
+
site-packages/setuptools/config/_validate_pyproject/extra_validations.py
|
| 345 |
+
site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
|
| 346 |
+
site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py
|
| 347 |
+
site-packages/setuptools/config/_validate_pyproject/formats.py
|
| 348 |
+
site-packages/setuptools/config/distutils.schema.json
|
| 349 |
+
site-packages/setuptools/config/expand.py
|
| 350 |
+
site-packages/setuptools/config/pyprojecttoml.py
|
| 351 |
+
site-packages/setuptools/config/setupcfg.py
|
| 352 |
+
site-packages/setuptools/config/setuptools.schema.json
|
| 353 |
+
site-packages/setuptools/depends.py
|
| 354 |
+
site-packages/setuptools/discovery.py
|
| 355 |
+
site-packages/setuptools/dist.py
|
| 356 |
+
site-packages/setuptools/errors.py
|
| 357 |
+
site-packages/setuptools/extension.py
|
| 358 |
+
site-packages/setuptools/glob.py
|
| 359 |
+
site-packages/setuptools/gui-32.exe
|
| 360 |
+
site-packages/setuptools/gui-64.exe
|
| 361 |
+
site-packages/setuptools/gui-arm64.exe
|
| 362 |
+
site-packages/setuptools/gui.exe
|
| 363 |
+
site-packages/setuptools/installer.py
|
| 364 |
+
site-packages/setuptools/launch.py
|
| 365 |
+
site-packages/setuptools/launcher manifest.xml
|
| 366 |
+
site-packages/setuptools/logging.py
|
| 367 |
+
site-packages/setuptools/modified.py
|
| 368 |
+
site-packages/setuptools/monkey.py
|
| 369 |
+
site-packages/setuptools/msvc.py
|
| 370 |
+
site-packages/setuptools/namespaces.py
|
| 371 |
+
site-packages/setuptools/script (dev).tmpl
|
| 372 |
+
site-packages/setuptools/script.tmpl
|
| 373 |
+
site-packages/setuptools/tests/__init__.py
|
| 374 |
+
site-packages/setuptools/tests/compat/__init__.py
|
| 375 |
+
site-packages/setuptools/tests/compat/py39.py
|
| 376 |
+
site-packages/setuptools/tests/config/__init__.py
|
| 377 |
+
site-packages/setuptools/tests/config/downloads/__init__.py
|
| 378 |
+
site-packages/setuptools/tests/config/downloads/preload.py
|
| 379 |
+
site-packages/setuptools/tests/config/setupcfg_examples.txt
|
| 380 |
+
site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py
|
| 381 |
+
site-packages/setuptools/tests/config/test_expand.py
|
| 382 |
+
site-packages/setuptools/tests/config/test_pyprojecttoml.py
|
| 383 |
+
site-packages/setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py
|
| 384 |
+
site-packages/setuptools/tests/config/test_setupcfg.py
|
| 385 |
+
site-packages/setuptools/tests/contexts.py
|
| 386 |
+
site-packages/setuptools/tests/environment.py
|
| 387 |
+
site-packages/setuptools/tests/fixtures.py
|
| 388 |
+
site-packages/setuptools/tests/indexes/test_links_priority/external.html
|
| 389 |
+
site-packages/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html
|
| 390 |
+
site-packages/setuptools/tests/integration/__init__.py
|
| 391 |
+
site-packages/setuptools/tests/integration/helpers.py
|
| 392 |
+
site-packages/setuptools/tests/integration/test_pbr.py
|
| 393 |
+
site-packages/setuptools/tests/integration/test_pip_install_sdist.py
|
| 394 |
+
site-packages/setuptools/tests/mod_with_constant.py
|
| 395 |
+
site-packages/setuptools/tests/namespaces.py
|
| 396 |
+
site-packages/setuptools/tests/script-with-bom.py
|
| 397 |
+
site-packages/setuptools/tests/test_archive_util.py
|
| 398 |
+
site-packages/setuptools/tests/test_bdist_deprecations.py
|
| 399 |
+
site-packages/setuptools/tests/test_bdist_egg.py
|
| 400 |
+
site-packages/setuptools/tests/test_bdist_wheel.py
|
| 401 |
+
site-packages/setuptools/tests/test_build.py
|
| 402 |
+
site-packages/setuptools/tests/test_build_clib.py
|
| 403 |
+
site-packages/setuptools/tests/test_build_ext.py
|
| 404 |
+
site-packages/setuptools/tests/test_build_meta.py
|
| 405 |
+
site-packages/setuptools/tests/test_build_py.py
|
| 406 |
+
site-packages/setuptools/tests/test_config_discovery.py
|
| 407 |
+
site-packages/setuptools/tests/test_core_metadata.py
|
| 408 |
+
site-packages/setuptools/tests/test_depends.py
|
| 409 |
+
site-packages/setuptools/tests/test_develop.py
|
| 410 |
+
site-packages/setuptools/tests/test_dist.py
|
| 411 |
+
site-packages/setuptools/tests/test_dist_info.py
|
| 412 |
+
site-packages/setuptools/tests/test_distutils_adoption.py
|
| 413 |
+
site-packages/setuptools/tests/test_editable_install.py
|
| 414 |
+
site-packages/setuptools/tests/test_egg_info.py
|
| 415 |
+
site-packages/setuptools/tests/test_extern.py
|
| 416 |
+
site-packages/setuptools/tests/test_find_packages.py
|
| 417 |
+
site-packages/setuptools/tests/test_find_py_modules.py
|
| 418 |
+
site-packages/setuptools/tests/test_glob.py
|
| 419 |
+
site-packages/setuptools/tests/test_install_scripts.py
|
| 420 |
+
site-packages/setuptools/tests/test_logging.py
|
| 421 |
+
site-packages/setuptools/tests/test_manifest.py
|
| 422 |
+
site-packages/setuptools/tests/test_namespaces.py
|
| 423 |
+
site-packages/setuptools/tests/test_scripts.py
|
| 424 |
+
site-packages/setuptools/tests/test_sdist.py
|
| 425 |
+
site-packages/setuptools/tests/test_setopt.py
|
| 426 |
+
site-packages/setuptools/tests/test_setuptools.py
|
| 427 |
+
site-packages/setuptools/tests/test_shutil_wrapper.py
|
| 428 |
+
site-packages/setuptools/tests/test_unicode_utils.py
|
| 429 |
+
site-packages/setuptools/tests/test_virtualenv.py
|
| 430 |
+
site-packages/setuptools/tests/test_warnings.py
|
| 431 |
+
site-packages/setuptools/tests/test_wheel.py
|
| 432 |
+
site-packages/setuptools/tests/test_windows_wrappers.py
|
| 433 |
+
site-packages/setuptools/tests/text.py
|
| 434 |
+
site-packages/setuptools/tests/textwrap.py
|
| 435 |
+
site-packages/setuptools/unicode_utils.py
|
| 436 |
+
site-packages/setuptools/version.py
|
| 437 |
+
site-packages/setuptools/warnings.py
|
| 438 |
+
site-packages/setuptools/wheel.py
|
| 439 |
+
site-packages/setuptools/windows_support.py
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/git
ADDED
|
File without changes
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/hash_input.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"python": "3.13.* *_cp313",
|
| 3 |
+
"channel_targets": "conda-forge main"
|
| 4 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/index.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"arch": null,
|
| 3 |
+
"build": "pyh332efcf_0",
|
| 4 |
+
"build_number": 0,
|
| 5 |
+
"depends": [
|
| 6 |
+
"python >=3.10"
|
| 7 |
+
],
|
| 8 |
+
"license": "MIT",
|
| 9 |
+
"license_family": "MIT",
|
| 10 |
+
"name": "setuptools",
|
| 11 |
+
"noarch": "python",
|
| 12 |
+
"platform": null,
|
| 13 |
+
"subdir": "noarch",
|
| 14 |
+
"timestamp": 1773074868565,
|
| 15 |
+
"version": "82.0.1"
|
| 16 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/link.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"noarch": {
|
| 3 |
+
"type": "python"
|
| 4 |
+
},
|
| 5 |
+
"package_metadata_version": 1
|
| 6 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/paths.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/info/repodata_record.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"arch": null,
|
| 3 |
+
"build": "pyh332efcf_0",
|
| 4 |
+
"build_number": 0,
|
| 5 |
+
"build_string": "pyh332efcf_0",
|
| 6 |
+
"channel": "conda-forge",
|
| 7 |
+
"constrains": [],
|
| 8 |
+
"depends": [
|
| 9 |
+
"python >=3.10"
|
| 10 |
+
],
|
| 11 |
+
"fn": "setuptools-82.0.1-pyh332efcf_0.conda",
|
| 12 |
+
"license": "MIT",
|
| 13 |
+
"license_family": "MIT",
|
| 14 |
+
"md5": "8e194e7b992f99a5015edbd4ebd38efd",
|
| 15 |
+
"name": "setuptools",
|
| 16 |
+
"noarch": "python",
|
| 17 |
+
"platform": null,
|
| 18 |
+
"sha256": "82088a6e4daa33329a30bc26dc19a98c7c1d3f05c0f73ce9845d4eab4924e9e1",
|
| 19 |
+
"size": 639697,
|
| 20 |
+
"subdir": "noarch",
|
| 21 |
+
"timestamp": 1773074868,
|
| 22 |
+
"url": "https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda",
|
| 23 |
+
"version": "82.0.1"
|
| 24 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/_distutils_hack/__init__.py
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# don't import any costly modules
|
| 2 |
+
import os
|
| 3 |
+
import sys
|
| 4 |
+
|
| 5 |
+
report_url = (
|
| 6 |
+
"https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml"
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def warn_distutils_present():
|
| 11 |
+
if 'distutils' not in sys.modules:
|
| 12 |
+
return
|
| 13 |
+
import warnings
|
| 14 |
+
|
| 15 |
+
warnings.warn(
|
| 16 |
+
"Distutils was imported before Setuptools, but importing Setuptools "
|
| 17 |
+
"also replaces the `distutils` module in `sys.modules`. This may lead "
|
| 18 |
+
"to undesirable behaviors or errors. To avoid these issues, avoid "
|
| 19 |
+
"using distutils directly, ensure that setuptools is installed in the "
|
| 20 |
+
"traditional way (e.g. not an editable install), and/or make sure "
|
| 21 |
+
"that setuptools is always imported before distutils."
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def clear_distutils():
|
| 26 |
+
if 'distutils' not in sys.modules:
|
| 27 |
+
return
|
| 28 |
+
import warnings
|
| 29 |
+
|
| 30 |
+
warnings.warn(
|
| 31 |
+
"Setuptools is replacing distutils. Support for replacing "
|
| 32 |
+
"an already imported distutils is deprecated. In the future, "
|
| 33 |
+
"this condition will fail. "
|
| 34 |
+
f"Register concerns at {report_url}"
|
| 35 |
+
)
|
| 36 |
+
mods = [
|
| 37 |
+
name
|
| 38 |
+
for name in sys.modules
|
| 39 |
+
if name == "distutils" or name.startswith("distutils.")
|
| 40 |
+
]
|
| 41 |
+
for name in mods:
|
| 42 |
+
del sys.modules[name]
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def enabled():
|
| 46 |
+
"""
|
| 47 |
+
Allow selection of distutils by environment variable.
|
| 48 |
+
"""
|
| 49 |
+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
|
| 50 |
+
if which == 'stdlib':
|
| 51 |
+
import warnings
|
| 52 |
+
|
| 53 |
+
warnings.warn(
|
| 54 |
+
"Reliance on distutils from stdlib is deprecated. Users "
|
| 55 |
+
"must rely on setuptools to provide the distutils module. "
|
| 56 |
+
"Avoid importing distutils or import setuptools first, "
|
| 57 |
+
"and avoid setting SETUPTOOLS_USE_DISTUTILS=stdlib. "
|
| 58 |
+
f"Register concerns at {report_url}"
|
| 59 |
+
)
|
| 60 |
+
return which == 'local'
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def ensure_local_distutils():
|
| 64 |
+
import importlib
|
| 65 |
+
|
| 66 |
+
clear_distutils()
|
| 67 |
+
|
| 68 |
+
# With the DistutilsMetaFinder in place,
|
| 69 |
+
# perform an import to cause distutils to be
|
| 70 |
+
# loaded from setuptools._distutils. Ref #2906.
|
| 71 |
+
with shim():
|
| 72 |
+
importlib.import_module('distutils')
|
| 73 |
+
|
| 74 |
+
# check that submodules load as expected
|
| 75 |
+
core = importlib.import_module('distutils.core')
|
| 76 |
+
assert '_distutils' in core.__file__, core.__file__
|
| 77 |
+
assert 'setuptools._distutils.log' not in sys.modules
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def do_override():
|
| 81 |
+
"""
|
| 82 |
+
Ensure that the local copy of distutils is preferred over stdlib.
|
| 83 |
+
|
| 84 |
+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
|
| 85 |
+
for more motivation.
|
| 86 |
+
"""
|
| 87 |
+
if enabled():
|
| 88 |
+
warn_distutils_present()
|
| 89 |
+
ensure_local_distutils()
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
class _TrivialRe:
|
| 93 |
+
def __init__(self, *patterns) -> None:
|
| 94 |
+
self._patterns = patterns
|
| 95 |
+
|
| 96 |
+
def match(self, string):
|
| 97 |
+
return all(pat in string for pat in self._patterns)
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
class DistutilsMetaFinder:
|
| 101 |
+
def find_spec(self, fullname, path, target=None):
|
| 102 |
+
# optimization: only consider top level modules and those
|
| 103 |
+
# found in the CPython test suite.
|
| 104 |
+
if path is not None and not fullname.startswith('test.'):
|
| 105 |
+
return None
|
| 106 |
+
|
| 107 |
+
method_name = 'spec_for_{fullname}'.format(**locals())
|
| 108 |
+
method = getattr(self, method_name, lambda: None)
|
| 109 |
+
return method()
|
| 110 |
+
|
| 111 |
+
def spec_for_distutils(self):
|
| 112 |
+
if self.is_cpython():
|
| 113 |
+
return None
|
| 114 |
+
|
| 115 |
+
import importlib
|
| 116 |
+
import importlib.abc
|
| 117 |
+
import importlib.util
|
| 118 |
+
|
| 119 |
+
try:
|
| 120 |
+
mod = importlib.import_module('setuptools._distutils')
|
| 121 |
+
except Exception:
|
| 122 |
+
# There are a couple of cases where setuptools._distutils
|
| 123 |
+
# may not be present:
|
| 124 |
+
# - An older Setuptools without a local distutils is
|
| 125 |
+
# taking precedence. Ref #2957.
|
| 126 |
+
# - Path manipulation during sitecustomize removes
|
| 127 |
+
# setuptools from the path but only after the hook
|
| 128 |
+
# has been loaded. Ref #2980.
|
| 129 |
+
# In either case, fall back to stdlib behavior.
|
| 130 |
+
return None
|
| 131 |
+
|
| 132 |
+
class DistutilsLoader(importlib.abc.Loader):
|
| 133 |
+
def create_module(self, spec):
|
| 134 |
+
mod.__name__ = 'distutils'
|
| 135 |
+
return mod
|
| 136 |
+
|
| 137 |
+
def exec_module(self, module):
|
| 138 |
+
pass
|
| 139 |
+
|
| 140 |
+
return importlib.util.spec_from_loader(
|
| 141 |
+
'distutils', DistutilsLoader(), origin=mod.__file__
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
+
@staticmethod
|
| 145 |
+
def is_cpython():
|
| 146 |
+
"""
|
| 147 |
+
Suppress supplying distutils for CPython (build and tests).
|
| 148 |
+
Ref #2965 and #3007.
|
| 149 |
+
"""
|
| 150 |
+
return os.path.isfile('pybuilddir.txt')
|
| 151 |
+
|
| 152 |
+
def spec_for_pip(self):
|
| 153 |
+
"""
|
| 154 |
+
Ensure stdlib distutils when running under pip.
|
| 155 |
+
See pypa/pip#8761 for rationale.
|
| 156 |
+
"""
|
| 157 |
+
if sys.version_info >= (3, 12) or self.pip_imported_during_build():
|
| 158 |
+
return
|
| 159 |
+
clear_distutils()
|
| 160 |
+
self.spec_for_distutils = lambda: None
|
| 161 |
+
|
| 162 |
+
@classmethod
|
| 163 |
+
def pip_imported_during_build(cls):
|
| 164 |
+
"""
|
| 165 |
+
Detect if pip is being imported in a build script. Ref #2355.
|
| 166 |
+
"""
|
| 167 |
+
import traceback
|
| 168 |
+
|
| 169 |
+
return any(
|
| 170 |
+
cls.frame_file_is_setup(frame) for frame, line in traceback.walk_stack(None)
|
| 171 |
+
)
|
| 172 |
+
|
| 173 |
+
@staticmethod
|
| 174 |
+
def frame_file_is_setup(frame):
|
| 175 |
+
"""
|
| 176 |
+
Return True if the indicated frame suggests a setup.py file.
|
| 177 |
+
"""
|
| 178 |
+
# some frames may not have __file__ (#2940)
|
| 179 |
+
return frame.f_globals.get('__file__', '').endswith('setup.py')
|
| 180 |
+
|
| 181 |
+
def spec_for_sensitive_tests(self):
|
| 182 |
+
"""
|
| 183 |
+
Ensure stdlib distutils when running select tests under CPython.
|
| 184 |
+
|
| 185 |
+
python/cpython#91169
|
| 186 |
+
"""
|
| 187 |
+
clear_distutils()
|
| 188 |
+
self.spec_for_distutils = lambda: None
|
| 189 |
+
|
| 190 |
+
sensitive_tests = (
|
| 191 |
+
[
|
| 192 |
+
'test.test_distutils',
|
| 193 |
+
'test.test_peg_generator',
|
| 194 |
+
'test.test_importlib',
|
| 195 |
+
]
|
| 196 |
+
if sys.version_info < (3, 10)
|
| 197 |
+
else [
|
| 198 |
+
'test.test_distutils',
|
| 199 |
+
]
|
| 200 |
+
)
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
for name in DistutilsMetaFinder.sensitive_tests:
|
| 204 |
+
setattr(
|
| 205 |
+
DistutilsMetaFinder,
|
| 206 |
+
f'spec_for_{name}',
|
| 207 |
+
DistutilsMetaFinder.spec_for_sensitive_tests,
|
| 208 |
+
)
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
DISTUTILS_FINDER = DistutilsMetaFinder()
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
def add_shim():
|
| 215 |
+
DISTUTILS_FINDER in sys.meta_path or insert_shim()
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
class shim:
|
| 219 |
+
def __enter__(self) -> None:
|
| 220 |
+
insert_shim()
|
| 221 |
+
|
| 222 |
+
def __exit__(self, exc: object, value: object, tb: object) -> None:
|
| 223 |
+
_remove_shim()
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
def insert_shim():
|
| 227 |
+
sys.meta_path.insert(0, DISTUTILS_FINDER)
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
def _remove_shim():
|
| 231 |
+
try:
|
| 232 |
+
sys.meta_path.remove(DISTUTILS_FINDER)
|
| 233 |
+
except ValueError:
|
| 234 |
+
pass
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
if sys.version_info < (3, 12):
|
| 238 |
+
# DistutilsMetaFinder can only be disabled in Python < 3.12 (PEP 632)
|
| 239 |
+
remove_shim = _remove_shim
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/_distutils_hack/override.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__import__('_distutils_hack').do_override()
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: setuptools
|
| 3 |
+
Version: 82.0.1
|
| 4 |
+
Summary: Most extensible Python build backend with support for C/C++ extension modules
|
| 5 |
+
Author-email: Python Packaging Authority <distutils-sig@python.org>
|
| 6 |
+
License-Expression: MIT
|
| 7 |
+
Project-URL: Source, https://github.com/pypa/setuptools
|
| 8 |
+
Project-URL: Documentation, https://setuptools.pypa.io/
|
| 9 |
+
Project-URL: Changelog, https://setuptools.pypa.io/en/stable/history.html
|
| 10 |
+
Keywords: CPAN PyPI distutils eggs package management
|
| 11 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: Programming Language :: Python :: 3
|
| 14 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 15 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 16 |
+
Classifier: Topic :: System :: Archiving :: Packaging
|
| 17 |
+
Classifier: Topic :: System :: Systems Administration
|
| 18 |
+
Classifier: Topic :: Utilities
|
| 19 |
+
Requires-Python: >=3.9
|
| 20 |
+
Description-Content-Type: text/x-rst
|
| 21 |
+
License-File: LICENSE
|
| 22 |
+
Provides-Extra: test
|
| 23 |
+
Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
|
| 24 |
+
Requires-Dist: virtualenv>=13.0.0; extra == "test"
|
| 25 |
+
Requires-Dist: wheel>=0.44.0; extra == "test"
|
| 26 |
+
Requires-Dist: pip>=19.1; extra == "test"
|
| 27 |
+
Requires-Dist: packaging>=24.2; extra == "test"
|
| 28 |
+
Requires-Dist: jaraco.envs>=2.2; extra == "test"
|
| 29 |
+
Requires-Dist: pytest-xdist>=3; extra == "test"
|
| 30 |
+
Requires-Dist: jaraco.path>=3.7.2; extra == "test"
|
| 31 |
+
Requires-Dist: build[virtualenv]>=1.0.3; extra == "test"
|
| 32 |
+
Requires-Dist: filelock>=3.4.0; extra == "test"
|
| 33 |
+
Requires-Dist: ini2toml[lite]>=0.14; extra == "test"
|
| 34 |
+
Requires-Dist: tomli-w>=1.0.0; extra == "test"
|
| 35 |
+
Requires-Dist: pytest-timeout; extra == "test"
|
| 36 |
+
Requires-Dist: pytest-perf; sys_platform != "cygwin" and extra == "test"
|
| 37 |
+
Requires-Dist: jaraco.develop>=7.21; (python_version >= "3.9" and sys_platform != "cygwin") and extra == "test"
|
| 38 |
+
Requires-Dist: pytest-home>=0.5; extra == "test"
|
| 39 |
+
Requires-Dist: pytest-subprocess; extra == "test"
|
| 40 |
+
Requires-Dist: pyproject-hooks!=1.1; extra == "test"
|
| 41 |
+
Requires-Dist: jaraco.test>=5.5; extra == "test"
|
| 42 |
+
Provides-Extra: doc
|
| 43 |
+
Requires-Dist: sphinx>=3.5; extra == "doc"
|
| 44 |
+
Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
|
| 45 |
+
Requires-Dist: rst.linker>=1.9; extra == "doc"
|
| 46 |
+
Requires-Dist: furo; extra == "doc"
|
| 47 |
+
Requires-Dist: sphinx-lint; extra == "doc"
|
| 48 |
+
Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
|
| 49 |
+
Requires-Dist: pygments-github-lexers==0.0.5; extra == "doc"
|
| 50 |
+
Requires-Dist: sphinx-favicon; extra == "doc"
|
| 51 |
+
Requires-Dist: sphinx-inline-tabs; extra == "doc"
|
| 52 |
+
Requires-Dist: sphinx-reredirects; extra == "doc"
|
| 53 |
+
Requires-Dist: sphinxcontrib-towncrier; extra == "doc"
|
| 54 |
+
Requires-Dist: sphinx-notfound-page<2,>=1; extra == "doc"
|
| 55 |
+
Requires-Dist: pyproject-hooks!=1.1; extra == "doc"
|
| 56 |
+
Requires-Dist: towncrier<24.7; extra == "doc"
|
| 57 |
+
Provides-Extra: ssl
|
| 58 |
+
Provides-Extra: certs
|
| 59 |
+
Provides-Extra: core
|
| 60 |
+
Requires-Dist: packaging>=24.2; extra == "core"
|
| 61 |
+
Requires-Dist: more_itertools>=8.8; extra == "core"
|
| 62 |
+
Requires-Dist: jaraco.text>=3.7; extra == "core"
|
| 63 |
+
Requires-Dist: importlib_metadata>=6; python_version < "3.10" and extra == "core"
|
| 64 |
+
Requires-Dist: tomli>=2.0.1; python_version < "3.11" and extra == "core"
|
| 65 |
+
Requires-Dist: wheel>=0.43.0; extra == "core"
|
| 66 |
+
Requires-Dist: jaraco.functools>=4; extra == "core"
|
| 67 |
+
Requires-Dist: more_itertools; extra == "core"
|
| 68 |
+
Provides-Extra: check
|
| 69 |
+
Requires-Dist: pytest-checkdocs>=2.4; extra == "check"
|
| 70 |
+
Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
|
| 71 |
+
Requires-Dist: ruff>=0.13.0; sys_platform != "cygwin" and extra == "check"
|
| 72 |
+
Provides-Extra: cover
|
| 73 |
+
Requires-Dist: pytest-cov; extra == "cover"
|
| 74 |
+
Provides-Extra: enabler
|
| 75 |
+
Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
|
| 76 |
+
Provides-Extra: type
|
| 77 |
+
Requires-Dist: pytest-mypy; extra == "type"
|
| 78 |
+
Requires-Dist: mypy==1.18.*; extra == "type"
|
| 79 |
+
Requires-Dist: importlib_metadata>=7.0.2; python_version < "3.10" and extra == "type"
|
| 80 |
+
Requires-Dist: jaraco.develop>=7.21; sys_platform != "cygwin" and extra == "type"
|
| 81 |
+
Dynamic: license-file
|
| 82 |
+
|
| 83 |
+
.. |pypi-version| image:: https://img.shields.io/pypi/v/setuptools.svg
|
| 84 |
+
:target: https://pypi.org/project/setuptools
|
| 85 |
+
|
| 86 |
+
.. |py-version| image:: https://img.shields.io/pypi/pyversions/setuptools.svg
|
| 87 |
+
|
| 88 |
+
.. |test-badge| image:: https://github.com/pypa/setuptools/actions/workflows/main.yml/badge.svg
|
| 89 |
+
:target: https://github.com/pypa/setuptools/actions?query=workflow%3A%22tests%22
|
| 90 |
+
:alt: tests
|
| 91 |
+
|
| 92 |
+
.. |ruff-badge| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
|
| 93 |
+
:target: https://github.com/astral-sh/ruff
|
| 94 |
+
:alt: Ruff
|
| 95 |
+
|
| 96 |
+
.. |docs-badge| image:: https://img.shields.io/readthedocs/setuptools/latest.svg
|
| 97 |
+
:target: https://setuptools.pypa.io
|
| 98 |
+
|
| 99 |
+
.. |skeleton-badge| image:: https://img.shields.io/badge/skeleton-2025-informational
|
| 100 |
+
:target: https://blog.jaraco.com/skeleton
|
| 101 |
+
|
| 102 |
+
.. |codecov-badge| image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white
|
| 103 |
+
:target: https://codecov.io/gh/pypa/setuptools
|
| 104 |
+
|
| 105 |
+
.. |tidelift-badge| image:: https://tidelift.com/badges/github/pypa/setuptools?style=flat
|
| 106 |
+
:target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme
|
| 107 |
+
|
| 108 |
+
.. |discord-badge| image:: https://img.shields.io/discord/803025117553754132
|
| 109 |
+
:target: https://discord.com/channels/803025117553754132/815945031150993468
|
| 110 |
+
:alt: Discord
|
| 111 |
+
|
| 112 |
+
|pypi-version| |py-version| |test-badge| |ruff-badge| |docs-badge| |skeleton-badge| |codecov-badge| |discord-badge|
|
| 113 |
+
|
| 114 |
+
See the `Quickstart <https://setuptools.pypa.io/en/latest/userguide/quickstart.html>`_
|
| 115 |
+
and the `User's Guide <https://setuptools.pypa.io/en/latest/userguide/>`_ for
|
| 116 |
+
instructions on how to use Setuptools.
|
| 117 |
+
|
| 118 |
+
Questions and comments should be directed to `GitHub Discussions
|
| 119 |
+
<https://github.com/pypa/setuptools/discussions>`_.
|
| 120 |
+
Bug reports and especially tested patches may be
|
| 121 |
+
submitted directly to the `bug tracker
|
| 122 |
+
<https://github.com/pypa/setuptools/issues>`_.
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
Code of Conduct
|
| 126 |
+
===============
|
| 127 |
+
|
| 128 |
+
Everyone interacting in the setuptools project's codebases, issue trackers,
|
| 129 |
+
chat rooms, and fora is expected to follow the
|
| 130 |
+
`PSF Code of Conduct <https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md>`_.
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
For Enterprise
|
| 134 |
+
==============
|
| 135 |
+
|
| 136 |
+
Available as part of the Tidelift Subscription.
|
| 137 |
+
|
| 138 |
+
Setuptools and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
|
| 139 |
+
|
| 140 |
+
`Learn more <https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=referral&utm_campaign=github>`_.
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
LICENSE
|
| 2 |
+
MANIFEST.in
|
| 3 |
+
NEWS.rst
|
| 4 |
+
README.rst
|
| 5 |
+
conftest.py
|
| 6 |
+
exercises.py
|
| 7 |
+
launcher.c
|
| 8 |
+
mypy.ini
|
| 9 |
+
pyproject.toml
|
| 10 |
+
pytest.ini
|
| 11 |
+
setup.cfg
|
| 12 |
+
setup.py
|
| 13 |
+
tox.ini
|
| 14 |
+
_distutils_hack/__init__.py
|
| 15 |
+
_distutils_hack/override.py
|
| 16 |
+
docs/artwork.rst
|
| 17 |
+
docs/build_meta.rst
|
| 18 |
+
docs/conf.py
|
| 19 |
+
docs/history.rst
|
| 20 |
+
docs/index.rst
|
| 21 |
+
docs/python 2 sunset.rst
|
| 22 |
+
docs/roadmap.rst
|
| 23 |
+
docs/setuptools.rst
|
| 24 |
+
docs/deprecated/changed_keywords.rst
|
| 25 |
+
docs/deprecated/commands.rst
|
| 26 |
+
docs/deprecated/dependency_links.rst
|
| 27 |
+
docs/deprecated/distutils-legacy.rst
|
| 28 |
+
docs/deprecated/easy_install.rst
|
| 29 |
+
docs/deprecated/functionalities.rst
|
| 30 |
+
docs/deprecated/index.rst
|
| 31 |
+
docs/deprecated/pkg_resources.rst
|
| 32 |
+
docs/deprecated/python_eggs.rst
|
| 33 |
+
docs/deprecated/resource_extraction.rst
|
| 34 |
+
docs/deprecated/sdist-reproducibility.rst
|
| 35 |
+
docs/deprecated/zip_safe.rst
|
| 36 |
+
docs/deprecated/distutils/_setuptools_disclaimer.rst
|
| 37 |
+
docs/deprecated/distutils/apiref.rst
|
| 38 |
+
docs/deprecated/distutils/builtdist.rst
|
| 39 |
+
docs/deprecated/distutils/commandref.rst
|
| 40 |
+
docs/deprecated/distutils/configfile.rst
|
| 41 |
+
docs/deprecated/distutils/examples.rst
|
| 42 |
+
docs/deprecated/distutils/extending.rst
|
| 43 |
+
docs/deprecated/distutils/index.rst
|
| 44 |
+
docs/deprecated/distutils/introduction.rst
|
| 45 |
+
docs/deprecated/distutils/packageindex.rst
|
| 46 |
+
docs/deprecated/distutils/setupscript.rst
|
| 47 |
+
docs/deprecated/distutils/sourcedist.rst
|
| 48 |
+
docs/deprecated/distutils/uploading.rst
|
| 49 |
+
docs/development/developer-guide.rst
|
| 50 |
+
docs/development/index.rst
|
| 51 |
+
docs/development/releases.rst
|
| 52 |
+
docs/references/keywords.rst
|
| 53 |
+
docs/userguide/datafiles.rst
|
| 54 |
+
docs/userguide/declarative_config.rst
|
| 55 |
+
docs/userguide/dependency_management.rst
|
| 56 |
+
docs/userguide/development_mode.rst
|
| 57 |
+
docs/userguide/distribution.rst
|
| 58 |
+
docs/userguide/entry_point.rst
|
| 59 |
+
docs/userguide/ext_modules.rst
|
| 60 |
+
docs/userguide/extension.rst
|
| 61 |
+
docs/userguide/index.rst
|
| 62 |
+
docs/userguide/interfaces.rst
|
| 63 |
+
docs/userguide/miscellaneous.rst
|
| 64 |
+
docs/userguide/package_discovery.rst
|
| 65 |
+
docs/userguide/pyproject_config.rst
|
| 66 |
+
docs/userguide/quickstart.rst
|
| 67 |
+
newsfragments/.gitignore
|
| 68 |
+
newsfragments/README.rst
|
| 69 |
+
setuptools/__init__.py
|
| 70 |
+
setuptools/_core_metadata.py
|
| 71 |
+
setuptools/_discovery.py
|
| 72 |
+
setuptools/_entry_points.py
|
| 73 |
+
setuptools/_imp.py
|
| 74 |
+
setuptools/_importlib.py
|
| 75 |
+
setuptools/_itertools.py
|
| 76 |
+
setuptools/_normalization.py
|
| 77 |
+
setuptools/_path.py
|
| 78 |
+
setuptools/_reqs.py
|
| 79 |
+
setuptools/_scripts.py
|
| 80 |
+
setuptools/_shutil.py
|
| 81 |
+
setuptools/_static.py
|
| 82 |
+
setuptools/archive_util.py
|
| 83 |
+
setuptools/build_meta.py
|
| 84 |
+
setuptools/cli-32.exe
|
| 85 |
+
setuptools/cli-64.exe
|
| 86 |
+
setuptools/cli-arm64.exe
|
| 87 |
+
setuptools/cli.exe
|
| 88 |
+
setuptools/depends.py
|
| 89 |
+
setuptools/discovery.py
|
| 90 |
+
setuptools/dist.py
|
| 91 |
+
setuptools/errors.py
|
| 92 |
+
setuptools/extension.py
|
| 93 |
+
setuptools/glob.py
|
| 94 |
+
setuptools/gui-32.exe
|
| 95 |
+
setuptools/gui-64.exe
|
| 96 |
+
setuptools/gui-arm64.exe
|
| 97 |
+
setuptools/gui.exe
|
| 98 |
+
setuptools/installer.py
|
| 99 |
+
setuptools/launch.py
|
| 100 |
+
setuptools/launcher manifest.xml
|
| 101 |
+
setuptools/logging.py
|
| 102 |
+
setuptools/modified.py
|
| 103 |
+
setuptools/monkey.py
|
| 104 |
+
setuptools/msvc.py
|
| 105 |
+
setuptools/namespaces.py
|
| 106 |
+
setuptools/script (dev).tmpl
|
| 107 |
+
setuptools/script.tmpl
|
| 108 |
+
setuptools/unicode_utils.py
|
| 109 |
+
setuptools/version.py
|
| 110 |
+
setuptools/warnings.py
|
| 111 |
+
setuptools/wheel.py
|
| 112 |
+
setuptools/windows_support.py
|
| 113 |
+
setuptools.egg-info/PKG-INFO
|
| 114 |
+
setuptools.egg-info/SOURCES.txt
|
| 115 |
+
setuptools.egg-info/dependency_links.txt
|
| 116 |
+
setuptools.egg-info/entry_points.txt
|
| 117 |
+
setuptools.egg-info/requires.txt
|
| 118 |
+
setuptools.egg-info/top_level.txt
|
| 119 |
+
setuptools/_distutils/__init__.py
|
| 120 |
+
setuptools/_distutils/_log.py
|
| 121 |
+
setuptools/_distutils/_macos_compat.py
|
| 122 |
+
setuptools/_distutils/_modified.py
|
| 123 |
+
setuptools/_distutils/_msvccompiler.py
|
| 124 |
+
setuptools/_distutils/archive_util.py
|
| 125 |
+
setuptools/_distutils/ccompiler.py
|
| 126 |
+
setuptools/_distutils/cmd.py
|
| 127 |
+
setuptools/_distutils/core.py
|
| 128 |
+
setuptools/_distutils/cygwinccompiler.py
|
| 129 |
+
setuptools/_distutils/debug.py
|
| 130 |
+
setuptools/_distutils/dep_util.py
|
| 131 |
+
setuptools/_distutils/dir_util.py
|
| 132 |
+
setuptools/_distutils/dist.py
|
| 133 |
+
setuptools/_distutils/errors.py
|
| 134 |
+
setuptools/_distutils/extension.py
|
| 135 |
+
setuptools/_distutils/fancy_getopt.py
|
| 136 |
+
setuptools/_distutils/file_util.py
|
| 137 |
+
setuptools/_distutils/filelist.py
|
| 138 |
+
setuptools/_distutils/log.py
|
| 139 |
+
setuptools/_distutils/spawn.py
|
| 140 |
+
setuptools/_distutils/sysconfig.py
|
| 141 |
+
setuptools/_distutils/text_file.py
|
| 142 |
+
setuptools/_distutils/unixccompiler.py
|
| 143 |
+
setuptools/_distutils/util.py
|
| 144 |
+
setuptools/_distutils/version.py
|
| 145 |
+
setuptools/_distutils/versionpredicate.py
|
| 146 |
+
setuptools/_distutils/zosccompiler.py
|
| 147 |
+
setuptools/_distutils/command/__init__.py
|
| 148 |
+
setuptools/_distutils/command/_framework_compat.py
|
| 149 |
+
setuptools/_distutils/command/bdist.py
|
| 150 |
+
setuptools/_distutils/command/bdist_dumb.py
|
| 151 |
+
setuptools/_distutils/command/bdist_rpm.py
|
| 152 |
+
setuptools/_distutils/command/build.py
|
| 153 |
+
setuptools/_distutils/command/build_clib.py
|
| 154 |
+
setuptools/_distutils/command/build_ext.py
|
| 155 |
+
setuptools/_distutils/command/build_py.py
|
| 156 |
+
setuptools/_distutils/command/build_scripts.py
|
| 157 |
+
setuptools/_distutils/command/check.py
|
| 158 |
+
setuptools/_distutils/command/clean.py
|
| 159 |
+
setuptools/_distutils/command/config.py
|
| 160 |
+
setuptools/_distutils/command/install.py
|
| 161 |
+
setuptools/_distutils/command/install_data.py
|
| 162 |
+
setuptools/_distutils/command/install_egg_info.py
|
| 163 |
+
setuptools/_distutils/command/install_headers.py
|
| 164 |
+
setuptools/_distutils/command/install_lib.py
|
| 165 |
+
setuptools/_distutils/command/install_scripts.py
|
| 166 |
+
setuptools/_distutils/command/sdist.py
|
| 167 |
+
setuptools/_distutils/compat/__init__.py
|
| 168 |
+
setuptools/_distutils/compat/numpy.py
|
| 169 |
+
setuptools/_distutils/compat/py39.py
|
| 170 |
+
setuptools/_distutils/compilers/C/base.py
|
| 171 |
+
setuptools/_distutils/compilers/C/cygwin.py
|
| 172 |
+
setuptools/_distutils/compilers/C/errors.py
|
| 173 |
+
setuptools/_distutils/compilers/C/msvc.py
|
| 174 |
+
setuptools/_distutils/compilers/C/unix.py
|
| 175 |
+
setuptools/_distutils/compilers/C/zos.py
|
| 176 |
+
setuptools/_distutils/compilers/C/tests/test_base.py
|
| 177 |
+
setuptools/_distutils/compilers/C/tests/test_cygwin.py
|
| 178 |
+
setuptools/_distutils/compilers/C/tests/test_mingw.py
|
| 179 |
+
setuptools/_distutils/compilers/C/tests/test_msvc.py
|
| 180 |
+
setuptools/_distutils/compilers/C/tests/test_unix.py
|
| 181 |
+
setuptools/_distutils/tests/__init__.py
|
| 182 |
+
setuptools/_distutils/tests/support.py
|
| 183 |
+
setuptools/_distutils/tests/test_archive_util.py
|
| 184 |
+
setuptools/_distutils/tests/test_bdist.py
|
| 185 |
+
setuptools/_distutils/tests/test_bdist_dumb.py
|
| 186 |
+
setuptools/_distutils/tests/test_bdist_rpm.py
|
| 187 |
+
setuptools/_distutils/tests/test_build.py
|
| 188 |
+
setuptools/_distutils/tests/test_build_clib.py
|
| 189 |
+
setuptools/_distutils/tests/test_build_ext.py
|
| 190 |
+
setuptools/_distutils/tests/test_build_py.py
|
| 191 |
+
setuptools/_distutils/tests/test_build_scripts.py
|
| 192 |
+
setuptools/_distutils/tests/test_check.py
|
| 193 |
+
setuptools/_distutils/tests/test_clean.py
|
| 194 |
+
setuptools/_distutils/tests/test_cmd.py
|
| 195 |
+
setuptools/_distutils/tests/test_config_cmd.py
|
| 196 |
+
setuptools/_distutils/tests/test_core.py
|
| 197 |
+
setuptools/_distutils/tests/test_dir_util.py
|
| 198 |
+
setuptools/_distutils/tests/test_dist.py
|
| 199 |
+
setuptools/_distutils/tests/test_extension.py
|
| 200 |
+
setuptools/_distutils/tests/test_file_util.py
|
| 201 |
+
setuptools/_distutils/tests/test_filelist.py
|
| 202 |
+
setuptools/_distutils/tests/test_install.py
|
| 203 |
+
setuptools/_distutils/tests/test_install_data.py
|
| 204 |
+
setuptools/_distutils/tests/test_install_headers.py
|
| 205 |
+
setuptools/_distutils/tests/test_install_lib.py
|
| 206 |
+
setuptools/_distutils/tests/test_install_scripts.py
|
| 207 |
+
setuptools/_distutils/tests/test_log.py
|
| 208 |
+
setuptools/_distutils/tests/test_modified.py
|
| 209 |
+
setuptools/_distutils/tests/test_sdist.py
|
| 210 |
+
setuptools/_distutils/tests/test_spawn.py
|
| 211 |
+
setuptools/_distutils/tests/test_sysconfig.py
|
| 212 |
+
setuptools/_distutils/tests/test_text_file.py
|
| 213 |
+
setuptools/_distutils/tests/test_util.py
|
| 214 |
+
setuptools/_distutils/tests/test_version.py
|
| 215 |
+
setuptools/_distutils/tests/test_versionpredicate.py
|
| 216 |
+
setuptools/_distutils/tests/unix_compat.py
|
| 217 |
+
setuptools/_distutils/tests/compat/__init__.py
|
| 218 |
+
setuptools/_distutils/tests/compat/py39.py
|
| 219 |
+
setuptools/_vendor/.lock
|
| 220 |
+
setuptools/_vendor/ruff.toml
|
| 221 |
+
setuptools/_vendor/autocommand/__init__.py
|
| 222 |
+
setuptools/_vendor/autocommand/autoasync.py
|
| 223 |
+
setuptools/_vendor/autocommand/autocommand.py
|
| 224 |
+
setuptools/_vendor/autocommand/automain.py
|
| 225 |
+
setuptools/_vendor/autocommand/autoparse.py
|
| 226 |
+
setuptools/_vendor/autocommand/errors.py
|
| 227 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/INSTALLER
|
| 228 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE
|
| 229 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA
|
| 230 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/RECORD
|
| 231 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/REQUESTED
|
| 232 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/WHEEL
|
| 233 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/top_level.txt
|
| 234 |
+
setuptools/_vendor/backports/__init__.py
|
| 235 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/INSTALLER
|
| 236 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/LICENSE
|
| 237 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA
|
| 238 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/RECORD
|
| 239 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/REQUESTED
|
| 240 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/WHEEL
|
| 241 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/top_level.txt
|
| 242 |
+
setuptools/_vendor/backports/tarfile/__init__.py
|
| 243 |
+
setuptools/_vendor/backports/tarfile/__main__.py
|
| 244 |
+
setuptools/_vendor/backports/tarfile/compat/__init__.py
|
| 245 |
+
setuptools/_vendor/backports/tarfile/compat/py38.py
|
| 246 |
+
setuptools/_vendor/importlib_metadata/__init__.py
|
| 247 |
+
setuptools/_vendor/importlib_metadata/_adapters.py
|
| 248 |
+
setuptools/_vendor/importlib_metadata/_collections.py
|
| 249 |
+
setuptools/_vendor/importlib_metadata/_compat.py
|
| 250 |
+
setuptools/_vendor/importlib_metadata/_functools.py
|
| 251 |
+
setuptools/_vendor/importlib_metadata/_itertools.py
|
| 252 |
+
setuptools/_vendor/importlib_metadata/_meta.py
|
| 253 |
+
setuptools/_vendor/importlib_metadata/_text.py
|
| 254 |
+
setuptools/_vendor/importlib_metadata/_typing.py
|
| 255 |
+
setuptools/_vendor/importlib_metadata/diagnose.py
|
| 256 |
+
setuptools/_vendor/importlib_metadata/py.typed
|
| 257 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/INSTALLER
|
| 258 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/METADATA
|
| 259 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/RECORD
|
| 260 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/REQUESTED
|
| 261 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/WHEEL
|
| 262 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/top_level.txt
|
| 263 |
+
setuptools/_vendor/importlib_metadata-8.7.1.dist-info/licenses/LICENSE
|
| 264 |
+
setuptools/_vendor/importlib_metadata/compat/__init__.py
|
| 265 |
+
setuptools/_vendor/importlib_metadata/compat/py311.py
|
| 266 |
+
setuptools/_vendor/importlib_metadata/compat/py39.py
|
| 267 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/INSTALLER
|
| 268 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/LICENSE
|
| 269 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/METADATA
|
| 270 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/RECORD
|
| 271 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/REQUESTED
|
| 272 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/WHEEL
|
| 273 |
+
setuptools/_vendor/jaraco.text-4.0.0.dist-info/top_level.txt
|
| 274 |
+
setuptools/_vendor/jaraco/context/__init__.py
|
| 275 |
+
setuptools/_vendor/jaraco/context/py.typed
|
| 276 |
+
setuptools/_vendor/jaraco/functools/__init__.py
|
| 277 |
+
setuptools/_vendor/jaraco/functools/__init__.pyi
|
| 278 |
+
setuptools/_vendor/jaraco/functools/py.typed
|
| 279 |
+
setuptools/_vendor/jaraco/text/Lorem ipsum.txt
|
| 280 |
+
setuptools/_vendor/jaraco/text/__init__.py
|
| 281 |
+
setuptools/_vendor/jaraco/text/layouts.py
|
| 282 |
+
setuptools/_vendor/jaraco/text/show-newlines.py
|
| 283 |
+
setuptools/_vendor/jaraco/text/strip-prefix.py
|
| 284 |
+
setuptools/_vendor/jaraco/text/to-dvorak.py
|
| 285 |
+
setuptools/_vendor/jaraco/text/to-qwerty.py
|
| 286 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/INSTALLER
|
| 287 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/METADATA
|
| 288 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/RECORD
|
| 289 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/REQUESTED
|
| 290 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/WHEEL
|
| 291 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/top_level.txt
|
| 292 |
+
setuptools/_vendor/jaraco_context-6.1.0.dist-info/licenses/LICENSE
|
| 293 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/INSTALLER
|
| 294 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/METADATA
|
| 295 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/RECORD
|
| 296 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/REQUESTED
|
| 297 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/WHEEL
|
| 298 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/top_level.txt
|
| 299 |
+
setuptools/_vendor/jaraco_functools-4.4.0.dist-info/licenses/LICENSE
|
| 300 |
+
setuptools/_vendor/more_itertools/__init__.py
|
| 301 |
+
setuptools/_vendor/more_itertools/__init__.pyi
|
| 302 |
+
setuptools/_vendor/more_itertools/more.py
|
| 303 |
+
setuptools/_vendor/more_itertools/more.pyi
|
| 304 |
+
setuptools/_vendor/more_itertools/py.typed
|
| 305 |
+
setuptools/_vendor/more_itertools/recipes.py
|
| 306 |
+
setuptools/_vendor/more_itertools/recipes.pyi
|
| 307 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/INSTALLER
|
| 308 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/METADATA
|
| 309 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/RECORD
|
| 310 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/REQUESTED
|
| 311 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/WHEEL
|
| 312 |
+
setuptools/_vendor/more_itertools-10.8.0.dist-info/licenses/LICENSE
|
| 313 |
+
setuptools/_vendor/packaging/__init__.py
|
| 314 |
+
setuptools/_vendor/packaging/_elffile.py
|
| 315 |
+
setuptools/_vendor/packaging/_manylinux.py
|
| 316 |
+
setuptools/_vendor/packaging/_musllinux.py
|
| 317 |
+
setuptools/_vendor/packaging/_parser.py
|
| 318 |
+
setuptools/_vendor/packaging/_structures.py
|
| 319 |
+
setuptools/_vendor/packaging/_tokenizer.py
|
| 320 |
+
setuptools/_vendor/packaging/markers.py
|
| 321 |
+
setuptools/_vendor/packaging/metadata.py
|
| 322 |
+
setuptools/_vendor/packaging/py.typed
|
| 323 |
+
setuptools/_vendor/packaging/pylock.py
|
| 324 |
+
setuptools/_vendor/packaging/requirements.py
|
| 325 |
+
setuptools/_vendor/packaging/specifiers.py
|
| 326 |
+
setuptools/_vendor/packaging/tags.py
|
| 327 |
+
setuptools/_vendor/packaging/utils.py
|
| 328 |
+
setuptools/_vendor/packaging/version.py
|
| 329 |
+
setuptools/_vendor/packaging-26.0.dist-info/INSTALLER
|
| 330 |
+
setuptools/_vendor/packaging-26.0.dist-info/METADATA
|
| 331 |
+
setuptools/_vendor/packaging-26.0.dist-info/RECORD
|
| 332 |
+
setuptools/_vendor/packaging-26.0.dist-info/REQUESTED
|
| 333 |
+
setuptools/_vendor/packaging-26.0.dist-info/WHEEL
|
| 334 |
+
setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE
|
| 335 |
+
setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE.APACHE
|
| 336 |
+
setuptools/_vendor/packaging-26.0.dist-info/licenses/LICENSE.BSD
|
| 337 |
+
setuptools/_vendor/packaging/licenses/__init__.py
|
| 338 |
+
setuptools/_vendor/packaging/licenses/_spdx.py
|
| 339 |
+
setuptools/_vendor/platformdirs/__init__.py
|
| 340 |
+
setuptools/_vendor/platformdirs/__main__.py
|
| 341 |
+
setuptools/_vendor/platformdirs/android.py
|
| 342 |
+
setuptools/_vendor/platformdirs/api.py
|
| 343 |
+
setuptools/_vendor/platformdirs/macos.py
|
| 344 |
+
setuptools/_vendor/platformdirs/py.typed
|
| 345 |
+
setuptools/_vendor/platformdirs/unix.py
|
| 346 |
+
setuptools/_vendor/platformdirs/version.py
|
| 347 |
+
setuptools/_vendor/platformdirs/windows.py
|
| 348 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/INSTALLER
|
| 349 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/METADATA
|
| 350 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/RECORD
|
| 351 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/REQUESTED
|
| 352 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/WHEEL
|
| 353 |
+
setuptools/_vendor/platformdirs-4.4.0.dist-info/licenses/LICENSE
|
| 354 |
+
setuptools/_vendor/tomli/__init__.py
|
| 355 |
+
setuptools/_vendor/tomli/_parser.py
|
| 356 |
+
setuptools/_vendor/tomli/_re.py
|
| 357 |
+
setuptools/_vendor/tomli/_types.py
|
| 358 |
+
setuptools/_vendor/tomli/py.typed
|
| 359 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/INSTALLER
|
| 360 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/METADATA
|
| 361 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/RECORD
|
| 362 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/REQUESTED
|
| 363 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/WHEEL
|
| 364 |
+
setuptools/_vendor/tomli-2.4.0.dist-info/licenses/LICENSE
|
| 365 |
+
setuptools/_vendor/wheel/__init__.py
|
| 366 |
+
setuptools/_vendor/wheel/__main__.py
|
| 367 |
+
setuptools/_vendor/wheel/_bdist_wheel.py
|
| 368 |
+
setuptools/_vendor/wheel/_metadata.py
|
| 369 |
+
setuptools/_vendor/wheel/_setuptools_logging.py
|
| 370 |
+
setuptools/_vendor/wheel/bdist_wheel.py
|
| 371 |
+
setuptools/_vendor/wheel/macosx_libfile.py
|
| 372 |
+
setuptools/_vendor/wheel/metadata.py
|
| 373 |
+
setuptools/_vendor/wheel/wheelfile.py
|
| 374 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/INSTALLER
|
| 375 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/METADATA
|
| 376 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/RECORD
|
| 377 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/REQUESTED
|
| 378 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/WHEEL
|
| 379 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/entry_points.txt
|
| 380 |
+
setuptools/_vendor/wheel-0.46.3.dist-info/licenses/LICENSE.txt
|
| 381 |
+
setuptools/_vendor/wheel/_commands/__init__.py
|
| 382 |
+
setuptools/_vendor/wheel/_commands/convert.py
|
| 383 |
+
setuptools/_vendor/wheel/_commands/pack.py
|
| 384 |
+
setuptools/_vendor/wheel/_commands/tags.py
|
| 385 |
+
setuptools/_vendor/wheel/_commands/unpack.py
|
| 386 |
+
setuptools/_vendor/zipp/__init__.py
|
| 387 |
+
setuptools/_vendor/zipp/_functools.py
|
| 388 |
+
setuptools/_vendor/zipp/glob.py
|
| 389 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/INSTALLER
|
| 390 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/METADATA
|
| 391 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/RECORD
|
| 392 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/REQUESTED
|
| 393 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/WHEEL
|
| 394 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/top_level.txt
|
| 395 |
+
setuptools/_vendor/zipp-3.23.0.dist-info/licenses/LICENSE
|
| 396 |
+
setuptools/_vendor/zipp/compat/__init__.py
|
| 397 |
+
setuptools/_vendor/zipp/compat/overlay.py
|
| 398 |
+
setuptools/_vendor/zipp/compat/py310.py
|
| 399 |
+
setuptools/_vendor/zipp/compat/py313.py
|
| 400 |
+
setuptools/command/__init__.py
|
| 401 |
+
setuptools/command/_requirestxt.py
|
| 402 |
+
setuptools/command/alias.py
|
| 403 |
+
setuptools/command/bdist_egg.py
|
| 404 |
+
setuptools/command/bdist_rpm.py
|
| 405 |
+
setuptools/command/bdist_wheel.py
|
| 406 |
+
setuptools/command/build.py
|
| 407 |
+
setuptools/command/build_clib.py
|
| 408 |
+
setuptools/command/build_ext.py
|
| 409 |
+
setuptools/command/build_py.py
|
| 410 |
+
setuptools/command/develop.py
|
| 411 |
+
setuptools/command/dist_info.py
|
| 412 |
+
setuptools/command/easy_install.py
|
| 413 |
+
setuptools/command/editable_wheel.py
|
| 414 |
+
setuptools/command/egg_info.py
|
| 415 |
+
setuptools/command/install.py
|
| 416 |
+
setuptools/command/install_egg_info.py
|
| 417 |
+
setuptools/command/install_lib.py
|
| 418 |
+
setuptools/command/install_scripts.py
|
| 419 |
+
setuptools/command/rotate.py
|
| 420 |
+
setuptools/command/saveopts.py
|
| 421 |
+
setuptools/command/sdist.py
|
| 422 |
+
setuptools/command/setopt.py
|
| 423 |
+
setuptools/command/test.py
|
| 424 |
+
setuptools/compat/__init__.py
|
| 425 |
+
setuptools/compat/py310.py
|
| 426 |
+
setuptools/compat/py311.py
|
| 427 |
+
setuptools/compat/py312.py
|
| 428 |
+
setuptools/compat/py39.py
|
| 429 |
+
setuptools/config/NOTICE
|
| 430 |
+
setuptools/config/__init__.py
|
| 431 |
+
setuptools/config/_apply_pyprojecttoml.py
|
| 432 |
+
setuptools/config/distutils.schema.json
|
| 433 |
+
setuptools/config/expand.py
|
| 434 |
+
setuptools/config/pyprojecttoml.py
|
| 435 |
+
setuptools/config/setupcfg.py
|
| 436 |
+
setuptools/config/setuptools.schema.json
|
| 437 |
+
setuptools/config/_validate_pyproject/NOTICE
|
| 438 |
+
setuptools/config/_validate_pyproject/__init__.py
|
| 439 |
+
setuptools/config/_validate_pyproject/error_reporting.py
|
| 440 |
+
setuptools/config/_validate_pyproject/extra_validations.py
|
| 441 |
+
setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
|
| 442 |
+
setuptools/config/_validate_pyproject/fastjsonschema_validations.py
|
| 443 |
+
setuptools/config/_validate_pyproject/formats.py
|
| 444 |
+
setuptools/tests/__init__.py
|
| 445 |
+
setuptools/tests/contexts.py
|
| 446 |
+
setuptools/tests/environment.py
|
| 447 |
+
setuptools/tests/fixtures.py
|
| 448 |
+
setuptools/tests/mod_with_constant.py
|
| 449 |
+
setuptools/tests/namespaces.py
|
| 450 |
+
setuptools/tests/script-with-bom.py
|
| 451 |
+
setuptools/tests/test_archive_util.py
|
| 452 |
+
setuptools/tests/test_bdist_deprecations.py
|
| 453 |
+
setuptools/tests/test_bdist_egg.py
|
| 454 |
+
setuptools/tests/test_bdist_wheel.py
|
| 455 |
+
setuptools/tests/test_build.py
|
| 456 |
+
setuptools/tests/test_build_clib.py
|
| 457 |
+
setuptools/tests/test_build_ext.py
|
| 458 |
+
setuptools/tests/test_build_meta.py
|
| 459 |
+
setuptools/tests/test_build_py.py
|
| 460 |
+
setuptools/tests/test_config_discovery.py
|
| 461 |
+
setuptools/tests/test_core_metadata.py
|
| 462 |
+
setuptools/tests/test_depends.py
|
| 463 |
+
setuptools/tests/test_develop.py
|
| 464 |
+
setuptools/tests/test_dist.py
|
| 465 |
+
setuptools/tests/test_dist_info.py
|
| 466 |
+
setuptools/tests/test_distutils_adoption.py
|
| 467 |
+
setuptools/tests/test_editable_install.py
|
| 468 |
+
setuptools/tests/test_egg_info.py
|
| 469 |
+
setuptools/tests/test_extern.py
|
| 470 |
+
setuptools/tests/test_find_packages.py
|
| 471 |
+
setuptools/tests/test_find_py_modules.py
|
| 472 |
+
setuptools/tests/test_glob.py
|
| 473 |
+
setuptools/tests/test_install_scripts.py
|
| 474 |
+
setuptools/tests/test_logging.py
|
| 475 |
+
setuptools/tests/test_manifest.py
|
| 476 |
+
setuptools/tests/test_namespaces.py
|
| 477 |
+
setuptools/tests/test_scripts.py
|
| 478 |
+
setuptools/tests/test_sdist.py
|
| 479 |
+
setuptools/tests/test_setopt.py
|
| 480 |
+
setuptools/tests/test_setuptools.py
|
| 481 |
+
setuptools/tests/test_shutil_wrapper.py
|
| 482 |
+
setuptools/tests/test_unicode_utils.py
|
| 483 |
+
setuptools/tests/test_virtualenv.py
|
| 484 |
+
setuptools/tests/test_warnings.py
|
| 485 |
+
setuptools/tests/test_wheel.py
|
| 486 |
+
setuptools/tests/test_windows_wrappers.py
|
| 487 |
+
setuptools/tests/text.py
|
| 488 |
+
setuptools/tests/textwrap.py
|
| 489 |
+
setuptools/tests/compat/__init__.py
|
| 490 |
+
setuptools/tests/compat/py39.py
|
| 491 |
+
setuptools/tests/config/__init__.py
|
| 492 |
+
setuptools/tests/config/setupcfg_examples.txt
|
| 493 |
+
setuptools/tests/config/test_apply_pyprojecttoml.py
|
| 494 |
+
setuptools/tests/config/test_expand.py
|
| 495 |
+
setuptools/tests/config/test_pyprojecttoml.py
|
| 496 |
+
setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py
|
| 497 |
+
setuptools/tests/config/test_setupcfg.py
|
| 498 |
+
setuptools/tests/config/downloads/__init__.py
|
| 499 |
+
setuptools/tests/config/downloads/preload.py
|
| 500 |
+
setuptools/tests/indexes/test_links_priority/external.html
|
| 501 |
+
setuptools/tests/indexes/test_links_priority/simple/foobar/index.html
|
| 502 |
+
setuptools/tests/integration/__init__.py
|
| 503 |
+
setuptools/tests/integration/helpers.py
|
| 504 |
+
setuptools/tests/integration/test_pbr.py
|
| 505 |
+
setuptools/tests/integration/test_pip_install_sdist.py
|
| 506 |
+
tools/build_launchers.py
|
| 507 |
+
tools/finalize.py
|
| 508 |
+
tools/generate_validation_code.py
|
| 509 |
+
tools/vendored.py
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/entry_points.txt
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[distutils.commands]
|
| 2 |
+
alias = setuptools.command.alias:alias
|
| 3 |
+
bdist_egg = setuptools.command.bdist_egg:bdist_egg
|
| 4 |
+
bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm
|
| 5 |
+
bdist_wheel = setuptools.command.bdist_wheel:bdist_wheel
|
| 6 |
+
build = setuptools.command.build:build
|
| 7 |
+
build_clib = setuptools.command.build_clib:build_clib
|
| 8 |
+
build_ext = setuptools.command.build_ext:build_ext
|
| 9 |
+
build_py = setuptools.command.build_py:build_py
|
| 10 |
+
develop = setuptools.command.develop:develop
|
| 11 |
+
dist_info = setuptools.command.dist_info:dist_info
|
| 12 |
+
easy_install = setuptools.command.easy_install:easy_install
|
| 13 |
+
editable_wheel = setuptools.command.editable_wheel:editable_wheel
|
| 14 |
+
egg_info = setuptools.command.egg_info:egg_info
|
| 15 |
+
install = setuptools.command.install:install
|
| 16 |
+
install_egg_info = setuptools.command.install_egg_info:install_egg_info
|
| 17 |
+
install_lib = setuptools.command.install_lib:install_lib
|
| 18 |
+
install_scripts = setuptools.command.install_scripts:install_scripts
|
| 19 |
+
rotate = setuptools.command.rotate:rotate
|
| 20 |
+
saveopts = setuptools.command.saveopts:saveopts
|
| 21 |
+
sdist = setuptools.command.sdist:sdist
|
| 22 |
+
setopt = setuptools.command.setopt:setopt
|
| 23 |
+
|
| 24 |
+
[distutils.setup_keywords]
|
| 25 |
+
dependency_links = setuptools.dist:assert_string_list
|
| 26 |
+
eager_resources = setuptools.dist:assert_string_list
|
| 27 |
+
entry_points = setuptools.dist:check_entry_points
|
| 28 |
+
exclude_package_data = setuptools.dist:check_package_data
|
| 29 |
+
extras_require = setuptools.dist:check_extras
|
| 30 |
+
include_package_data = setuptools.dist:assert_bool
|
| 31 |
+
install_requires = setuptools.dist:check_requirements
|
| 32 |
+
namespace_packages = setuptools.dist:check_nsp
|
| 33 |
+
package_data = setuptools.dist:check_package_data
|
| 34 |
+
packages = setuptools.dist:check_packages
|
| 35 |
+
python_requires = setuptools.dist:check_specifier
|
| 36 |
+
setup_requires = setuptools.dist:check_requirements
|
| 37 |
+
use_2to3 = setuptools.dist:invalid_unless_false
|
| 38 |
+
zip_safe = setuptools.dist:assert_bool
|
| 39 |
+
|
| 40 |
+
[egg_info.writers]
|
| 41 |
+
PKG-INFO = setuptools.command.egg_info:write_pkg_info
|
| 42 |
+
dependency_links.txt = setuptools.command.egg_info:overwrite_arg
|
| 43 |
+
eager_resources.txt = setuptools.command.egg_info:overwrite_arg
|
| 44 |
+
entry_points.txt = setuptools.command.egg_info:write_entries
|
| 45 |
+
namespace_packages.txt = setuptools.command.egg_info:overwrite_arg
|
| 46 |
+
requires.txt = setuptools.command.egg_info:write_requirements
|
| 47 |
+
top_level.txt = setuptools.command.egg_info:write_toplevel_names
|
| 48 |
+
|
| 49 |
+
[setuptools.finalize_distribution_options]
|
| 50 |
+
keywords = setuptools.dist:Distribution._finalize_setup_keywords
|
| 51 |
+
parent_finalize = setuptools.dist:_Distribution.finalize_options
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/requires.txt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
[certs]
|
| 3 |
+
|
| 4 |
+
[check]
|
| 5 |
+
pytest-checkdocs>=2.4
|
| 6 |
+
|
| 7 |
+
[check:sys_platform != "cygwin"]
|
| 8 |
+
pytest-ruff>=0.2.1
|
| 9 |
+
ruff>=0.13.0
|
| 10 |
+
|
| 11 |
+
[core]
|
| 12 |
+
packaging>=24.2
|
| 13 |
+
more_itertools>=8.8
|
| 14 |
+
jaraco.text>=3.7
|
| 15 |
+
wheel>=0.43.0
|
| 16 |
+
jaraco.functools>=4
|
| 17 |
+
more_itertools
|
| 18 |
+
|
| 19 |
+
[core:python_version < "3.10"]
|
| 20 |
+
importlib_metadata>=6
|
| 21 |
+
|
| 22 |
+
[core:python_version < "3.11"]
|
| 23 |
+
tomli>=2.0.1
|
| 24 |
+
|
| 25 |
+
[cover]
|
| 26 |
+
pytest-cov
|
| 27 |
+
|
| 28 |
+
[doc]
|
| 29 |
+
sphinx>=3.5
|
| 30 |
+
jaraco.packaging>=9.3
|
| 31 |
+
rst.linker>=1.9
|
| 32 |
+
furo
|
| 33 |
+
sphinx-lint
|
| 34 |
+
jaraco.tidelift>=1.4
|
| 35 |
+
pygments-github-lexers==0.0.5
|
| 36 |
+
sphinx-favicon
|
| 37 |
+
sphinx-inline-tabs
|
| 38 |
+
sphinx-reredirects
|
| 39 |
+
sphinxcontrib-towncrier
|
| 40 |
+
sphinx-notfound-page<2,>=1
|
| 41 |
+
pyproject-hooks!=1.1
|
| 42 |
+
towncrier<24.7
|
| 43 |
+
|
| 44 |
+
[enabler]
|
| 45 |
+
pytest-enabler>=2.2
|
| 46 |
+
|
| 47 |
+
[ssl]
|
| 48 |
+
|
| 49 |
+
[test]
|
| 50 |
+
pytest!=8.1.*,>=6
|
| 51 |
+
virtualenv>=13.0.0
|
| 52 |
+
wheel>=0.44.0
|
| 53 |
+
pip>=19.1
|
| 54 |
+
packaging>=24.2
|
| 55 |
+
jaraco.envs>=2.2
|
| 56 |
+
pytest-xdist>=3
|
| 57 |
+
jaraco.path>=3.7.2
|
| 58 |
+
build[virtualenv]>=1.0.3
|
| 59 |
+
filelock>=3.4.0
|
| 60 |
+
ini2toml[lite]>=0.14
|
| 61 |
+
tomli-w>=1.0.0
|
| 62 |
+
pytest-timeout
|
| 63 |
+
pytest-home>=0.5
|
| 64 |
+
pytest-subprocess
|
| 65 |
+
pyproject-hooks!=1.1
|
| 66 |
+
jaraco.test>=5.5
|
| 67 |
+
|
| 68 |
+
[test:python_version >= "3.9" and sys_platform != "cygwin"]
|
| 69 |
+
jaraco.develop>=7.21
|
| 70 |
+
|
| 71 |
+
[test:sys_platform != "cygwin"]
|
| 72 |
+
pytest-perf
|
| 73 |
+
|
| 74 |
+
[type]
|
| 75 |
+
pytest-mypy
|
| 76 |
+
mypy==1.18.*
|
| 77 |
+
|
| 78 |
+
[type:python_version < "3.10"]
|
| 79 |
+
importlib_metadata>=7.0.2
|
| 80 |
+
|
| 81 |
+
[type:sys_platform != "cygwin"]
|
| 82 |
+
jaraco.develop>=7.21
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools-82.0.1-py3.10.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_distutils_hack
|
| 2 |
+
setuptools
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/__init__.py
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Extensions to the 'distutils' for large or complex distributions"""
|
| 2 |
+
# mypy: disable_error_code=override
|
| 3 |
+
# Command.reinitialize_command has an extra **kw param that distutils doesn't have
|
| 4 |
+
# Can't disable on the exact line because distutils doesn't exists on Python 3.12
|
| 5 |
+
# and mypy isn't aware of distutils_hack, causing distutils.core.Command to be Any,
|
| 6 |
+
# and a [unused-ignore] to be raised on 3.12+
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import functools
|
| 11 |
+
import os
|
| 12 |
+
import sys
|
| 13 |
+
from abc import abstractmethod
|
| 14 |
+
from collections.abc import Mapping
|
| 15 |
+
from typing import TYPE_CHECKING, TypeVar, overload
|
| 16 |
+
|
| 17 |
+
sys.path.extend(((vendor_path := os.path.join(os.path.dirname(os.path.dirname(__file__)), 'setuptools', '_vendor')) not in sys.path) * [vendor_path]) # fmt: skip
|
| 18 |
+
# workaround for #4476
|
| 19 |
+
sys.modules.pop('backports', None)
|
| 20 |
+
|
| 21 |
+
import _distutils_hack.override # noqa: F401
|
| 22 |
+
|
| 23 |
+
from . import logging, monkey
|
| 24 |
+
from .depends import Require
|
| 25 |
+
from .discovery import PackageFinder, PEP420PackageFinder
|
| 26 |
+
from .dist import Distribution
|
| 27 |
+
from .extension import Extension
|
| 28 |
+
from .version import __version__ as __version__
|
| 29 |
+
from .warnings import SetuptoolsDeprecationWarning
|
| 30 |
+
|
| 31 |
+
import distutils.core
|
| 32 |
+
|
| 33 |
+
__all__ = [
|
| 34 |
+
'setup',
|
| 35 |
+
'Distribution',
|
| 36 |
+
'Command',
|
| 37 |
+
'Extension',
|
| 38 |
+
'Require',
|
| 39 |
+
'SetuptoolsDeprecationWarning',
|
| 40 |
+
'find_packages',
|
| 41 |
+
'find_namespace_packages',
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
_CommandT = TypeVar("_CommandT", bound="_Command")
|
| 45 |
+
|
| 46 |
+
bootstrap_install_from = None
|
| 47 |
+
|
| 48 |
+
find_packages = PackageFinder.find
|
| 49 |
+
find_namespace_packages = PEP420PackageFinder.find
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def _install_setup_requires(attrs):
|
| 53 |
+
# Note: do not use `setuptools.Distribution` directly, as
|
| 54 |
+
# our PEP 517 backend patch `distutils.core.Distribution`.
|
| 55 |
+
class MinimalDistribution(distutils.core.Distribution):
|
| 56 |
+
"""
|
| 57 |
+
A minimal version of a distribution for supporting the
|
| 58 |
+
fetch_build_eggs interface.
|
| 59 |
+
"""
|
| 60 |
+
|
| 61 |
+
def __init__(self, attrs: Mapping[str, object]) -> None:
|
| 62 |
+
_incl = 'dependency_links', 'setup_requires'
|
| 63 |
+
filtered = {k: attrs[k] for k in set(_incl) & set(attrs)}
|
| 64 |
+
super().__init__(filtered)
|
| 65 |
+
# Prevent accidentally triggering discovery with incomplete set of attrs
|
| 66 |
+
self.set_defaults._disable()
|
| 67 |
+
|
| 68 |
+
def _get_project_config_files(self, filenames=None):
|
| 69 |
+
"""Ignore ``pyproject.toml``, they are not related to setup_requires"""
|
| 70 |
+
try:
|
| 71 |
+
cfg, _toml = super()._split_standard_project_metadata(filenames)
|
| 72 |
+
except Exception:
|
| 73 |
+
return filenames, ()
|
| 74 |
+
return cfg, ()
|
| 75 |
+
|
| 76 |
+
def finalize_options(self):
|
| 77 |
+
"""
|
| 78 |
+
Disable finalize_options to avoid building the working set.
|
| 79 |
+
Ref #2158.
|
| 80 |
+
"""
|
| 81 |
+
|
| 82 |
+
dist = MinimalDistribution(attrs)
|
| 83 |
+
|
| 84 |
+
# Honor setup.cfg's options.
|
| 85 |
+
dist.parse_config_files(ignore_option_errors=True)
|
| 86 |
+
if dist.setup_requires:
|
| 87 |
+
_fetch_build_eggs(dist)
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def _fetch_build_eggs(dist: Distribution):
|
| 91 |
+
try:
|
| 92 |
+
dist.fetch_build_eggs(dist.setup_requires)
|
| 93 |
+
except Exception as ex:
|
| 94 |
+
msg = """
|
| 95 |
+
It is possible a package already installed in your system
|
| 96 |
+
contains an version that is invalid according to PEP 440.
|
| 97 |
+
You can try `pip install --use-pep517` as a workaround for this problem,
|
| 98 |
+
or rely on a new virtual environment.
|
| 99 |
+
|
| 100 |
+
If the problem refers to a package that is not installed yet,
|
| 101 |
+
please contact that package's maintainers or distributors.
|
| 102 |
+
"""
|
| 103 |
+
if "InvalidVersion" in ex.__class__.__name__:
|
| 104 |
+
if hasattr(ex, "add_note"):
|
| 105 |
+
ex.add_note(msg) # PEP 678
|
| 106 |
+
else:
|
| 107 |
+
dist.announce(f"\n{msg}\n")
|
| 108 |
+
raise
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def setup(**attrs) -> Distribution:
|
| 112 |
+
logging.configure()
|
| 113 |
+
# Make sure we have any requirements needed to interpret 'attrs'.
|
| 114 |
+
_install_setup_requires(attrs)
|
| 115 |
+
# Override return type of distutils.core.Distribution with setuptools.dist.Distribution
|
| 116 |
+
# (implicitly implemented via `setuptools.monkey.patch_all`).
|
| 117 |
+
return distutils.core.setup(**attrs) # type: ignore[return-value]
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
setup.__doc__ = distutils.core.setup.__doc__
|
| 121 |
+
|
| 122 |
+
if TYPE_CHECKING:
|
| 123 |
+
# Work around a mypy issue where type[T] can't be used as a base: https://github.com/python/mypy/issues/10962
|
| 124 |
+
from distutils.core import Command as _Command
|
| 125 |
+
else:
|
| 126 |
+
_Command = monkey.get_unpatched(distutils.core.Command)
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
class Command(_Command):
|
| 130 |
+
"""
|
| 131 |
+
Setuptools internal actions are organized using a *command design pattern*.
|
| 132 |
+
This means that each action (or group of closely related actions) executed during
|
| 133 |
+
the build should be implemented as a ``Command`` subclass.
|
| 134 |
+
|
| 135 |
+
These commands are abstractions and do not necessarily correspond to a command that
|
| 136 |
+
can (or should) be executed via a terminal, in a CLI fashion (although historically
|
| 137 |
+
they would).
|
| 138 |
+
|
| 139 |
+
When creating a new command from scratch, custom defined classes **SHOULD** inherit
|
| 140 |
+
from ``setuptools.Command`` and implement a few mandatory methods.
|
| 141 |
+
Between these mandatory methods, are listed:
|
| 142 |
+
:meth:`initialize_options`, :meth:`finalize_options` and :meth:`run`.
|
| 143 |
+
|
| 144 |
+
A useful analogy for command classes is to think of them as subroutines with local
|
| 145 |
+
variables called "options". The options are "declared" in :meth:`initialize_options`
|
| 146 |
+
and "defined" (given their final values, aka "finalized") in :meth:`finalize_options`,
|
| 147 |
+
both of which must be defined by every command class. The "body" of the subroutine,
|
| 148 |
+
(where it does all the work) is the :meth:`run` method.
|
| 149 |
+
Between :meth:`initialize_options` and :meth:`finalize_options`, ``setuptools`` may set
|
| 150 |
+
the values for options/attributes based on user's input (or circumstance),
|
| 151 |
+
which means that the implementation should be careful to not overwrite values in
|
| 152 |
+
:meth:`finalize_options` unless necessary.
|
| 153 |
+
|
| 154 |
+
Please note that other commands (or other parts of setuptools) may also overwrite
|
| 155 |
+
the values of the command's options/attributes multiple times during the build
|
| 156 |
+
process.
|
| 157 |
+
Therefore it is important to consistently implement :meth:`initialize_options` and
|
| 158 |
+
:meth:`finalize_options`. For example, all derived attributes (or attributes that
|
| 159 |
+
depend on the value of other attributes) **SHOULD** be recomputed in
|
| 160 |
+
:meth:`finalize_options`.
|
| 161 |
+
|
| 162 |
+
When overwriting existing commands, custom defined classes **MUST** abide by the
|
| 163 |
+
same APIs implemented by the original class. They also **SHOULD** inherit from the
|
| 164 |
+
original class.
|
| 165 |
+
"""
|
| 166 |
+
|
| 167 |
+
command_consumes_arguments = False
|
| 168 |
+
distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
|
| 169 |
+
|
| 170 |
+
dry_run = False # type: ignore[assignment] # pyright: ignore[reportAssignmentType] (until #4689; see #4872)
|
| 171 |
+
"""
|
| 172 |
+
For compatibility with vendored bdist_wheel.
|
| 173 |
+
https://github.com/pypa/setuptools/pull/4872/files#r1986395142
|
| 174 |
+
"""
|
| 175 |
+
|
| 176 |
+
def __init__(self, dist: Distribution, **kw) -> None:
|
| 177 |
+
"""
|
| 178 |
+
Construct the command for dist, updating
|
| 179 |
+
vars(self) with any keyword parameters.
|
| 180 |
+
"""
|
| 181 |
+
super().__init__(dist)
|
| 182 |
+
vars(self).update(kw)
|
| 183 |
+
|
| 184 |
+
@overload
|
| 185 |
+
def reinitialize_command(
|
| 186 |
+
self, command: str, reinit_subcommands: bool = False, **kw
|
| 187 |
+
) -> Command: ... # override distutils.cmd.Command with setuptools.Command
|
| 188 |
+
@overload
|
| 189 |
+
def reinitialize_command(
|
| 190 |
+
self, command: _CommandT, reinit_subcommands: bool = False, **kw
|
| 191 |
+
) -> _CommandT: ...
|
| 192 |
+
def reinitialize_command(
|
| 193 |
+
self, command: str | _Command, reinit_subcommands: bool = False, **kw
|
| 194 |
+
) -> Command | _Command:
|
| 195 |
+
cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
|
| 196 |
+
vars(cmd).update(kw)
|
| 197 |
+
return cmd # pyright: ignore[reportReturnType] # pypa/distutils#307
|
| 198 |
+
|
| 199 |
+
@abstractmethod
|
| 200 |
+
def initialize_options(self) -> None:
|
| 201 |
+
"""
|
| 202 |
+
Set or (reset) all options/attributes/caches used by the command
|
| 203 |
+
to their default values. Note that these values may be overwritten during
|
| 204 |
+
the build.
|
| 205 |
+
"""
|
| 206 |
+
raise NotImplementedError
|
| 207 |
+
|
| 208 |
+
@abstractmethod
|
| 209 |
+
def finalize_options(self) -> None:
|
| 210 |
+
"""
|
| 211 |
+
Set final values for all options/attributes used by the command.
|
| 212 |
+
Most of the time, each option/attribute/cache should only be set if it does not
|
| 213 |
+
have any value yet (e.g. ``if self.attr is None: self.attr = val``).
|
| 214 |
+
"""
|
| 215 |
+
raise NotImplementedError
|
| 216 |
+
|
| 217 |
+
@abstractmethod
|
| 218 |
+
def run(self) -> None:
|
| 219 |
+
"""
|
| 220 |
+
Execute the actions intended by the command.
|
| 221 |
+
(Side effects **SHOULD** only take place when :meth:`run` is executed,
|
| 222 |
+
for example, creating new files or writing to the terminal output).
|
| 223 |
+
"""
|
| 224 |
+
raise NotImplementedError
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
def _find_all_simple(path):
|
| 228 |
+
"""
|
| 229 |
+
Find all files under 'path'
|
| 230 |
+
"""
|
| 231 |
+
results = (
|
| 232 |
+
os.path.join(base, file)
|
| 233 |
+
for base, dirs, files in os.walk(path, followlinks=True)
|
| 234 |
+
for file in files
|
| 235 |
+
)
|
| 236 |
+
return filter(os.path.isfile, results)
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
def findall(dir=os.curdir):
|
| 240 |
+
"""
|
| 241 |
+
Find all files under 'dir' and return the list of full filenames.
|
| 242 |
+
Unless dir is '.', return full filenames with dir prepended.
|
| 243 |
+
"""
|
| 244 |
+
files = _find_all_simple(dir)
|
| 245 |
+
if dir == os.curdir:
|
| 246 |
+
make_rel = functools.partial(os.path.relpath, start=dir)
|
| 247 |
+
files = map(make_rel, files)
|
| 248 |
+
return list(files)
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
class sic(str):
|
| 252 |
+
"""Treat this string as-is (https://en.wikipedia.org/wiki/Sic)"""
|
| 253 |
+
|
| 254 |
+
|
| 255 |
+
# Apply monkey patches
|
| 256 |
+
monkey.patch_all()
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_core_metadata.py
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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://packaging.python.org/en/latest/specifications/core-metadata/
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import os
|
| 10 |
+
import stat
|
| 11 |
+
import textwrap
|
| 12 |
+
from email import message_from_file
|
| 13 |
+
from email.message import Message
|
| 14 |
+
from tempfile import NamedTemporaryFile
|
| 15 |
+
|
| 16 |
+
from packaging.markers import Marker
|
| 17 |
+
from packaging.requirements import Requirement
|
| 18 |
+
from packaging.utils import canonicalize_name, canonicalize_version
|
| 19 |
+
from packaging.version import Version
|
| 20 |
+
|
| 21 |
+
from . import _normalization, _reqs
|
| 22 |
+
from ._static import is_static
|
| 23 |
+
from .warnings import SetuptoolsDeprecationWarning
|
| 24 |
+
|
| 25 |
+
from distutils.util import rfc822_escape
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def get_metadata_version(self):
|
| 29 |
+
mv = getattr(self, 'metadata_version', None)
|
| 30 |
+
if mv is None:
|
| 31 |
+
mv = Version('2.4')
|
| 32 |
+
self.metadata_version = mv
|
| 33 |
+
return mv
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def rfc822_unescape(content: str) -> str:
|
| 37 |
+
"""Reverse RFC-822 escaping by removing leading whitespaces from content."""
|
| 38 |
+
lines = content.splitlines()
|
| 39 |
+
if len(lines) == 1:
|
| 40 |
+
return lines[0].lstrip()
|
| 41 |
+
return '\n'.join((lines[0].lstrip(), textwrap.dedent('\n'.join(lines[1:]))))
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def _read_field_from_msg(msg: Message, field: str) -> str | None:
|
| 45 |
+
"""Read Message header field."""
|
| 46 |
+
value = msg[field]
|
| 47 |
+
if value == 'UNKNOWN':
|
| 48 |
+
return None
|
| 49 |
+
return value
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def _read_field_unescaped_from_msg(msg: Message, field: str) -> str | None:
|
| 53 |
+
"""Read Message header field and apply rfc822_unescape."""
|
| 54 |
+
value = _read_field_from_msg(msg, field)
|
| 55 |
+
if value is None:
|
| 56 |
+
return value
|
| 57 |
+
return rfc822_unescape(value)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def _read_list_from_msg(msg: Message, field: str) -> list[str] | None:
|
| 61 |
+
"""Read Message header field and return all results as list."""
|
| 62 |
+
values = msg.get_all(field, None)
|
| 63 |
+
if values == []:
|
| 64 |
+
return None
|
| 65 |
+
return values
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def _read_payload_from_msg(msg: Message) -> str | None:
|
| 69 |
+
value = str(msg.get_payload()).strip()
|
| 70 |
+
if value == 'UNKNOWN' or not value:
|
| 71 |
+
return None
|
| 72 |
+
return value
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def read_pkg_file(self, file):
|
| 76 |
+
"""Reads the metadata values from a file object."""
|
| 77 |
+
msg = message_from_file(file)
|
| 78 |
+
|
| 79 |
+
self.metadata_version = Version(msg['metadata-version'])
|
| 80 |
+
self.name = _read_field_from_msg(msg, 'name')
|
| 81 |
+
self.version = _read_field_from_msg(msg, 'version')
|
| 82 |
+
self.description = _read_field_from_msg(msg, 'summary')
|
| 83 |
+
# we are filling author only.
|
| 84 |
+
self.author = _read_field_from_msg(msg, 'author')
|
| 85 |
+
self.maintainer = None
|
| 86 |
+
self.author_email = _read_field_from_msg(msg, 'author-email')
|
| 87 |
+
self.maintainer_email = None
|
| 88 |
+
self.url = _read_field_from_msg(msg, 'home-page')
|
| 89 |
+
self.download_url = _read_field_from_msg(msg, 'download-url')
|
| 90 |
+
self.license = _read_field_unescaped_from_msg(msg, 'license')
|
| 91 |
+
self.license_expression = _read_field_unescaped_from_msg(msg, 'license-expression')
|
| 92 |
+
|
| 93 |
+
self.long_description = _read_field_unescaped_from_msg(msg, 'description')
|
| 94 |
+
if self.long_description is None and self.metadata_version >= Version('2.1'):
|
| 95 |
+
self.long_description = _read_payload_from_msg(msg)
|
| 96 |
+
self.description = _read_field_from_msg(msg, 'summary')
|
| 97 |
+
|
| 98 |
+
if 'keywords' in msg:
|
| 99 |
+
self.keywords = _read_field_from_msg(msg, 'keywords').split(',')
|
| 100 |
+
|
| 101 |
+
self.platforms = _read_list_from_msg(msg, 'platform')
|
| 102 |
+
self.classifiers = _read_list_from_msg(msg, 'classifier')
|
| 103 |
+
|
| 104 |
+
# PEP 314 - these fields only exist in 1.1
|
| 105 |
+
if self.metadata_version == Version('1.1'):
|
| 106 |
+
self.requires = _read_list_from_msg(msg, 'requires')
|
| 107 |
+
self.provides = _read_list_from_msg(msg, 'provides')
|
| 108 |
+
self.obsoletes = _read_list_from_msg(msg, 'obsoletes')
|
| 109 |
+
else:
|
| 110 |
+
self.requires = None
|
| 111 |
+
self.provides = None
|
| 112 |
+
self.obsoletes = None
|
| 113 |
+
|
| 114 |
+
self.license_files = _read_list_from_msg(msg, 'license-file')
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def single_line(val):
|
| 118 |
+
"""
|
| 119 |
+
Quick and dirty validation for Summary pypa/setuptools#1390.
|
| 120 |
+
"""
|
| 121 |
+
if '\n' in val:
|
| 122 |
+
# TODO: Replace with `raise ValueError("newlines not allowed")`
|
| 123 |
+
# after reviewing #2893.
|
| 124 |
+
msg = "newlines are not allowed in `summary` and will break in the future"
|
| 125 |
+
SetuptoolsDeprecationWarning.emit("Invalid config.", msg)
|
| 126 |
+
# due_date is undefined. Controversial change, there was a lot of push back.
|
| 127 |
+
val = val.strip().split('\n')[0]
|
| 128 |
+
return val
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
def write_pkg_info(self, base_dir):
|
| 132 |
+
"""Write the PKG-INFO file into the release tree."""
|
| 133 |
+
temp = ""
|
| 134 |
+
final = os.path.join(base_dir, 'PKG-INFO')
|
| 135 |
+
try:
|
| 136 |
+
# Use a temporary file while writing to avoid race conditions
|
| 137 |
+
# (e.g. `importlib.metadata` reading `.egg-info/PKG-INFO`):
|
| 138 |
+
with NamedTemporaryFile("w", encoding="utf-8", dir=base_dir, delete=False) as f:
|
| 139 |
+
temp = f.name
|
| 140 |
+
self.write_pkg_file(f)
|
| 141 |
+
permissions = stat.S_IMODE(os.lstat(temp).st_mode)
|
| 142 |
+
os.chmod(temp, permissions | stat.S_IRGRP | stat.S_IROTH)
|
| 143 |
+
os.replace(temp, final) # atomic operation.
|
| 144 |
+
finally:
|
| 145 |
+
if temp and os.path.exists(temp):
|
| 146 |
+
os.remove(temp)
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
# Based on Python 3.5 version
|
| 150 |
+
def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME
|
| 151 |
+
"""Write the PKG-INFO format data to a file object."""
|
| 152 |
+
version = self.get_metadata_version()
|
| 153 |
+
|
| 154 |
+
def write_field(key, value):
|
| 155 |
+
file.write(f"{key}: {value}\n")
|
| 156 |
+
|
| 157 |
+
write_field('Metadata-Version', str(version))
|
| 158 |
+
write_field('Name', self.get_name())
|
| 159 |
+
write_field('Version', self.get_version())
|
| 160 |
+
|
| 161 |
+
summary = self.get_description()
|
| 162 |
+
if summary:
|
| 163 |
+
write_field('Summary', single_line(summary))
|
| 164 |
+
|
| 165 |
+
optional_fields = (
|
| 166 |
+
('Home-page', 'url'),
|
| 167 |
+
('Download-URL', 'download_url'),
|
| 168 |
+
('Author', 'author'),
|
| 169 |
+
('Author-email', 'author_email'),
|
| 170 |
+
('Maintainer', 'maintainer'),
|
| 171 |
+
('Maintainer-email', 'maintainer_email'),
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
for field, attr in optional_fields:
|
| 175 |
+
attr_val = getattr(self, attr, None)
|
| 176 |
+
if attr_val is not None:
|
| 177 |
+
write_field(field, attr_val)
|
| 178 |
+
|
| 179 |
+
if license_expression := self.license_expression:
|
| 180 |
+
write_field('License-Expression', license_expression)
|
| 181 |
+
elif license := self.get_license():
|
| 182 |
+
write_field('License', rfc822_escape(license))
|
| 183 |
+
|
| 184 |
+
for label, url in self.project_urls.items():
|
| 185 |
+
write_field('Project-URL', f'{label}, {url}')
|
| 186 |
+
|
| 187 |
+
keywords = ','.join(self.get_keywords())
|
| 188 |
+
if keywords:
|
| 189 |
+
write_field('Keywords', keywords)
|
| 190 |
+
|
| 191 |
+
platforms = self.get_platforms() or []
|
| 192 |
+
for platform in platforms:
|
| 193 |
+
write_field('Platform', platform)
|
| 194 |
+
|
| 195 |
+
self._write_list(file, 'Classifier', self.get_classifiers())
|
| 196 |
+
|
| 197 |
+
# PEP 314
|
| 198 |
+
self._write_list(file, 'Requires', self.get_requires())
|
| 199 |
+
self._write_list(file, 'Provides', self.get_provides())
|
| 200 |
+
self._write_list(file, 'Obsoletes', self.get_obsoletes())
|
| 201 |
+
|
| 202 |
+
# Setuptools specific for PEP 345
|
| 203 |
+
if hasattr(self, 'python_requires'):
|
| 204 |
+
write_field('Requires-Python', self.python_requires)
|
| 205 |
+
|
| 206 |
+
# PEP 566
|
| 207 |
+
if self.long_description_content_type:
|
| 208 |
+
write_field('Description-Content-Type', self.long_description_content_type)
|
| 209 |
+
|
| 210 |
+
safe_license_files = map(_safe_license_file, self.license_files or [])
|
| 211 |
+
self._write_list(file, 'License-File', safe_license_files)
|
| 212 |
+
_write_requirements(self, file)
|
| 213 |
+
|
| 214 |
+
for field, attr in _POSSIBLE_DYNAMIC_FIELDS.items():
|
| 215 |
+
if (val := getattr(self, attr, None)) and not is_static(val):
|
| 216 |
+
write_field('Dynamic', field)
|
| 217 |
+
|
| 218 |
+
long_description = self.get_long_description()
|
| 219 |
+
if long_description:
|
| 220 |
+
file.write(f"\n{long_description}")
|
| 221 |
+
if not long_description.endswith("\n"):
|
| 222 |
+
file.write("\n")
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
def _write_requirements(self, file):
|
| 226 |
+
for req in _reqs.parse(self.install_requires):
|
| 227 |
+
file.write(f"Requires-Dist: {req}\n")
|
| 228 |
+
|
| 229 |
+
processed_extras = {}
|
| 230 |
+
for augmented_extra, reqs in self.extras_require.items():
|
| 231 |
+
# Historically, setuptools allows "augmented extras": `<extra>:<condition>`
|
| 232 |
+
unsafe_extra, _, condition = augmented_extra.partition(":")
|
| 233 |
+
unsafe_extra = unsafe_extra.strip()
|
| 234 |
+
extra = _normalization.safe_extra(unsafe_extra)
|
| 235 |
+
|
| 236 |
+
if extra:
|
| 237 |
+
_write_provides_extra(file, processed_extras, extra, unsafe_extra)
|
| 238 |
+
for req in _reqs.parse_strings(reqs):
|
| 239 |
+
r = _include_extra(req, extra, condition.strip())
|
| 240 |
+
file.write(f"Requires-Dist: {r}\n")
|
| 241 |
+
|
| 242 |
+
return processed_extras
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def _include_extra(req: str, extra: str, condition: str) -> Requirement:
|
| 246 |
+
r = Requirement(req) # create a fresh object that can be modified
|
| 247 |
+
parts = (
|
| 248 |
+
f"({r.marker})" if r.marker else None,
|
| 249 |
+
f"({condition})" if condition else None,
|
| 250 |
+
f"extra == {extra!r}" if extra else None,
|
| 251 |
+
)
|
| 252 |
+
r.marker = Marker(" and ".join(x for x in parts if x))
|
| 253 |
+
return r
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
def _write_provides_extra(file, processed_extras, safe, unsafe):
|
| 257 |
+
previous = processed_extras.get(safe)
|
| 258 |
+
if previous == unsafe:
|
| 259 |
+
SetuptoolsDeprecationWarning.emit(
|
| 260 |
+
'Ambiguity during "extra" normalization for dependencies.',
|
| 261 |
+
f"""
|
| 262 |
+
{previous!r} and {unsafe!r} normalize to the same value:\n
|
| 263 |
+
{safe!r}\n
|
| 264 |
+
In future versions, setuptools might halt the build process.
|
| 265 |
+
""",
|
| 266 |
+
see_url="https://peps.python.org/pep-0685/",
|
| 267 |
+
)
|
| 268 |
+
else:
|
| 269 |
+
processed_extras[safe] = unsafe
|
| 270 |
+
file.write(f"Provides-Extra: {safe}\n")
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
# from pypa/distutils#244; needed only until that logic is always available
|
| 274 |
+
def get_fullname(self):
|
| 275 |
+
return _distribution_fullname(self.get_name(), self.get_version())
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
def _distribution_fullname(name: str, version: str) -> str:
|
| 279 |
+
"""
|
| 280 |
+
>>> _distribution_fullname('setup.tools', '1.0-2')
|
| 281 |
+
'setup_tools-1.0.post2'
|
| 282 |
+
>>> _distribution_fullname('setup-tools', '1.2post2')
|
| 283 |
+
'setup_tools-1.2.post2'
|
| 284 |
+
>>> _distribution_fullname('setup-tools', '1.0-r2')
|
| 285 |
+
'setup_tools-1.0.post2'
|
| 286 |
+
>>> _distribution_fullname('setup.tools', '1.0.post')
|
| 287 |
+
'setup_tools-1.0.post0'
|
| 288 |
+
>>> _distribution_fullname('setup.tools', '1.0+ubuntu-1')
|
| 289 |
+
'setup_tools-1.0+ubuntu.1'
|
| 290 |
+
"""
|
| 291 |
+
return "{}-{}".format(
|
| 292 |
+
canonicalize_name(name).replace('-', '_'),
|
| 293 |
+
canonicalize_version(version, strip_trailing_zero=False),
|
| 294 |
+
)
|
| 295 |
+
|
| 296 |
+
|
| 297 |
+
def _safe_license_file(file):
|
| 298 |
+
# XXX: Do we need this after the deprecation discussed in #4892, #4896??
|
| 299 |
+
normalized = os.path.normpath(file).replace(os.sep, "/")
|
| 300 |
+
if "../" in normalized:
|
| 301 |
+
return os.path.basename(normalized) # Temporarily restore pre PEP639 behaviour
|
| 302 |
+
return normalized
|
| 303 |
+
|
| 304 |
+
|
| 305 |
+
_POSSIBLE_DYNAMIC_FIELDS = {
|
| 306 |
+
# Core Metadata Field x related Distribution attribute
|
| 307 |
+
"author": "author",
|
| 308 |
+
"author-email": "author_email",
|
| 309 |
+
"classifier": "classifiers",
|
| 310 |
+
"description": "long_description",
|
| 311 |
+
"description-content-type": "long_description_content_type",
|
| 312 |
+
"download-url": "download_url",
|
| 313 |
+
"home-page": "url",
|
| 314 |
+
"keywords": "keywords",
|
| 315 |
+
"license": "license",
|
| 316 |
+
# XXX: License-File is complicated because the user gives globs that are expanded
|
| 317 |
+
# during the build. Without special handling it is likely always
|
| 318 |
+
# marked as Dynamic, which is an acceptable outcome according to:
|
| 319 |
+
# https://github.com/pypa/setuptools/issues/4629#issuecomment-2331233677
|
| 320 |
+
"license-file": "license_files",
|
| 321 |
+
"license-expression": "license_expression", # PEP 639
|
| 322 |
+
"maintainer": "maintainer",
|
| 323 |
+
"maintainer-email": "maintainer_email",
|
| 324 |
+
"obsoletes": "obsoletes",
|
| 325 |
+
# "obsoletes-dist": "obsoletes_dist", # NOT USED
|
| 326 |
+
"platform": "platforms",
|
| 327 |
+
"project-url": "project_urls",
|
| 328 |
+
"provides": "provides",
|
| 329 |
+
# "provides-dist": "provides_dist", # NOT USED
|
| 330 |
+
"provides-extra": "extras_require",
|
| 331 |
+
"requires": "requires",
|
| 332 |
+
"requires-dist": "install_requires",
|
| 333 |
+
# "requires-external": "requires_external", # NOT USED
|
| 334 |
+
"requires-python": "python_requires",
|
| 335 |
+
"summary": "description",
|
| 336 |
+
# "supported-platform": "supported_platforms", # NOT USED
|
| 337 |
+
}
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_discovery.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import functools
|
| 2 |
+
import operator
|
| 3 |
+
|
| 4 |
+
import packaging.requirements
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
# from coherent.build.discovery
|
| 8 |
+
def extras_from_dep(dep):
|
| 9 |
+
try:
|
| 10 |
+
markers = packaging.requirements.Requirement(dep).marker._markers
|
| 11 |
+
except AttributeError:
|
| 12 |
+
markers = ()
|
| 13 |
+
return set(
|
| 14 |
+
marker[2].value
|
| 15 |
+
for marker in markers
|
| 16 |
+
if isinstance(marker, tuple) and marker[0].value == 'extra'
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def extras_from_deps(deps):
|
| 21 |
+
"""
|
| 22 |
+
>>> extras_from_deps(['requests'])
|
| 23 |
+
set()
|
| 24 |
+
>>> extras_from_deps(['pytest; extra == "test"'])
|
| 25 |
+
{'test'}
|
| 26 |
+
>>> sorted(extras_from_deps([
|
| 27 |
+
... 'requests',
|
| 28 |
+
... 'pytest; extra == "test"',
|
| 29 |
+
... 'pytest-cov; extra == "test"',
|
| 30 |
+
... 'sphinx; extra=="doc"']))
|
| 31 |
+
['doc', 'test']
|
| 32 |
+
"""
|
| 33 |
+
return functools.reduce(operator.or_, map(extras_from_dep, deps), set())
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import importlib
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
__version__, _, _ = sys.version.partition(' ')
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
try:
|
| 8 |
+
# Allow Debian and pkgsrc (only) to customize system
|
| 9 |
+
# behavior. Ref pypa/distutils#2 and pypa/distutils#16.
|
| 10 |
+
# This hook is deprecated and no other environments
|
| 11 |
+
# should use it.
|
| 12 |
+
importlib.import_module('_distutils_system_mod')
|
| 13 |
+
except ImportError:
|
| 14 |
+
pass
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_log.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import logging
|
| 2 |
+
|
| 3 |
+
log = logging.getLogger()
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_macos_compat.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import importlib
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def bypass_compiler_fixup(cmd, args):
|
| 6 |
+
return cmd
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
if sys.platform == 'darwin':
|
| 10 |
+
compiler_fixup = importlib.import_module('_osx_support').compiler_fixup
|
| 11 |
+
else:
|
| 12 |
+
compiler_fixup = bypass_compiler_fixup
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_modified.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Timestamp comparison of files and groups of files."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import functools
|
| 6 |
+
import os.path
|
| 7 |
+
from collections.abc import Callable, Iterable
|
| 8 |
+
from typing import Literal, TypeVar
|
| 9 |
+
|
| 10 |
+
from jaraco.functools import splat
|
| 11 |
+
|
| 12 |
+
from .compat.py39 import zip_strict
|
| 13 |
+
from .errors import DistutilsFileError
|
| 14 |
+
|
| 15 |
+
_SourcesT = TypeVar(
|
| 16 |
+
"_SourcesT", bound="str | bytes | os.PathLike[str] | os.PathLike[bytes]"
|
| 17 |
+
)
|
| 18 |
+
_TargetsT = TypeVar(
|
| 19 |
+
"_TargetsT", bound="str | bytes | os.PathLike[str] | os.PathLike[bytes]"
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def _newer(source, target):
|
| 24 |
+
return not os.path.exists(target) or (
|
| 25 |
+
os.path.getmtime(source) > os.path.getmtime(target)
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def newer(
|
| 30 |
+
source: str | bytes | os.PathLike[str] | os.PathLike[bytes],
|
| 31 |
+
target: str | bytes | os.PathLike[str] | os.PathLike[bytes],
|
| 32 |
+
) -> bool:
|
| 33 |
+
"""
|
| 34 |
+
Is source modified more recently than target.
|
| 35 |
+
|
| 36 |
+
Returns True if 'source' is modified more recently than
|
| 37 |
+
'target' or if 'target' does not exist.
|
| 38 |
+
|
| 39 |
+
Raises DistutilsFileError if 'source' does not exist.
|
| 40 |
+
"""
|
| 41 |
+
if not os.path.exists(source):
|
| 42 |
+
raise DistutilsFileError(f"file {os.path.abspath(source)!r} does not exist")
|
| 43 |
+
|
| 44 |
+
return _newer(source, target)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def newer_pairwise(
|
| 48 |
+
sources: Iterable[_SourcesT],
|
| 49 |
+
targets: Iterable[_TargetsT],
|
| 50 |
+
newer: Callable[[_SourcesT, _TargetsT], bool] = newer,
|
| 51 |
+
) -> tuple[list[_SourcesT], list[_TargetsT]]:
|
| 52 |
+
"""
|
| 53 |
+
Filter filenames where sources are newer than targets.
|
| 54 |
+
|
| 55 |
+
Walk two filename iterables in parallel, testing if each source is newer
|
| 56 |
+
than its corresponding target. Returns a pair of lists (sources,
|
| 57 |
+
targets) where source is newer than target, according to the semantics
|
| 58 |
+
of 'newer()'.
|
| 59 |
+
"""
|
| 60 |
+
newer_pairs = filter(splat(newer), zip_strict(sources, targets))
|
| 61 |
+
return tuple(map(list, zip(*newer_pairs))) or ([], [])
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def newer_group(
|
| 65 |
+
sources: Iterable[str | bytes | os.PathLike[str] | os.PathLike[bytes]],
|
| 66 |
+
target: str | bytes | os.PathLike[str] | os.PathLike[bytes],
|
| 67 |
+
missing: Literal["error", "ignore", "newer"] = "error",
|
| 68 |
+
) -> bool:
|
| 69 |
+
"""
|
| 70 |
+
Is target out-of-date with respect to any file in sources.
|
| 71 |
+
|
| 72 |
+
Return True if 'target' is out-of-date with respect to any file
|
| 73 |
+
listed in 'sources'. In other words, if 'target' exists and is newer
|
| 74 |
+
than every file in 'sources', return False; otherwise return True.
|
| 75 |
+
``missing`` controls how to handle a missing source file:
|
| 76 |
+
|
| 77 |
+
- error (default): allow the ``stat()`` call to fail.
|
| 78 |
+
- ignore: silently disregard any missing source files.
|
| 79 |
+
- newer: treat missing source files as "target out of date". This
|
| 80 |
+
mode is handy in "dry-run" mode: it will pretend to carry out
|
| 81 |
+
commands that wouldn't work because inputs are missing, but
|
| 82 |
+
that doesn't matter because dry-run won't run the commands.
|
| 83 |
+
"""
|
| 84 |
+
|
| 85 |
+
def missing_as_newer(source):
|
| 86 |
+
return missing == 'newer' and not os.path.exists(source)
|
| 87 |
+
|
| 88 |
+
ignored = os.path.exists if missing == 'ignore' else None
|
| 89 |
+
return not os.path.exists(target) or any(
|
| 90 |
+
missing_as_newer(source) or _newer(source, target)
|
| 91 |
+
for source in filter(ignored, sources)
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
newer_pairwise_group = functools.partial(newer_pairwise, newer=newer_group)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/_msvccompiler.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import warnings
|
| 2 |
+
|
| 3 |
+
from .compilers.C import msvc
|
| 4 |
+
|
| 5 |
+
__all__ = ["MSVCCompiler"]
|
| 6 |
+
|
| 7 |
+
MSVCCompiler = msvc.Compiler
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def __getattr__(name):
|
| 11 |
+
if name == '_get_vc_env':
|
| 12 |
+
warnings.warn(
|
| 13 |
+
"_get_vc_env is private; find an alternative (pypa/distutils#340)"
|
| 14 |
+
)
|
| 15 |
+
return msvc._get_vc_env
|
| 16 |
+
raise AttributeError(name)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/archive_util.py
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.archive_util
|
| 2 |
+
|
| 3 |
+
Utility functions for creating archive files (tarballs, zip files,
|
| 4 |
+
that sort of thing)."""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
from typing import Literal, overload
|
| 10 |
+
|
| 11 |
+
try:
|
| 12 |
+
import zipfile
|
| 13 |
+
except ImportError:
|
| 14 |
+
zipfile = None
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
from ._log import log
|
| 18 |
+
from .dir_util import mkpath
|
| 19 |
+
from .errors import DistutilsExecError
|
| 20 |
+
from .spawn import spawn
|
| 21 |
+
|
| 22 |
+
try:
|
| 23 |
+
from pwd import getpwnam
|
| 24 |
+
except ImportError:
|
| 25 |
+
getpwnam = None
|
| 26 |
+
|
| 27 |
+
try:
|
| 28 |
+
from grp import getgrnam
|
| 29 |
+
except ImportError:
|
| 30 |
+
getgrnam = None
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def _get_gid(name):
|
| 34 |
+
"""Returns a gid, given a group name."""
|
| 35 |
+
if getgrnam is None or name is None:
|
| 36 |
+
return None
|
| 37 |
+
try:
|
| 38 |
+
result = getgrnam(name)
|
| 39 |
+
except KeyError:
|
| 40 |
+
result = None
|
| 41 |
+
if result is not None:
|
| 42 |
+
return result[2]
|
| 43 |
+
return None
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def _get_uid(name):
|
| 47 |
+
"""Returns an uid, given a user name."""
|
| 48 |
+
if getpwnam is None or name is None:
|
| 49 |
+
return None
|
| 50 |
+
try:
|
| 51 |
+
result = getpwnam(name)
|
| 52 |
+
except KeyError:
|
| 53 |
+
result = None
|
| 54 |
+
if result is not None:
|
| 55 |
+
return result[2]
|
| 56 |
+
return None
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def make_tarball(
|
| 60 |
+
base_name: str,
|
| 61 |
+
base_dir: str | os.PathLike[str],
|
| 62 |
+
compress: Literal["gzip", "bzip2", "xz"] | None = "gzip",
|
| 63 |
+
verbose: bool = False,
|
| 64 |
+
owner: str | None = None,
|
| 65 |
+
group: str | None = None,
|
| 66 |
+
) -> str:
|
| 67 |
+
"""Create a (possibly compressed) tar file from all the files under
|
| 68 |
+
'base_dir'.
|
| 69 |
+
|
| 70 |
+
'compress' must be "gzip" (the default), "bzip2", "xz", or None.
|
| 71 |
+
|
| 72 |
+
'owner' and 'group' can be used to define an owner and a group for the
|
| 73 |
+
archive that is being built. If not provided, the current owner and group
|
| 74 |
+
will be used.
|
| 75 |
+
|
| 76 |
+
The output tar file will be named 'base_dir' + ".tar", possibly plus
|
| 77 |
+
the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").
|
| 78 |
+
|
| 79 |
+
Returns the output filename.
|
| 80 |
+
"""
|
| 81 |
+
tar_compression = {
|
| 82 |
+
'gzip': 'gz',
|
| 83 |
+
'bzip2': 'bz2',
|
| 84 |
+
'xz': 'xz',
|
| 85 |
+
None: '',
|
| 86 |
+
}
|
| 87 |
+
compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'xz': '.xz'}
|
| 88 |
+
|
| 89 |
+
# flags for compression program, each element of list will be an argument
|
| 90 |
+
if compress is not None and compress not in compress_ext.keys():
|
| 91 |
+
raise ValueError(
|
| 92 |
+
"bad value for 'compress': must be None, 'gzip', 'bzip2', 'xz'"
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
archive_name = base_name + '.tar'
|
| 96 |
+
archive_name += compress_ext.get(compress, '')
|
| 97 |
+
|
| 98 |
+
mkpath(os.path.dirname(archive_name))
|
| 99 |
+
|
| 100 |
+
# creating the tarball
|
| 101 |
+
import tarfile # late import so Python build itself doesn't break
|
| 102 |
+
|
| 103 |
+
log.info('Creating tar archive')
|
| 104 |
+
|
| 105 |
+
uid = _get_uid(owner)
|
| 106 |
+
gid = _get_gid(group)
|
| 107 |
+
|
| 108 |
+
def _set_uid_gid(tarinfo):
|
| 109 |
+
if gid is not None:
|
| 110 |
+
tarinfo.gid = gid
|
| 111 |
+
tarinfo.gname = group
|
| 112 |
+
if uid is not None:
|
| 113 |
+
tarinfo.uid = uid
|
| 114 |
+
tarinfo.uname = owner
|
| 115 |
+
return tarinfo
|
| 116 |
+
|
| 117 |
+
tar = tarfile.open(archive_name, f'w|{tar_compression[compress]}')
|
| 118 |
+
try:
|
| 119 |
+
tar.add(base_dir, filter=_set_uid_gid)
|
| 120 |
+
finally:
|
| 121 |
+
tar.close()
|
| 122 |
+
|
| 123 |
+
return archive_name
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def make_zipfile(
|
| 127 |
+
base_name: str,
|
| 128 |
+
base_dir: str | os.PathLike[str],
|
| 129 |
+
verbose: bool = False,
|
| 130 |
+
) -> str:
|
| 131 |
+
"""Create a zip file from all the files under 'base_dir'.
|
| 132 |
+
|
| 133 |
+
The output zip file will be named 'base_name' + ".zip". Uses either the
|
| 134 |
+
"zipfile" Python module (if available) or the InfoZIP "zip" utility
|
| 135 |
+
(if installed and found on the default search path). If neither tool is
|
| 136 |
+
available, raises DistutilsExecError. Returns the name of the output zip
|
| 137 |
+
file.
|
| 138 |
+
"""
|
| 139 |
+
zip_filename = base_name + ".zip"
|
| 140 |
+
mkpath(os.path.dirname(zip_filename))
|
| 141 |
+
|
| 142 |
+
# If zipfile module is not available, try spawning an external
|
| 143 |
+
# 'zip' command.
|
| 144 |
+
if zipfile is None:
|
| 145 |
+
if verbose:
|
| 146 |
+
zipoptions = "-r"
|
| 147 |
+
else:
|
| 148 |
+
zipoptions = "-rq"
|
| 149 |
+
|
| 150 |
+
try:
|
| 151 |
+
spawn(["zip", zipoptions, zip_filename, base_dir])
|
| 152 |
+
except DistutilsExecError:
|
| 153 |
+
# XXX really should distinguish between "couldn't find
|
| 154 |
+
# external 'zip' command" and "zip failed".
|
| 155 |
+
raise DistutilsExecError(
|
| 156 |
+
f"unable to create zip file '{zip_filename}': "
|
| 157 |
+
"could neither import the 'zipfile' module nor "
|
| 158 |
+
"find a standalone zip utility"
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
else:
|
| 162 |
+
log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir)
|
| 163 |
+
|
| 164 |
+
try:
|
| 165 |
+
zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_DEFLATED)
|
| 166 |
+
except RuntimeError:
|
| 167 |
+
zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_STORED)
|
| 168 |
+
|
| 169 |
+
with zip:
|
| 170 |
+
if base_dir != os.curdir:
|
| 171 |
+
path = os.path.normpath(os.path.join(base_dir, ''))
|
| 172 |
+
zip.write(path, path)
|
| 173 |
+
log.info("adding '%s'", path)
|
| 174 |
+
for dirpath, dirnames, filenames in os.walk(base_dir):
|
| 175 |
+
for name in dirnames:
|
| 176 |
+
path = os.path.normpath(os.path.join(dirpath, name, ''))
|
| 177 |
+
zip.write(path, path)
|
| 178 |
+
log.info("adding '%s'", path)
|
| 179 |
+
for name in filenames:
|
| 180 |
+
path = os.path.normpath(os.path.join(dirpath, name))
|
| 181 |
+
if os.path.isfile(path):
|
| 182 |
+
zip.write(path, path)
|
| 183 |
+
log.info("adding '%s'", path)
|
| 184 |
+
|
| 185 |
+
return zip_filename
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
ARCHIVE_FORMATS = {
|
| 189 |
+
'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"),
|
| 190 |
+
'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"),
|
| 191 |
+
'xztar': (make_tarball, [('compress', 'xz')], "xz'ed tar-file"),
|
| 192 |
+
'ztar': (make_tarball, [('compress', 'compress')], "compressed tar file"),
|
| 193 |
+
'tar': (make_tarball, [('compress', None)], "uncompressed tar file"),
|
| 194 |
+
'zip': (make_zipfile, [], "ZIP file"),
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
def check_archive_formats(formats):
|
| 199 |
+
"""Returns the first format from the 'format' list that is unknown.
|
| 200 |
+
|
| 201 |
+
If all formats are known, returns None
|
| 202 |
+
"""
|
| 203 |
+
for format in formats:
|
| 204 |
+
if format not in ARCHIVE_FORMATS:
|
| 205 |
+
return format
|
| 206 |
+
return None
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
@overload
|
| 210 |
+
def make_archive(
|
| 211 |
+
base_name: str,
|
| 212 |
+
format: str,
|
| 213 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes] | None = None,
|
| 214 |
+
base_dir: str | None = None,
|
| 215 |
+
verbose: bool = False,
|
| 216 |
+
owner: str | None = None,
|
| 217 |
+
group: str | None = None,
|
| 218 |
+
) -> str: ...
|
| 219 |
+
@overload
|
| 220 |
+
def make_archive(
|
| 221 |
+
base_name: str | os.PathLike[str],
|
| 222 |
+
format: str,
|
| 223 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 224 |
+
base_dir: str | None = None,
|
| 225 |
+
verbose: bool = False,
|
| 226 |
+
owner: str | None = None,
|
| 227 |
+
group: str | None = None,
|
| 228 |
+
) -> str: ...
|
| 229 |
+
def make_archive(
|
| 230 |
+
base_name: str | os.PathLike[str],
|
| 231 |
+
format: str,
|
| 232 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes] | None = None,
|
| 233 |
+
base_dir: str | None = None,
|
| 234 |
+
verbose: bool = False,
|
| 235 |
+
owner: str | None = None,
|
| 236 |
+
group: str | None = None,
|
| 237 |
+
) -> str:
|
| 238 |
+
"""Create an archive file (eg. zip or tar).
|
| 239 |
+
|
| 240 |
+
'base_name' is the name of the file to create, minus any format-specific
|
| 241 |
+
extension; 'format' is the archive format: one of "zip", "tar", "gztar",
|
| 242 |
+
"bztar", "xztar", or "ztar".
|
| 243 |
+
|
| 244 |
+
'root_dir' is a directory that will be the root directory of the
|
| 245 |
+
archive; ie. we typically chdir into 'root_dir' before creating the
|
| 246 |
+
archive. 'base_dir' is the directory where we start archiving from;
|
| 247 |
+
ie. 'base_dir' will be the common prefix of all files and
|
| 248 |
+
directories in the archive. 'root_dir' and 'base_dir' both default
|
| 249 |
+
to the current directory. Returns the name of the archive file.
|
| 250 |
+
|
| 251 |
+
'owner' and 'group' are used when creating a tar archive. By default,
|
| 252 |
+
uses the current owner and group.
|
| 253 |
+
"""
|
| 254 |
+
save_cwd = os.getcwd()
|
| 255 |
+
if root_dir is not None:
|
| 256 |
+
log.debug("changing into '%s'", root_dir)
|
| 257 |
+
base_name = os.path.abspath(base_name)
|
| 258 |
+
os.chdir(root_dir)
|
| 259 |
+
|
| 260 |
+
if base_dir is None:
|
| 261 |
+
base_dir = os.curdir
|
| 262 |
+
|
| 263 |
+
kwargs: dict[str, bool | None] = {}
|
| 264 |
+
|
| 265 |
+
try:
|
| 266 |
+
format_info = ARCHIVE_FORMATS[format]
|
| 267 |
+
except KeyError:
|
| 268 |
+
raise ValueError(f"unknown archive format '{format}'")
|
| 269 |
+
|
| 270 |
+
func = format_info[0]
|
| 271 |
+
kwargs.update(format_info[1])
|
| 272 |
+
|
| 273 |
+
if format != 'zip':
|
| 274 |
+
kwargs['owner'] = owner
|
| 275 |
+
kwargs['group'] = group
|
| 276 |
+
|
| 277 |
+
try:
|
| 278 |
+
filename = func(base_name, base_dir, **kwargs)
|
| 279 |
+
finally:
|
| 280 |
+
if root_dir is not None:
|
| 281 |
+
log.debug("changing back to '%s'", save_cwd)
|
| 282 |
+
os.chdir(save_cwd)
|
| 283 |
+
|
| 284 |
+
return filename
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/ccompiler.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .compat.numpy import ( # noqa: F401
|
| 2 |
+
_default_compilers,
|
| 3 |
+
compiler_class,
|
| 4 |
+
)
|
| 5 |
+
from .compilers.C import base
|
| 6 |
+
from .compilers.C.base import (
|
| 7 |
+
gen_lib_options,
|
| 8 |
+
gen_preprocess_options,
|
| 9 |
+
get_default_compiler,
|
| 10 |
+
new_compiler,
|
| 11 |
+
show_compilers,
|
| 12 |
+
)
|
| 13 |
+
from .compilers.C.errors import CompileError, LinkError
|
| 14 |
+
|
| 15 |
+
__all__ = [
|
| 16 |
+
'CompileError',
|
| 17 |
+
'LinkError',
|
| 18 |
+
'gen_lib_options',
|
| 19 |
+
'gen_preprocess_options',
|
| 20 |
+
'get_default_compiler',
|
| 21 |
+
'new_compiler',
|
| 22 |
+
'show_compilers',
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
CCompiler = base.Compiler
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.cmd
|
| 2 |
+
|
| 3 |
+
Provides the Command class, the base class for the command classes
|
| 4 |
+
in the distutils.command package.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import logging
|
| 10 |
+
import os
|
| 11 |
+
import re
|
| 12 |
+
import sys
|
| 13 |
+
from abc import abstractmethod
|
| 14 |
+
from collections.abc import Callable, MutableSequence
|
| 15 |
+
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar, overload
|
| 16 |
+
|
| 17 |
+
from . import _modified, archive_util, dir_util, file_util, util
|
| 18 |
+
from ._log import log
|
| 19 |
+
from .errors import DistutilsOptionError
|
| 20 |
+
|
| 21 |
+
if TYPE_CHECKING:
|
| 22 |
+
# type-only import because of mutual dependence between these classes
|
| 23 |
+
from distutils.dist import Distribution
|
| 24 |
+
|
| 25 |
+
from typing_extensions import TypeVarTuple, Unpack
|
| 26 |
+
|
| 27 |
+
_Ts = TypeVarTuple("_Ts")
|
| 28 |
+
|
| 29 |
+
_StrPathT = TypeVar("_StrPathT", bound="str | os.PathLike[str]")
|
| 30 |
+
_BytesPathT = TypeVar("_BytesPathT", bound="bytes | os.PathLike[bytes]")
|
| 31 |
+
_CommandT = TypeVar("_CommandT", bound="Command")
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
class Command:
|
| 35 |
+
"""Abstract base class for defining command classes, the "worker bees"
|
| 36 |
+
of the Distutils. A useful analogy for command classes is to think of
|
| 37 |
+
them as subroutines with local variables called "options". The options
|
| 38 |
+
are "declared" in 'initialize_options()' and "defined" (given their
|
| 39 |
+
final values, aka "finalized") in 'finalize_options()', both of which
|
| 40 |
+
must be defined by every command class. The distinction between the
|
| 41 |
+
two is necessary because option values might come from the outside
|
| 42 |
+
world (command line, config file, ...), and any options dependent on
|
| 43 |
+
other options must be computed *after* these outside influences have
|
| 44 |
+
been processed -- hence 'finalize_options()'. The "body" of the
|
| 45 |
+
subroutine, where it does all its work based on the values of its
|
| 46 |
+
options, is the 'run()' method, which must also be implemented by every
|
| 47 |
+
command class.
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
# 'sub_commands' formalizes the notion of a "family" of commands,
|
| 51 |
+
# eg. "install" as the parent with sub-commands "install_lib",
|
| 52 |
+
# "install_headers", etc. The parent of a family of commands
|
| 53 |
+
# defines 'sub_commands' as a class attribute; it's a list of
|
| 54 |
+
# (command_name : string, predicate : unbound_method | string | None)
|
| 55 |
+
# tuples, where 'predicate' is a method of the parent command that
|
| 56 |
+
# determines whether the corresponding command is applicable in the
|
| 57 |
+
# current situation. (Eg. we "install_headers" is only applicable if
|
| 58 |
+
# we have any C header files to install.) If 'predicate' is None,
|
| 59 |
+
# that command is always applicable.
|
| 60 |
+
#
|
| 61 |
+
# 'sub_commands' is usually defined at the *end* of a class, because
|
| 62 |
+
# predicates can be unbound methods, so they must already have been
|
| 63 |
+
# defined. The canonical example is the "install" command.
|
| 64 |
+
sub_commands: ClassVar[ # Any to work around variance issues
|
| 65 |
+
list[tuple[str, Callable[[Any], bool] | None]]
|
| 66 |
+
] = []
|
| 67 |
+
|
| 68 |
+
user_options: ClassVar[
|
| 69 |
+
# Specifying both because list is invariant. Avoids mypy override assignment issues
|
| 70 |
+
list[tuple[str, str, str]] | list[tuple[str, str | None, str]]
|
| 71 |
+
] = []
|
| 72 |
+
|
| 73 |
+
# -- Creation/initialization methods -------------------------------
|
| 74 |
+
|
| 75 |
+
def __init__(self, dist: Distribution) -> None:
|
| 76 |
+
"""Create and initialize a new Command object. Most importantly,
|
| 77 |
+
invokes the 'initialize_options()' method, which is the real
|
| 78 |
+
initializer and depends on the actual command being
|
| 79 |
+
instantiated.
|
| 80 |
+
"""
|
| 81 |
+
# late import because of mutual dependence between these classes
|
| 82 |
+
from distutils.dist import Distribution
|
| 83 |
+
|
| 84 |
+
if not isinstance(dist, Distribution):
|
| 85 |
+
raise TypeError("dist must be a Distribution instance")
|
| 86 |
+
if self.__class__ is Command:
|
| 87 |
+
raise RuntimeError("Command is an abstract class")
|
| 88 |
+
|
| 89 |
+
self.distribution = dist
|
| 90 |
+
self.initialize_options()
|
| 91 |
+
|
| 92 |
+
# Per-command versions of the global flags, so that the user can
|
| 93 |
+
# customize Distutils' behaviour command-by-command and let some
|
| 94 |
+
# commands fall back on the Distribution's behaviour. None means
|
| 95 |
+
# "not defined, check self.distribution's copy".
|
| 96 |
+
|
| 97 |
+
# verbose is largely ignored, but needs to be set for
|
| 98 |
+
# backwards compatibility (I think)?
|
| 99 |
+
self.verbose = dist.verbose
|
| 100 |
+
|
| 101 |
+
# Some commands define a 'self.force' option to ignore file
|
| 102 |
+
# timestamps, but methods defined *here* assume that
|
| 103 |
+
# 'self.force' exists for all commands. So define it here
|
| 104 |
+
# just to be safe.
|
| 105 |
+
self.force = None
|
| 106 |
+
|
| 107 |
+
# The 'help' flag is just used for command-line parsing, so
|
| 108 |
+
# none of that complicated bureaucracy is needed.
|
| 109 |
+
self.help = False
|
| 110 |
+
|
| 111 |
+
# 'finalized' records whether or not 'finalize_options()' has been
|
| 112 |
+
# called. 'finalize_options()' itself should not pay attention to
|
| 113 |
+
# this flag: it is the business of 'ensure_finalized()', which
|
| 114 |
+
# always calls 'finalize_options()', to respect/update it.
|
| 115 |
+
self.finalized = False
|
| 116 |
+
|
| 117 |
+
def ensure_finalized(self) -> None:
|
| 118 |
+
if not self.finalized:
|
| 119 |
+
self.finalize_options()
|
| 120 |
+
self.finalized = True
|
| 121 |
+
|
| 122 |
+
# Subclasses must define:
|
| 123 |
+
# initialize_options()
|
| 124 |
+
# provide default values for all options; may be customized by
|
| 125 |
+
# setup script, by options from config file(s), or by command-line
|
| 126 |
+
# options
|
| 127 |
+
# finalize_options()
|
| 128 |
+
# decide on the final values for all options; this is called
|
| 129 |
+
# after all possible intervention from the outside world
|
| 130 |
+
# (command-line, option file, etc.) has been processed
|
| 131 |
+
# run()
|
| 132 |
+
# run the command: do whatever it is we're here to do,
|
| 133 |
+
# controlled by the command's various option values
|
| 134 |
+
|
| 135 |
+
@abstractmethod
|
| 136 |
+
def initialize_options(self) -> None:
|
| 137 |
+
"""Set default values for all the options that this command
|
| 138 |
+
supports. Note that these defaults may be overridden by other
|
| 139 |
+
commands, by the setup script, by config files, or by the
|
| 140 |
+
command-line. Thus, this is not the place to code dependencies
|
| 141 |
+
between options; generally, 'initialize_options()' implementations
|
| 142 |
+
are just a bunch of "self.foo = None" assignments.
|
| 143 |
+
|
| 144 |
+
This method must be implemented by all command classes.
|
| 145 |
+
"""
|
| 146 |
+
raise RuntimeError(
|
| 147 |
+
f"abstract method -- subclass {self.__class__} must override"
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
@abstractmethod
|
| 151 |
+
def finalize_options(self) -> None:
|
| 152 |
+
"""Set final values for all the options that this command supports.
|
| 153 |
+
This is always called as late as possible, ie. after any option
|
| 154 |
+
assignments from the command-line or from other commands have been
|
| 155 |
+
done. Thus, this is the place to code option dependencies: if
|
| 156 |
+
'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
|
| 157 |
+
long as 'foo' still has the same value it was assigned in
|
| 158 |
+
'initialize_options()'.
|
| 159 |
+
|
| 160 |
+
This method must be implemented by all command classes.
|
| 161 |
+
"""
|
| 162 |
+
raise RuntimeError(
|
| 163 |
+
f"abstract method -- subclass {self.__class__} must override"
|
| 164 |
+
)
|
| 165 |
+
|
| 166 |
+
def dump_options(self, header=None, indent=""):
|
| 167 |
+
from distutils.fancy_getopt import longopt_xlate
|
| 168 |
+
|
| 169 |
+
if header is None:
|
| 170 |
+
header = f"command options for '{self.get_command_name()}':"
|
| 171 |
+
self.announce(indent + header, level=logging.INFO)
|
| 172 |
+
indent = indent + " "
|
| 173 |
+
for option, _, _ in self.user_options:
|
| 174 |
+
option = option.translate(longopt_xlate)
|
| 175 |
+
if option[-1] == "=":
|
| 176 |
+
option = option[:-1]
|
| 177 |
+
value = getattr(self, option)
|
| 178 |
+
self.announce(indent + f"{option} = {value}", level=logging.INFO)
|
| 179 |
+
|
| 180 |
+
@abstractmethod
|
| 181 |
+
def run(self) -> None:
|
| 182 |
+
"""A command's raison d'etre: carry out the action it exists to
|
| 183 |
+
perform, controlled by the options initialized in
|
| 184 |
+
'initialize_options()', customized by other commands, the setup
|
| 185 |
+
script, the command-line, and config files, and finalized in
|
| 186 |
+
'finalize_options()'. All terminal output and filesystem
|
| 187 |
+
interaction should be done by 'run()'.
|
| 188 |
+
|
| 189 |
+
This method must be implemented by all command classes.
|
| 190 |
+
"""
|
| 191 |
+
raise RuntimeError(
|
| 192 |
+
f"abstract method -- subclass {self.__class__} must override"
|
| 193 |
+
)
|
| 194 |
+
|
| 195 |
+
def announce(self, msg: object, level: int = logging.DEBUG) -> None:
|
| 196 |
+
log.log(level, msg)
|
| 197 |
+
|
| 198 |
+
def debug_print(self, msg: object) -> None:
|
| 199 |
+
"""Print 'msg' to stdout if the global DEBUG (taken from the
|
| 200 |
+
DISTUTILS_DEBUG environment variable) flag is true.
|
| 201 |
+
"""
|
| 202 |
+
from distutils.debug import DEBUG
|
| 203 |
+
|
| 204 |
+
if DEBUG:
|
| 205 |
+
print(msg)
|
| 206 |
+
sys.stdout.flush()
|
| 207 |
+
|
| 208 |
+
# -- Option validation methods -------------------------------------
|
| 209 |
+
# (these are very handy in writing the 'finalize_options()' method)
|
| 210 |
+
#
|
| 211 |
+
# NB. the general philosophy here is to ensure that a particular option
|
| 212 |
+
# value meets certain type and value constraints. If not, we try to
|
| 213 |
+
# force it into conformance (eg. if we expect a list but have a string,
|
| 214 |
+
# split the string on comma and/or whitespace). If we can't force the
|
| 215 |
+
# option into conformance, raise DistutilsOptionError. Thus, command
|
| 216 |
+
# classes need do nothing more than (eg.)
|
| 217 |
+
# self.ensure_string_list('foo')
|
| 218 |
+
# and they can be guaranteed that thereafter, self.foo will be
|
| 219 |
+
# a list of strings.
|
| 220 |
+
|
| 221 |
+
def _ensure_stringlike(self, option, what, default=None):
|
| 222 |
+
val = getattr(self, option)
|
| 223 |
+
if val is None:
|
| 224 |
+
setattr(self, option, default)
|
| 225 |
+
return default
|
| 226 |
+
elif not isinstance(val, str):
|
| 227 |
+
raise DistutilsOptionError(f"'{option}' must be a {what} (got `{val}`)")
|
| 228 |
+
return val
|
| 229 |
+
|
| 230 |
+
def ensure_string(self, option: str, default: str | None = None) -> None:
|
| 231 |
+
"""Ensure that 'option' is a string; if not defined, set it to
|
| 232 |
+
'default'.
|
| 233 |
+
"""
|
| 234 |
+
self._ensure_stringlike(option, "string", default)
|
| 235 |
+
|
| 236 |
+
def ensure_string_list(self, option: str) -> None:
|
| 237 |
+
r"""Ensure that 'option' is a list of strings. If 'option' is
|
| 238 |
+
currently a string, we split it either on /,\s*/ or /\s+/, so
|
| 239 |
+
"foo bar baz", "foo,bar,baz", and "foo, bar baz" all become
|
| 240 |
+
["foo", "bar", "baz"].
|
| 241 |
+
"""
|
| 242 |
+
val = getattr(self, option)
|
| 243 |
+
if val is None:
|
| 244 |
+
return
|
| 245 |
+
elif isinstance(val, str):
|
| 246 |
+
setattr(self, option, re.split(r',\s*|\s+', val))
|
| 247 |
+
else:
|
| 248 |
+
if isinstance(val, list):
|
| 249 |
+
ok = all(isinstance(v, str) for v in val)
|
| 250 |
+
else:
|
| 251 |
+
ok = False
|
| 252 |
+
if not ok:
|
| 253 |
+
raise DistutilsOptionError(
|
| 254 |
+
f"'{option}' must be a list of strings (got {val!r})"
|
| 255 |
+
)
|
| 256 |
+
|
| 257 |
+
def _ensure_tested_string(self, option, tester, what, error_fmt, default=None):
|
| 258 |
+
val = self._ensure_stringlike(option, what, default)
|
| 259 |
+
if val is not None and not tester(val):
|
| 260 |
+
raise DistutilsOptionError(
|
| 261 |
+
("error in '%s' option: " + error_fmt) % (option, val)
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
+
def ensure_filename(self, option: str) -> None:
|
| 265 |
+
"""Ensure that 'option' is the name of an existing file."""
|
| 266 |
+
self._ensure_tested_string(
|
| 267 |
+
option, os.path.isfile, "filename", "'%s' does not exist or is not a file"
|
| 268 |
+
)
|
| 269 |
+
|
| 270 |
+
def ensure_dirname(self, option: str) -> None:
|
| 271 |
+
self._ensure_tested_string(
|
| 272 |
+
option,
|
| 273 |
+
os.path.isdir,
|
| 274 |
+
"directory name",
|
| 275 |
+
"'%s' does not exist or is not a directory",
|
| 276 |
+
)
|
| 277 |
+
|
| 278 |
+
# -- Convenience methods for commands ------------------------------
|
| 279 |
+
|
| 280 |
+
def get_command_name(self) -> str:
|
| 281 |
+
if hasattr(self, 'command_name'):
|
| 282 |
+
return self.command_name
|
| 283 |
+
else:
|
| 284 |
+
return self.__class__.__name__
|
| 285 |
+
|
| 286 |
+
def set_undefined_options(
|
| 287 |
+
self, src_cmd: str, *option_pairs: tuple[str, str]
|
| 288 |
+
) -> None:
|
| 289 |
+
"""Set the values of any "undefined" options from corresponding
|
| 290 |
+
option values in some other command object. "Undefined" here means
|
| 291 |
+
"is None", which is the convention used to indicate that an option
|
| 292 |
+
has not been changed between 'initialize_options()' and
|
| 293 |
+
'finalize_options()'. Usually called from 'finalize_options()' for
|
| 294 |
+
options that depend on some other command rather than another
|
| 295 |
+
option of the same command. 'src_cmd' is the other command from
|
| 296 |
+
which option values will be taken (a command object will be created
|
| 297 |
+
for it if necessary); the remaining arguments are
|
| 298 |
+
'(src_option,dst_option)' tuples which mean "take the value of
|
| 299 |
+
'src_option' in the 'src_cmd' command object, and copy it to
|
| 300 |
+
'dst_option' in the current command object".
|
| 301 |
+
"""
|
| 302 |
+
# Option_pairs: list of (src_option, dst_option) tuples
|
| 303 |
+
src_cmd_obj = self.distribution.get_command_obj(src_cmd)
|
| 304 |
+
src_cmd_obj.ensure_finalized()
|
| 305 |
+
for src_option, dst_option in option_pairs:
|
| 306 |
+
if getattr(self, dst_option) is None:
|
| 307 |
+
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
|
| 308 |
+
|
| 309 |
+
# NOTE: Because distutils is private to Setuptools and not all commands are exposed here,
|
| 310 |
+
# not every possible command is enumerated in the signature.
|
| 311 |
+
def get_finalized_command(self, command: str, create: bool = True) -> Command:
|
| 312 |
+
"""Wrapper around Distribution's 'get_command_obj()' method: find
|
| 313 |
+
(create if necessary and 'create' is true) the command object for
|
| 314 |
+
'command', call its 'ensure_finalized()' method, and return the
|
| 315 |
+
finalized command object.
|
| 316 |
+
"""
|
| 317 |
+
cmd_obj = self.distribution.get_command_obj(command, create)
|
| 318 |
+
cmd_obj.ensure_finalized()
|
| 319 |
+
return cmd_obj
|
| 320 |
+
|
| 321 |
+
# XXX rename to 'get_reinitialized_command()'? (should do the
|
| 322 |
+
# same in dist.py, if so)
|
| 323 |
+
@overload
|
| 324 |
+
def reinitialize_command(
|
| 325 |
+
self, command: str, reinit_subcommands: bool = False
|
| 326 |
+
) -> Command: ...
|
| 327 |
+
@overload
|
| 328 |
+
def reinitialize_command(
|
| 329 |
+
self, command: _CommandT, reinit_subcommands: bool = False
|
| 330 |
+
) -> _CommandT: ...
|
| 331 |
+
def reinitialize_command(
|
| 332 |
+
self, command: str | Command, reinit_subcommands=False
|
| 333 |
+
) -> Command:
|
| 334 |
+
return self.distribution.reinitialize_command(command, reinit_subcommands)
|
| 335 |
+
|
| 336 |
+
def run_command(self, command: str) -> None:
|
| 337 |
+
"""Run some other command: uses the 'run_command()' method of
|
| 338 |
+
Distribution, which creates and finalizes the command object if
|
| 339 |
+
necessary and then invokes its 'run()' method.
|
| 340 |
+
"""
|
| 341 |
+
self.distribution.run_command(command)
|
| 342 |
+
|
| 343 |
+
def get_sub_commands(self) -> list[str]:
|
| 344 |
+
"""Determine the sub-commands that are relevant in the current
|
| 345 |
+
distribution (ie., that need to be run). This is based on the
|
| 346 |
+
'sub_commands' class attribute: each tuple in that list may include
|
| 347 |
+
a method that we call to determine if the subcommand needs to be
|
| 348 |
+
run for the current distribution. Return a list of command names.
|
| 349 |
+
"""
|
| 350 |
+
commands = []
|
| 351 |
+
for cmd_name, method in self.sub_commands:
|
| 352 |
+
if method is None or method(self):
|
| 353 |
+
commands.append(cmd_name)
|
| 354 |
+
return commands
|
| 355 |
+
|
| 356 |
+
# -- External world manipulation -----------------------------------
|
| 357 |
+
|
| 358 |
+
def warn(self, msg: object) -> None:
|
| 359 |
+
log.warning("warning: %s: %s\n", self.get_command_name(), msg)
|
| 360 |
+
|
| 361 |
+
def execute(
|
| 362 |
+
self,
|
| 363 |
+
func: Callable[[Unpack[_Ts]], object],
|
| 364 |
+
args: tuple[Unpack[_Ts]],
|
| 365 |
+
msg: object = None,
|
| 366 |
+
level: int = 1,
|
| 367 |
+
) -> None:
|
| 368 |
+
util.execute(func, args, msg)
|
| 369 |
+
|
| 370 |
+
def mkpath(self, name: str, mode: int = 0o777) -> None:
|
| 371 |
+
dir_util.mkpath(name, mode)
|
| 372 |
+
|
| 373 |
+
@overload
|
| 374 |
+
def copy_file(
|
| 375 |
+
self,
|
| 376 |
+
infile: str | os.PathLike[str],
|
| 377 |
+
outfile: _StrPathT,
|
| 378 |
+
preserve_mode: bool = True,
|
| 379 |
+
preserve_times: bool = True,
|
| 380 |
+
link: str | None = None,
|
| 381 |
+
level: int = 1,
|
| 382 |
+
) -> tuple[_StrPathT | str, bool]: ...
|
| 383 |
+
@overload
|
| 384 |
+
def copy_file(
|
| 385 |
+
self,
|
| 386 |
+
infile: bytes | os.PathLike[bytes],
|
| 387 |
+
outfile: _BytesPathT,
|
| 388 |
+
preserve_mode: bool = True,
|
| 389 |
+
preserve_times: bool = True,
|
| 390 |
+
link: str | None = None,
|
| 391 |
+
level: int = 1,
|
| 392 |
+
) -> tuple[_BytesPathT | bytes, bool]: ...
|
| 393 |
+
def copy_file(
|
| 394 |
+
self,
|
| 395 |
+
infile: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 396 |
+
outfile: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 397 |
+
preserve_mode: bool = True,
|
| 398 |
+
preserve_times: bool = True,
|
| 399 |
+
link: str | None = None,
|
| 400 |
+
level: int = 1,
|
| 401 |
+
) -> tuple[str | os.PathLike[str] | bytes | os.PathLike[bytes], bool]:
|
| 402 |
+
"""Copy a file respecting verbose, dry-run and force flags. (The
|
| 403 |
+
former two default to whatever is in the Distribution object, and
|
| 404 |
+
the latter defaults to false for commands that don't define it.)"""
|
| 405 |
+
return file_util.copy_file(
|
| 406 |
+
infile,
|
| 407 |
+
outfile,
|
| 408 |
+
preserve_mode,
|
| 409 |
+
preserve_times,
|
| 410 |
+
not self.force,
|
| 411 |
+
link,
|
| 412 |
+
)
|
| 413 |
+
|
| 414 |
+
def copy_tree(
|
| 415 |
+
self,
|
| 416 |
+
infile: str | os.PathLike[str],
|
| 417 |
+
outfile: str,
|
| 418 |
+
preserve_mode: bool = True,
|
| 419 |
+
preserve_times: bool = True,
|
| 420 |
+
preserve_symlinks: bool = False,
|
| 421 |
+
level: int = 1,
|
| 422 |
+
) -> list[str]:
|
| 423 |
+
"""Copy an entire directory tree respecting verbose, dry-run,
|
| 424 |
+
and force flags.
|
| 425 |
+
"""
|
| 426 |
+
return dir_util.copy_tree(
|
| 427 |
+
infile,
|
| 428 |
+
outfile,
|
| 429 |
+
preserve_mode,
|
| 430 |
+
preserve_times,
|
| 431 |
+
preserve_symlinks,
|
| 432 |
+
not self.force,
|
| 433 |
+
)
|
| 434 |
+
|
| 435 |
+
@overload
|
| 436 |
+
def move_file(
|
| 437 |
+
self, src: str | os.PathLike[str], dst: _StrPathT, level: int = 1
|
| 438 |
+
) -> _StrPathT | str: ...
|
| 439 |
+
@overload
|
| 440 |
+
def move_file(
|
| 441 |
+
self, src: bytes | os.PathLike[bytes], dst: _BytesPathT, level: int = 1
|
| 442 |
+
) -> _BytesPathT | bytes: ...
|
| 443 |
+
def move_file(
|
| 444 |
+
self,
|
| 445 |
+
src: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 446 |
+
dst: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 447 |
+
level: int = 1,
|
| 448 |
+
) -> str | os.PathLike[str] | bytes | os.PathLike[bytes]:
|
| 449 |
+
"""Move a file respecting dry-run flag."""
|
| 450 |
+
return file_util.move_file(src, dst)
|
| 451 |
+
|
| 452 |
+
def spawn(
|
| 453 |
+
self, cmd: MutableSequence[str], search_path: bool = True, level: int = 1
|
| 454 |
+
) -> None:
|
| 455 |
+
"""Spawn an external command respecting dry-run flag."""
|
| 456 |
+
from distutils.spawn import spawn
|
| 457 |
+
|
| 458 |
+
spawn(cmd, search_path)
|
| 459 |
+
|
| 460 |
+
@overload
|
| 461 |
+
def make_archive(
|
| 462 |
+
self,
|
| 463 |
+
base_name: str,
|
| 464 |
+
format: str,
|
| 465 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes] | None = None,
|
| 466 |
+
base_dir: str | None = None,
|
| 467 |
+
owner: str | None = None,
|
| 468 |
+
group: str | None = None,
|
| 469 |
+
) -> str: ...
|
| 470 |
+
@overload
|
| 471 |
+
def make_archive(
|
| 472 |
+
self,
|
| 473 |
+
base_name: str | os.PathLike[str],
|
| 474 |
+
format: str,
|
| 475 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 476 |
+
base_dir: str | None = None,
|
| 477 |
+
owner: str | None = None,
|
| 478 |
+
group: str | None = None,
|
| 479 |
+
) -> str: ...
|
| 480 |
+
def make_archive(
|
| 481 |
+
self,
|
| 482 |
+
base_name: str | os.PathLike[str],
|
| 483 |
+
format: str,
|
| 484 |
+
root_dir: str | os.PathLike[str] | bytes | os.PathLike[bytes] | None = None,
|
| 485 |
+
base_dir: str | None = None,
|
| 486 |
+
owner: str | None = None,
|
| 487 |
+
group: str | None = None,
|
| 488 |
+
) -> str:
|
| 489 |
+
return archive_util.make_archive(
|
| 490 |
+
base_name,
|
| 491 |
+
format,
|
| 492 |
+
root_dir,
|
| 493 |
+
base_dir,
|
| 494 |
+
owner=owner,
|
| 495 |
+
group=group,
|
| 496 |
+
)
|
| 497 |
+
|
| 498 |
+
def make_file(
|
| 499 |
+
self,
|
| 500 |
+
infiles: str | list[str] | tuple[str, ...],
|
| 501 |
+
outfile: str | os.PathLike[str] | bytes | os.PathLike[bytes],
|
| 502 |
+
func: Callable[[Unpack[_Ts]], object],
|
| 503 |
+
args: tuple[Unpack[_Ts]],
|
| 504 |
+
exec_msg: object = None,
|
| 505 |
+
skip_msg: object = None,
|
| 506 |
+
level: int = 1,
|
| 507 |
+
) -> None:
|
| 508 |
+
"""Special case of 'execute()' for operations that process one or
|
| 509 |
+
more input files and generate one output file. Works just like
|
| 510 |
+
'execute()', except the operation is skipped and a different
|
| 511 |
+
message printed if 'outfile' already exists and is newer than all
|
| 512 |
+
files listed in 'infiles'. If the command defined 'self.force',
|
| 513 |
+
and it is true, then the command is unconditionally run -- does no
|
| 514 |
+
timestamp checks.
|
| 515 |
+
"""
|
| 516 |
+
if skip_msg is None:
|
| 517 |
+
skip_msg = f"skipping {outfile} (inputs unchanged)"
|
| 518 |
+
|
| 519 |
+
# Allow 'infiles' to be a single string
|
| 520 |
+
if isinstance(infiles, str):
|
| 521 |
+
infiles = (infiles,)
|
| 522 |
+
elif not isinstance(infiles, (list, tuple)):
|
| 523 |
+
raise TypeError("'infiles' must be a string, or a list or tuple of strings")
|
| 524 |
+
|
| 525 |
+
if exec_msg is None:
|
| 526 |
+
exec_msg = "generating {} from {}".format(outfile, ', '.join(infiles))
|
| 527 |
+
|
| 528 |
+
# If 'outfile' must be regenerated (either because it doesn't
|
| 529 |
+
# exist, is out-of-date, or the 'force' flag is true) then
|
| 530 |
+
# perform the action that presumably regenerates it
|
| 531 |
+
if self.force or _modified.newer_group(infiles, outfile):
|
| 532 |
+
self.execute(func, args, exec_msg, level)
|
| 533 |
+
# Otherwise, print the "skip" message
|
| 534 |
+
else:
|
| 535 |
+
log.debug(skip_msg)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/core.py
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.core
|
| 2 |
+
|
| 3 |
+
The only module that needs to be imported to use the Distutils; provides
|
| 4 |
+
the 'setup' function (which is to be called from the setup script). Also
|
| 5 |
+
indirectly provides the Distribution and Command classes, although they are
|
| 6 |
+
really defined in distutils.dist and distutils.cmd.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import os
|
| 12 |
+
import sys
|
| 13 |
+
import tokenize
|
| 14 |
+
from collections.abc import Iterable
|
| 15 |
+
|
| 16 |
+
from .cmd import Command
|
| 17 |
+
from .debug import DEBUG
|
| 18 |
+
|
| 19 |
+
# Mainly import these so setup scripts can "from distutils.core import" them.
|
| 20 |
+
from .dist import Distribution
|
| 21 |
+
from .errors import (
|
| 22 |
+
CCompilerError,
|
| 23 |
+
DistutilsArgError,
|
| 24 |
+
DistutilsError,
|
| 25 |
+
DistutilsSetupError,
|
| 26 |
+
)
|
| 27 |
+
from .extension import Extension
|
| 28 |
+
|
| 29 |
+
__all__ = ['Distribution', 'Command', 'Extension', 'setup']
|
| 30 |
+
|
| 31 |
+
# This is a barebones help message generated displayed when the user
|
| 32 |
+
# runs the setup script with no arguments at all. More useful help
|
| 33 |
+
# is generated with various --help options: global help, list commands,
|
| 34 |
+
# and per-command help.
|
| 35 |
+
USAGE = """\
|
| 36 |
+
usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
|
| 37 |
+
or: %(script)s --help [cmd1 cmd2 ...]
|
| 38 |
+
or: %(script)s --help-commands
|
| 39 |
+
or: %(script)s cmd --help
|
| 40 |
+
"""
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def gen_usage(script_name):
|
| 44 |
+
script = os.path.basename(script_name)
|
| 45 |
+
return USAGE % locals()
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
# Some mild magic to control the behaviour of 'setup()' from 'run_setup()'.
|
| 49 |
+
_setup_stop_after = None
|
| 50 |
+
_setup_distribution = None
|
| 51 |
+
|
| 52 |
+
# Legal keyword arguments for the setup() function
|
| 53 |
+
setup_keywords = (
|
| 54 |
+
'distclass',
|
| 55 |
+
'script_name',
|
| 56 |
+
'script_args',
|
| 57 |
+
'options',
|
| 58 |
+
'name',
|
| 59 |
+
'version',
|
| 60 |
+
'author',
|
| 61 |
+
'author_email',
|
| 62 |
+
'maintainer',
|
| 63 |
+
'maintainer_email',
|
| 64 |
+
'url',
|
| 65 |
+
'license',
|
| 66 |
+
'description',
|
| 67 |
+
'long_description',
|
| 68 |
+
'keywords',
|
| 69 |
+
'platforms',
|
| 70 |
+
'classifiers',
|
| 71 |
+
'download_url',
|
| 72 |
+
'requires',
|
| 73 |
+
'provides',
|
| 74 |
+
'obsoletes',
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
# Legal keyword arguments for the Extension constructor
|
| 78 |
+
extension_keywords = (
|
| 79 |
+
'name',
|
| 80 |
+
'sources',
|
| 81 |
+
'include_dirs',
|
| 82 |
+
'define_macros',
|
| 83 |
+
'undef_macros',
|
| 84 |
+
'library_dirs',
|
| 85 |
+
'libraries',
|
| 86 |
+
'runtime_library_dirs',
|
| 87 |
+
'extra_objects',
|
| 88 |
+
'extra_compile_args',
|
| 89 |
+
'extra_link_args',
|
| 90 |
+
'swig_opts',
|
| 91 |
+
'export_symbols',
|
| 92 |
+
'depends',
|
| 93 |
+
'language',
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def setup(**attrs): # noqa: C901
|
| 98 |
+
"""The gateway to the Distutils: do everything your setup script needs
|
| 99 |
+
to do, in a highly flexible and user-driven way. Briefly: create a
|
| 100 |
+
Distribution instance; find and parse config files; parse the command
|
| 101 |
+
line; run each Distutils command found there, customized by the options
|
| 102 |
+
supplied to 'setup()' (as keyword arguments), in config files, and on
|
| 103 |
+
the command line.
|
| 104 |
+
|
| 105 |
+
The Distribution instance might be an instance of a class supplied via
|
| 106 |
+
the 'distclass' keyword argument to 'setup'; if no such class is
|
| 107 |
+
supplied, then the Distribution class (in dist.py) is instantiated.
|
| 108 |
+
All other arguments to 'setup' (except for 'cmdclass') are used to set
|
| 109 |
+
attributes of the Distribution instance.
|
| 110 |
+
|
| 111 |
+
The 'cmdclass' argument, if supplied, is a dictionary mapping command
|
| 112 |
+
names to command classes. Each command encountered on the command line
|
| 113 |
+
will be turned into a command class, which is in turn instantiated; any
|
| 114 |
+
class found in 'cmdclass' is used in place of the default, which is
|
| 115 |
+
(for command 'foo_bar') class 'foo_bar' in module
|
| 116 |
+
'distutils.command.foo_bar'. The command class must provide a
|
| 117 |
+
'user_options' attribute which is a list of option specifiers for
|
| 118 |
+
'distutils.fancy_getopt'. Any command-line options between the current
|
| 119 |
+
and the next command are used to set attributes of the current command
|
| 120 |
+
object.
|
| 121 |
+
|
| 122 |
+
When the entire command-line has been successfully parsed, calls the
|
| 123 |
+
'run()' method on each command object in turn. This method will be
|
| 124 |
+
driven entirely by the Distribution object (which each command object
|
| 125 |
+
has a reference to, thanks to its constructor), and the
|
| 126 |
+
command-specific options that became attributes of each command
|
| 127 |
+
object.
|
| 128 |
+
"""
|
| 129 |
+
|
| 130 |
+
global _setup_stop_after, _setup_distribution
|
| 131 |
+
|
| 132 |
+
# Determine the distribution class -- either caller-supplied or
|
| 133 |
+
# our Distribution (see below).
|
| 134 |
+
klass = attrs.get('distclass')
|
| 135 |
+
if klass:
|
| 136 |
+
attrs.pop('distclass')
|
| 137 |
+
else:
|
| 138 |
+
klass = Distribution
|
| 139 |
+
|
| 140 |
+
if 'script_name' not in attrs:
|
| 141 |
+
attrs['script_name'] = os.path.basename(sys.argv[0])
|
| 142 |
+
if 'script_args' not in attrs:
|
| 143 |
+
attrs['script_args'] = sys.argv[1:]
|
| 144 |
+
|
| 145 |
+
# Create the Distribution instance, using the remaining arguments
|
| 146 |
+
# (ie. everything except distclass) to initialize it
|
| 147 |
+
try:
|
| 148 |
+
_setup_distribution = dist = klass(attrs)
|
| 149 |
+
except DistutilsSetupError as msg:
|
| 150 |
+
if 'name' not in attrs:
|
| 151 |
+
raise SystemExit(f"error in setup command: {msg}")
|
| 152 |
+
else:
|
| 153 |
+
raise SystemExit("error in {} setup command: {}".format(attrs['name'], msg))
|
| 154 |
+
|
| 155 |
+
if _setup_stop_after == "init":
|
| 156 |
+
return dist
|
| 157 |
+
|
| 158 |
+
# Find and parse the config file(s): they will override options from
|
| 159 |
+
# the setup script, but be overridden by the command line.
|
| 160 |
+
dist.parse_config_files()
|
| 161 |
+
|
| 162 |
+
if DEBUG:
|
| 163 |
+
print("options (after parsing config files):")
|
| 164 |
+
dist.dump_option_dicts()
|
| 165 |
+
|
| 166 |
+
if _setup_stop_after == "config":
|
| 167 |
+
return dist
|
| 168 |
+
|
| 169 |
+
# Parse the command line and override config files; any
|
| 170 |
+
# command-line errors are the end user's fault, so turn them into
|
| 171 |
+
# SystemExit to suppress tracebacks.
|
| 172 |
+
try:
|
| 173 |
+
ok = dist.parse_command_line()
|
| 174 |
+
except DistutilsArgError as msg:
|
| 175 |
+
raise SystemExit(gen_usage(dist.script_name) + f"\nerror: {msg}")
|
| 176 |
+
|
| 177 |
+
if DEBUG:
|
| 178 |
+
print("options (after parsing command line):")
|
| 179 |
+
dist.dump_option_dicts()
|
| 180 |
+
|
| 181 |
+
if _setup_stop_after == "commandline":
|
| 182 |
+
return dist
|
| 183 |
+
|
| 184 |
+
# And finally, run all the commands found on the command line.
|
| 185 |
+
if ok:
|
| 186 |
+
return run_commands(dist)
|
| 187 |
+
|
| 188 |
+
return dist
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
# setup ()
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
def run_commands(dist):
|
| 195 |
+
"""Given a Distribution object run all the commands,
|
| 196 |
+
raising ``SystemExit`` errors in the case of failure.
|
| 197 |
+
|
| 198 |
+
This function assumes that either ``sys.argv`` or ``dist.script_args``
|
| 199 |
+
is already set accordingly.
|
| 200 |
+
"""
|
| 201 |
+
try:
|
| 202 |
+
dist.run_commands()
|
| 203 |
+
except KeyboardInterrupt:
|
| 204 |
+
raise SystemExit("interrupted")
|
| 205 |
+
except OSError as exc:
|
| 206 |
+
if DEBUG:
|
| 207 |
+
sys.stderr.write(f"error: {exc}\n")
|
| 208 |
+
raise
|
| 209 |
+
else:
|
| 210 |
+
raise SystemExit(f"error: {exc}")
|
| 211 |
+
|
| 212 |
+
except (DistutilsError, CCompilerError) as msg:
|
| 213 |
+
if DEBUG:
|
| 214 |
+
raise
|
| 215 |
+
else:
|
| 216 |
+
raise SystemExit("error: " + str(msg))
|
| 217 |
+
|
| 218 |
+
return dist
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
def run_setup(script_name, script_args: Iterable[str] | None = None, stop_after="run"):
|
| 222 |
+
"""Run a setup script in a somewhat controlled environment, and
|
| 223 |
+
return the Distribution instance that drives things. This is useful
|
| 224 |
+
if you need to find out the distribution meta-data (passed as
|
| 225 |
+
keyword args from 'script' to 'setup()', or the contents of the
|
| 226 |
+
config files or command-line.
|
| 227 |
+
|
| 228 |
+
'script_name' is a file that will be read and run with 'exec()';
|
| 229 |
+
'sys.argv[0]' will be replaced with 'script' for the duration of the
|
| 230 |
+
call. 'script_args' is a list of strings; if supplied,
|
| 231 |
+
'sys.argv[1:]' will be replaced by 'script_args' for the duration of
|
| 232 |
+
the call.
|
| 233 |
+
|
| 234 |
+
'stop_after' tells 'setup()' when to stop processing; possible
|
| 235 |
+
values:
|
| 236 |
+
init
|
| 237 |
+
stop after the Distribution instance has been created and
|
| 238 |
+
populated with the keyword arguments to 'setup()'
|
| 239 |
+
config
|
| 240 |
+
stop after config files have been parsed (and their data
|
| 241 |
+
stored in the Distribution instance)
|
| 242 |
+
commandline
|
| 243 |
+
stop after the command-line ('sys.argv[1:]' or 'script_args')
|
| 244 |
+
have been parsed (and the data stored in the Distribution)
|
| 245 |
+
run [default]
|
| 246 |
+
stop after all commands have been run (the same as if 'setup()'
|
| 247 |
+
had been called in the usual way
|
| 248 |
+
|
| 249 |
+
Returns the Distribution instance, which provides all information
|
| 250 |
+
used to drive the Distutils.
|
| 251 |
+
"""
|
| 252 |
+
if stop_after not in ('init', 'config', 'commandline', 'run'):
|
| 253 |
+
raise ValueError(f"invalid value for 'stop_after': {stop_after!r}")
|
| 254 |
+
|
| 255 |
+
global _setup_stop_after, _setup_distribution
|
| 256 |
+
_setup_stop_after = stop_after
|
| 257 |
+
|
| 258 |
+
save_argv = sys.argv.copy()
|
| 259 |
+
g = {'__file__': script_name, '__name__': '__main__'}
|
| 260 |
+
try:
|
| 261 |
+
try:
|
| 262 |
+
sys.argv[0] = script_name
|
| 263 |
+
if script_args is not None:
|
| 264 |
+
sys.argv[1:] = script_args
|
| 265 |
+
# tokenize.open supports automatic encoding detection
|
| 266 |
+
with tokenize.open(script_name) as f:
|
| 267 |
+
code = f.read().replace(r'\r\n', r'\n')
|
| 268 |
+
exec(code, g)
|
| 269 |
+
finally:
|
| 270 |
+
sys.argv = save_argv
|
| 271 |
+
_setup_stop_after = None
|
| 272 |
+
except SystemExit:
|
| 273 |
+
# Hmm, should we do something if exiting with a non-zero code
|
| 274 |
+
# (ie. error)?
|
| 275 |
+
pass
|
| 276 |
+
|
| 277 |
+
if _setup_distribution is None:
|
| 278 |
+
raise RuntimeError(
|
| 279 |
+
"'distutils.core.setup()' was never called -- "
|
| 280 |
+
f"perhaps '{script_name}' is not a Distutils setup script?"
|
| 281 |
+
)
|
| 282 |
+
|
| 283 |
+
# I wonder if the setup script's namespace -- g and l -- would be of
|
| 284 |
+
# any interest to callers?
|
| 285 |
+
# print "_setup_distribution:", _setup_distribution
|
| 286 |
+
return _setup_distribution
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
# run_setup ()
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/cygwinccompiler.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .compilers.C import cygwin
|
| 2 |
+
from .compilers.C.cygwin import (
|
| 3 |
+
CONFIG_H_NOTOK,
|
| 4 |
+
CONFIG_H_OK,
|
| 5 |
+
CONFIG_H_UNCERTAIN,
|
| 6 |
+
check_config_h,
|
| 7 |
+
get_msvcr,
|
| 8 |
+
is_cygwincc,
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
__all__ = [
|
| 12 |
+
'CONFIG_H_NOTOK',
|
| 13 |
+
'CONFIG_H_OK',
|
| 14 |
+
'CONFIG_H_UNCERTAIN',
|
| 15 |
+
'CygwinCCompiler',
|
| 16 |
+
'Mingw32CCompiler',
|
| 17 |
+
'check_config_h',
|
| 18 |
+
'get_msvcr',
|
| 19 |
+
'is_cygwincc',
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
CygwinCCompiler = cygwin.Compiler
|
| 24 |
+
Mingw32CCompiler = cygwin.MinGW32Compiler
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
get_versions = None
|
| 28 |
+
"""
|
| 29 |
+
A stand-in for the previous get_versions() function to prevent failures
|
| 30 |
+
when monkeypatched. See pypa/setuptools#2969.
|
| 31 |
+
"""
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/debug.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# If DISTUTILS_DEBUG is anything other than the empty string, we run in
|
| 4 |
+
# debug mode.
|
| 5 |
+
DEBUG = os.environ.get('DISTUTILS_DEBUG')
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dep_util.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import warnings
|
| 2 |
+
|
| 3 |
+
from . import _modified
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def __getattr__(name):
|
| 7 |
+
if name not in ['newer', 'newer_group', 'newer_pairwise']:
|
| 8 |
+
raise AttributeError(name)
|
| 9 |
+
warnings.warn(
|
| 10 |
+
"dep_util is Deprecated. Use functions from setuptools instead.",
|
| 11 |
+
DeprecationWarning,
|
| 12 |
+
stacklevel=2,
|
| 13 |
+
)
|
| 14 |
+
return getattr(_modified, name)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dir_util.py
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.dir_util
|
| 2 |
+
|
| 3 |
+
Utility functions for manipulating directories and directory trees."""
|
| 4 |
+
|
| 5 |
+
import functools
|
| 6 |
+
import itertools
|
| 7 |
+
import os
|
| 8 |
+
import pathlib
|
| 9 |
+
|
| 10 |
+
from . import file_util
|
| 11 |
+
from ._log import log
|
| 12 |
+
from .errors import DistutilsFileError, DistutilsInternalError
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class SkipRepeatAbsolutePaths(set):
|
| 16 |
+
"""
|
| 17 |
+
Cache for mkpath.
|
| 18 |
+
|
| 19 |
+
In addition to cheapening redundant calls, eliminates redundant
|
| 20 |
+
"creating /foo/bar/baz" messages in dry-run mode.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
def __init__(self):
|
| 24 |
+
SkipRepeatAbsolutePaths.instance = self
|
| 25 |
+
|
| 26 |
+
@classmethod
|
| 27 |
+
def clear(cls):
|
| 28 |
+
super(cls, cls.instance).clear()
|
| 29 |
+
|
| 30 |
+
def wrap(self, func):
|
| 31 |
+
@functools.wraps(func)
|
| 32 |
+
def wrapper(path, *args, **kwargs):
|
| 33 |
+
if path.absolute() in self:
|
| 34 |
+
return
|
| 35 |
+
result = func(path, *args, **kwargs)
|
| 36 |
+
self.add(path.absolute())
|
| 37 |
+
return result
|
| 38 |
+
|
| 39 |
+
return wrapper
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
# Python 3.8 compatibility
|
| 43 |
+
wrapper = SkipRepeatAbsolutePaths().wrap
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
@functools.singledispatch
|
| 47 |
+
@wrapper
|
| 48 |
+
def mkpath(name: pathlib.Path, mode=0o777, verbose=True) -> None:
|
| 49 |
+
"""Create a directory and any missing ancestor directories.
|
| 50 |
+
|
| 51 |
+
If the directory already exists (or if 'name' is the empty string, which
|
| 52 |
+
means the current directory, which of course exists), then do nothing.
|
| 53 |
+
Raise DistutilsFileError if unable to create some directory along the way
|
| 54 |
+
(eg. some sub-path exists, but is a file rather than a directory).
|
| 55 |
+
If 'verbose' is true, log the directory created.
|
| 56 |
+
"""
|
| 57 |
+
if verbose and not name.is_dir():
|
| 58 |
+
log.info("creating %s", name)
|
| 59 |
+
|
| 60 |
+
try:
|
| 61 |
+
name.mkdir(mode=mode, parents=True, exist_ok=True)
|
| 62 |
+
except OSError as exc:
|
| 63 |
+
raise DistutilsFileError(f"could not create '{name}': {exc.args[-1]}")
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@mkpath.register
|
| 67 |
+
def _(name: str, *args, **kwargs):
|
| 68 |
+
return mkpath(pathlib.Path(name), *args, **kwargs)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
@mkpath.register
|
| 72 |
+
def _(name: None, *args, **kwargs):
|
| 73 |
+
"""
|
| 74 |
+
Detect a common bug -- name is None.
|
| 75 |
+
"""
|
| 76 |
+
raise DistutilsInternalError(f"mkpath: 'name' must be a string (got {name!r})")
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def create_tree(base_dir, files, mode=0o777, verbose=True):
|
| 80 |
+
"""Create all the empty directories under 'base_dir' needed to put 'files'
|
| 81 |
+
there.
|
| 82 |
+
|
| 83 |
+
'base_dir' is just the name of a directory which doesn't necessarily
|
| 84 |
+
exist yet; 'files' is a list of filenames to be interpreted relative to
|
| 85 |
+
'base_dir'. 'base_dir' + the directory portion of every file in 'files'
|
| 86 |
+
will be created if it doesn't already exist. 'mode' and 'verbose'
|
| 87 |
+
flags are as for 'mkpath()'.
|
| 88 |
+
"""
|
| 89 |
+
# First get the list of directories to create
|
| 90 |
+
need_dir = set(os.path.join(base_dir, os.path.dirname(file)) for file in files)
|
| 91 |
+
|
| 92 |
+
# Now create them
|
| 93 |
+
for dir in sorted(need_dir):
|
| 94 |
+
mkpath(dir, mode, verbose=verbose)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def copy_tree(
|
| 98 |
+
src,
|
| 99 |
+
dst,
|
| 100 |
+
preserve_mode=True,
|
| 101 |
+
preserve_times=True,
|
| 102 |
+
preserve_symlinks=False,
|
| 103 |
+
update=False,
|
| 104 |
+
verbose=True,
|
| 105 |
+
):
|
| 106 |
+
"""Copy an entire directory tree 'src' to a new location 'dst'.
|
| 107 |
+
|
| 108 |
+
Both 'src' and 'dst' must be directory names. If 'src' is not a
|
| 109 |
+
directory, raise DistutilsFileError. If 'dst' does not exist, it is
|
| 110 |
+
created with 'mkpath()'. The end result of the copy is that every
|
| 111 |
+
file in 'src' is copied to 'dst', and directories under 'src' are
|
| 112 |
+
recursively copied to 'dst'. Return the list of files that were
|
| 113 |
+
copied or might have been copied, using their output name. The
|
| 114 |
+
return value is unaffected by 'update': it is simply
|
| 115 |
+
the list of all files under 'src', with the names changed to be
|
| 116 |
+
under 'dst'.
|
| 117 |
+
|
| 118 |
+
'preserve_mode' and 'preserve_times' are the same as for
|
| 119 |
+
'copy_file'; note that they only apply to regular files, not to
|
| 120 |
+
directories. If 'preserve_symlinks' is true, symlinks will be
|
| 121 |
+
copied as symlinks (on platforms that support them!); otherwise
|
| 122 |
+
(the default), the destination of the symlink will be copied.
|
| 123 |
+
'update' and 'verbose' are the same as for 'copy_file'.
|
| 124 |
+
"""
|
| 125 |
+
if not os.path.isdir(src):
|
| 126 |
+
raise DistutilsFileError(f"cannot copy tree '{src}': not a directory")
|
| 127 |
+
try:
|
| 128 |
+
names = os.listdir(src)
|
| 129 |
+
except OSError as e:
|
| 130 |
+
raise DistutilsFileError(f"error listing files in '{src}': {e.strerror}")
|
| 131 |
+
|
| 132 |
+
mkpath(dst, verbose=verbose)
|
| 133 |
+
|
| 134 |
+
copy_one = functools.partial(
|
| 135 |
+
_copy_one,
|
| 136 |
+
src=src,
|
| 137 |
+
dst=dst,
|
| 138 |
+
preserve_symlinks=preserve_symlinks,
|
| 139 |
+
verbose=verbose,
|
| 140 |
+
preserve_mode=preserve_mode,
|
| 141 |
+
preserve_times=preserve_times,
|
| 142 |
+
update=update,
|
| 143 |
+
)
|
| 144 |
+
return list(itertools.chain.from_iterable(map(copy_one, names)))
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
def _copy_one(
|
| 148 |
+
name,
|
| 149 |
+
*,
|
| 150 |
+
src,
|
| 151 |
+
dst,
|
| 152 |
+
preserve_symlinks,
|
| 153 |
+
verbose,
|
| 154 |
+
preserve_mode,
|
| 155 |
+
preserve_times,
|
| 156 |
+
update,
|
| 157 |
+
):
|
| 158 |
+
src_name = os.path.join(src, name)
|
| 159 |
+
dst_name = os.path.join(dst, name)
|
| 160 |
+
|
| 161 |
+
if name.startswith('.nfs'):
|
| 162 |
+
# skip NFS rename files
|
| 163 |
+
return
|
| 164 |
+
|
| 165 |
+
if preserve_symlinks and os.path.islink(src_name):
|
| 166 |
+
link_dest = os.readlink(src_name)
|
| 167 |
+
if verbose >= 1:
|
| 168 |
+
log.info("linking %s -> %s", dst_name, link_dest)
|
| 169 |
+
os.symlink(link_dest, dst_name)
|
| 170 |
+
yield dst_name
|
| 171 |
+
|
| 172 |
+
elif os.path.isdir(src_name):
|
| 173 |
+
yield from copy_tree(
|
| 174 |
+
src_name,
|
| 175 |
+
dst_name,
|
| 176 |
+
preserve_mode,
|
| 177 |
+
preserve_times,
|
| 178 |
+
preserve_symlinks,
|
| 179 |
+
update,
|
| 180 |
+
verbose=verbose,
|
| 181 |
+
)
|
| 182 |
+
else:
|
| 183 |
+
file_util.copy_file(
|
| 184 |
+
src_name,
|
| 185 |
+
dst_name,
|
| 186 |
+
preserve_mode,
|
| 187 |
+
preserve_times,
|
| 188 |
+
update,
|
| 189 |
+
verbose=verbose,
|
| 190 |
+
)
|
| 191 |
+
yield dst_name
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
def _build_cmdtuple(path, cmdtuples):
|
| 195 |
+
"""Helper for remove_tree()."""
|
| 196 |
+
for f in os.listdir(path):
|
| 197 |
+
real_f = os.path.join(path, f)
|
| 198 |
+
if os.path.isdir(real_f) and not os.path.islink(real_f):
|
| 199 |
+
_build_cmdtuple(real_f, cmdtuples)
|
| 200 |
+
else:
|
| 201 |
+
cmdtuples.append((os.remove, real_f))
|
| 202 |
+
cmdtuples.append((os.rmdir, path))
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
def remove_tree(directory, verbose=True):
|
| 206 |
+
"""Recursively remove an entire directory tree.
|
| 207 |
+
|
| 208 |
+
Any errors are ignored (apart from being reported to stdout if 'verbose'
|
| 209 |
+
is true).
|
| 210 |
+
"""
|
| 211 |
+
if verbose >= 1:
|
| 212 |
+
log.info("removing '%s' (and everything under it)", directory)
|
| 213 |
+
cmdtuples = []
|
| 214 |
+
_build_cmdtuple(directory, cmdtuples)
|
| 215 |
+
for cmd in cmdtuples:
|
| 216 |
+
try:
|
| 217 |
+
cmd[0](cmd[1])
|
| 218 |
+
# Clear the cache
|
| 219 |
+
SkipRepeatAbsolutePaths.clear()
|
| 220 |
+
except OSError as exc:
|
| 221 |
+
log.warning("error removing %s: %s", directory, exc)
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
def ensure_relative(path):
|
| 225 |
+
"""Take the full path 'path', and make it a relative path.
|
| 226 |
+
|
| 227 |
+
This is useful to make 'path' the second argument to os.path.join().
|
| 228 |
+
"""
|
| 229 |
+
drive, path = os.path.splitdrive(path)
|
| 230 |
+
if path[0:1] == os.sep:
|
| 231 |
+
path = drive + path[1:]
|
| 232 |
+
return path
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/dist.py
ADDED
|
@@ -0,0 +1,1384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.dist
|
| 2 |
+
|
| 3 |
+
Provides the Distribution class, which represents the module distribution
|
| 4 |
+
being built/installed/distributed.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import contextlib
|
| 10 |
+
import logging
|
| 11 |
+
import os
|
| 12 |
+
import pathlib
|
| 13 |
+
import re
|
| 14 |
+
import sys
|
| 15 |
+
import warnings
|
| 16 |
+
from collections.abc import Iterable, MutableMapping
|
| 17 |
+
from email import message_from_file
|
| 18 |
+
from typing import (
|
| 19 |
+
IO,
|
| 20 |
+
TYPE_CHECKING,
|
| 21 |
+
Any,
|
| 22 |
+
ClassVar,
|
| 23 |
+
Literal,
|
| 24 |
+
TypeVar,
|
| 25 |
+
Union,
|
| 26 |
+
overload,
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
from packaging.utils import canonicalize_name, canonicalize_version
|
| 30 |
+
|
| 31 |
+
from ._log import log
|
| 32 |
+
from .debug import DEBUG
|
| 33 |
+
from .errors import (
|
| 34 |
+
DistutilsArgError,
|
| 35 |
+
DistutilsClassError,
|
| 36 |
+
DistutilsModuleError,
|
| 37 |
+
DistutilsOptionError,
|
| 38 |
+
)
|
| 39 |
+
from .fancy_getopt import FancyGetopt, translate_longopt
|
| 40 |
+
from .util import check_environ, rfc822_escape, strtobool
|
| 41 |
+
|
| 42 |
+
if TYPE_CHECKING:
|
| 43 |
+
from _typeshed import SupportsWrite
|
| 44 |
+
from typing_extensions import TypeAlias
|
| 45 |
+
|
| 46 |
+
# type-only import because of mutual dependence between these modules
|
| 47 |
+
from .cmd import Command
|
| 48 |
+
|
| 49 |
+
_CommandT = TypeVar("_CommandT", bound="Command")
|
| 50 |
+
_OptionsList: TypeAlias = list[
|
| 51 |
+
Union[tuple[str, Union[str, None], str, int], tuple[str, Union[str, None], str]]
|
| 52 |
+
]
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
# Regex to define acceptable Distutils command names. This is not *quite*
|
| 56 |
+
# the same as a Python NAME -- I don't allow leading underscores. The fact
|
| 57 |
+
# that they're very similar is no coincidence; the default naming scheme is
|
| 58 |
+
# to look for a Python module named after the command.
|
| 59 |
+
command_re = re.compile(r'^[a-zA-Z]([a-zA-Z0-9_]*)$')
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def _ensure_list(value: str | Iterable[str], fieldname) -> str | list[str]:
|
| 63 |
+
if isinstance(value, str):
|
| 64 |
+
# a string containing comma separated values is okay. It will
|
| 65 |
+
# be converted to a list by Distribution.finalize_options().
|
| 66 |
+
pass
|
| 67 |
+
elif not isinstance(value, list):
|
| 68 |
+
# passing a tuple or an iterator perhaps, warn and convert
|
| 69 |
+
typename = type(value).__name__
|
| 70 |
+
msg = "Warning: '{fieldname}' should be a list, got type '{typename}'"
|
| 71 |
+
msg = msg.format(**locals())
|
| 72 |
+
log.warning(msg)
|
| 73 |
+
value = list(value)
|
| 74 |
+
return value
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
class Distribution:
|
| 78 |
+
"""The core of the Distutils. Most of the work hiding behind 'setup'
|
| 79 |
+
is really done within a Distribution instance, which farms the work out
|
| 80 |
+
to the Distutils commands specified on the command line.
|
| 81 |
+
|
| 82 |
+
Setup scripts will almost never instantiate Distribution directly,
|
| 83 |
+
unless the 'setup()' function is totally inadequate to their needs.
|
| 84 |
+
However, it is conceivable that a setup script might wish to subclass
|
| 85 |
+
Distribution for some specialized purpose, and then pass the subclass
|
| 86 |
+
to 'setup()' as the 'distclass' keyword argument. If so, it is
|
| 87 |
+
necessary to respect the expectations that 'setup' has of Distribution.
|
| 88 |
+
See the code for 'setup()', in core.py, for details.
|
| 89 |
+
"""
|
| 90 |
+
|
| 91 |
+
# 'global_options' describes the command-line options that may be
|
| 92 |
+
# supplied to the setup script prior to any actual commands.
|
| 93 |
+
# Eg. "./setup.py -n" or "./setup.py --quiet" both take advantage of
|
| 94 |
+
# these global options. This list should be kept to a bare minimum,
|
| 95 |
+
# since every global option is also valid as a command option -- and we
|
| 96 |
+
# don't want to pollute the commands with too many options that they
|
| 97 |
+
# have minimal control over.
|
| 98 |
+
# The fourth entry for verbose means that it can be repeated.
|
| 99 |
+
global_options: ClassVar[_OptionsList] = [
|
| 100 |
+
('verbose', 'v', "run verbosely (default)", 1),
|
| 101 |
+
('quiet', 'q', "run quietly (turns verbosity off)"),
|
| 102 |
+
('help', 'h', "show detailed help message"),
|
| 103 |
+
('no-user-cfg', None, 'ignore pydistutils.cfg in your home directory'),
|
| 104 |
+
]
|
| 105 |
+
|
| 106 |
+
# 'common_usage' is a short (2-3 line) string describing the common
|
| 107 |
+
# usage of the setup script.
|
| 108 |
+
common_usage: ClassVar[str] = """\
|
| 109 |
+
Common commands: (see '--help-commands' for more)
|
| 110 |
+
|
| 111 |
+
setup.py build will build the package underneath 'build/'
|
| 112 |
+
setup.py install will install the package
|
| 113 |
+
"""
|
| 114 |
+
|
| 115 |
+
# options that are not propagated to the commands
|
| 116 |
+
display_options: ClassVar[_OptionsList] = [
|
| 117 |
+
('help-commands', None, "list all available commands"),
|
| 118 |
+
('name', None, "print package name"),
|
| 119 |
+
('version', 'V', "print package version"),
|
| 120 |
+
('fullname', None, "print <package name>-<version>"),
|
| 121 |
+
('author', None, "print the author's name"),
|
| 122 |
+
('author-email', None, "print the author's email address"),
|
| 123 |
+
('maintainer', None, "print the maintainer's name"),
|
| 124 |
+
('maintainer-email', None, "print the maintainer's email address"),
|
| 125 |
+
('contact', None, "print the maintainer's name if known, else the author's"),
|
| 126 |
+
(
|
| 127 |
+
'contact-email',
|
| 128 |
+
None,
|
| 129 |
+
"print the maintainer's email address if known, else the author's",
|
| 130 |
+
),
|
| 131 |
+
('url', None, "print the URL for this package"),
|
| 132 |
+
('license', None, "print the license of the package"),
|
| 133 |
+
('licence', None, "alias for --license"),
|
| 134 |
+
('description', None, "print the package description"),
|
| 135 |
+
('long-description', None, "print the long package description"),
|
| 136 |
+
('platforms', None, "print the list of platforms"),
|
| 137 |
+
('classifiers', None, "print the list of classifiers"),
|
| 138 |
+
('keywords', None, "print the list of keywords"),
|
| 139 |
+
('provides', None, "print the list of packages/modules provided"),
|
| 140 |
+
('requires', None, "print the list of packages/modules required"),
|
| 141 |
+
('obsoletes', None, "print the list of packages/modules made obsolete"),
|
| 142 |
+
]
|
| 143 |
+
display_option_names: ClassVar[list[str]] = [
|
| 144 |
+
translate_longopt(x[0]) for x in display_options
|
| 145 |
+
]
|
| 146 |
+
|
| 147 |
+
# negative options are options that exclude other options
|
| 148 |
+
negative_opt: ClassVar[dict[str, str]] = {'quiet': 'verbose'}
|
| 149 |
+
|
| 150 |
+
# -- Creation/initialization methods -------------------------------
|
| 151 |
+
|
| 152 |
+
# Can't Unpack a TypedDict with optional properties, so using Any instead
|
| 153 |
+
def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None: # noqa: C901
|
| 154 |
+
"""Construct a new Distribution instance: initialize all the
|
| 155 |
+
attributes of a Distribution, and then use 'attrs' (a dictionary
|
| 156 |
+
mapping attribute names to values) to assign some of those
|
| 157 |
+
attributes their "real" values. (Any attributes not mentioned in
|
| 158 |
+
'attrs' will be assigned to some null value: 0, None, an empty list
|
| 159 |
+
or dictionary, etc.) Most importantly, initialize the
|
| 160 |
+
'command_obj' attribute to the empty dictionary; this will be
|
| 161 |
+
filled in with real command objects by 'parse_command_line()'.
|
| 162 |
+
"""
|
| 163 |
+
|
| 164 |
+
# Default values for our command-line options
|
| 165 |
+
self.verbose = True
|
| 166 |
+
self.help = False
|
| 167 |
+
for attr in self.display_option_names:
|
| 168 |
+
setattr(self, attr, False)
|
| 169 |
+
|
| 170 |
+
# Store the distribution meta-data (name, version, author, and so
|
| 171 |
+
# forth) in a separate object -- we're getting to have enough
|
| 172 |
+
# information here (and enough command-line options) that it's
|
| 173 |
+
# worth it. Also delegate 'get_XXX()' methods to the 'metadata'
|
| 174 |
+
# object in a sneaky and underhanded (but efficient!) way.
|
| 175 |
+
self.metadata = DistributionMetadata()
|
| 176 |
+
for basename in self.metadata._METHOD_BASENAMES:
|
| 177 |
+
method_name = "get_" + basename
|
| 178 |
+
setattr(self, method_name, getattr(self.metadata, method_name))
|
| 179 |
+
|
| 180 |
+
# 'cmdclass' maps command names to class objects, so we
|
| 181 |
+
# can 1) quickly figure out which class to instantiate when
|
| 182 |
+
# we need to create a new command object, and 2) have a way
|
| 183 |
+
# for the setup script to override command classes
|
| 184 |
+
self.cmdclass: dict[str, type[Command]] = {}
|
| 185 |
+
|
| 186 |
+
# 'command_packages' is a list of packages in which commands
|
| 187 |
+
# are searched for. The factory for command 'foo' is expected
|
| 188 |
+
# to be named 'foo' in the module 'foo' in one of the packages
|
| 189 |
+
# named here. This list is searched from the left; an error
|
| 190 |
+
# is raised if no named package provides the command being
|
| 191 |
+
# searched for. (Always access using get_command_packages().)
|
| 192 |
+
self.command_packages: str | list[str] | None = None
|
| 193 |
+
|
| 194 |
+
# 'script_name' and 'script_args' are usually set to sys.argv[0]
|
| 195 |
+
# and sys.argv[1:], but they can be overridden when the caller is
|
| 196 |
+
# not necessarily a setup script run from the command-line.
|
| 197 |
+
self.script_name: str | os.PathLike[str] | None = None
|
| 198 |
+
self.script_args: list[str] | None = None
|
| 199 |
+
|
| 200 |
+
# 'command_options' is where we store command options between
|
| 201 |
+
# parsing them (from config files, the command-line, etc.) and when
|
| 202 |
+
# they are actually needed -- ie. when the command in question is
|
| 203 |
+
# instantiated. It is a dictionary of dictionaries of 2-tuples:
|
| 204 |
+
# command_options = { command_name : { option : (source, value) } }
|
| 205 |
+
self.command_options: dict[str, dict[str, tuple[str, str]]] = {}
|
| 206 |
+
|
| 207 |
+
# 'dist_files' is the list of (command, pyversion, file) that
|
| 208 |
+
# have been created by any dist commands run so far. This is
|
| 209 |
+
# filled regardless of whether the run is dry or not. pyversion
|
| 210 |
+
# gives sysconfig.get_python_version() if the dist file is
|
| 211 |
+
# specific to a Python version, 'any' if it is good for all
|
| 212 |
+
# Python versions on the target platform, and '' for a source
|
| 213 |
+
# file. pyversion should not be used to specify minimum or
|
| 214 |
+
# maximum required Python versions; use the metainfo for that
|
| 215 |
+
# instead.
|
| 216 |
+
self.dist_files: list[tuple[str, str, str]] = []
|
| 217 |
+
|
| 218 |
+
# These options are really the business of various commands, rather
|
| 219 |
+
# than of the Distribution itself. We provide aliases for them in
|
| 220 |
+
# Distribution as a convenience to the developer.
|
| 221 |
+
self.packages = None
|
| 222 |
+
self.package_data: dict[str, list[str]] = {}
|
| 223 |
+
self.package_dir = None
|
| 224 |
+
self.py_modules = None
|
| 225 |
+
self.libraries = None
|
| 226 |
+
self.headers = None
|
| 227 |
+
self.ext_modules = None
|
| 228 |
+
self.ext_package = None
|
| 229 |
+
self.include_dirs = None
|
| 230 |
+
self.extra_path = None
|
| 231 |
+
self.scripts = None
|
| 232 |
+
self.data_files = None
|
| 233 |
+
self.password = ''
|
| 234 |
+
|
| 235 |
+
# And now initialize bookkeeping stuff that can't be supplied by
|
| 236 |
+
# the caller at all. 'command_obj' maps command names to
|
| 237 |
+
# Command instances -- that's how we enforce that every command
|
| 238 |
+
# class is a singleton.
|
| 239 |
+
self.command_obj: dict[str, Command] = {}
|
| 240 |
+
|
| 241 |
+
# 'have_run' maps command names to boolean values; it keeps track
|
| 242 |
+
# of whether we have actually run a particular command, to make it
|
| 243 |
+
# cheap to "run" a command whenever we think we might need to -- if
|
| 244 |
+
# it's already been done, no need for expensive filesystem
|
| 245 |
+
# operations, we just check the 'have_run' dictionary and carry on.
|
| 246 |
+
# It's only safe to query 'have_run' for a command class that has
|
| 247 |
+
# been instantiated -- a false value will be inserted when the
|
| 248 |
+
# command object is created, and replaced with a true value when
|
| 249 |
+
# the command is successfully run. Thus it's probably best to use
|
| 250 |
+
# '.get()' rather than a straight lookup.
|
| 251 |
+
self.have_run: dict[str, bool] = {}
|
| 252 |
+
|
| 253 |
+
# Now we'll use the attrs dictionary (ultimately, keyword args from
|
| 254 |
+
# the setup script) to possibly override any or all of these
|
| 255 |
+
# distribution options.
|
| 256 |
+
|
| 257 |
+
if attrs:
|
| 258 |
+
# Pull out the set of command options and work on them
|
| 259 |
+
# specifically. Note that this order guarantees that aliased
|
| 260 |
+
# command options will override any supplied redundantly
|
| 261 |
+
# through the general options dictionary.
|
| 262 |
+
options = attrs.get('options')
|
| 263 |
+
if options is not None:
|
| 264 |
+
del attrs['options']
|
| 265 |
+
for command, cmd_options in options.items():
|
| 266 |
+
opt_dict = self.get_option_dict(command)
|
| 267 |
+
for opt, val in cmd_options.items():
|
| 268 |
+
opt_dict[opt] = ("setup script", val)
|
| 269 |
+
|
| 270 |
+
if 'licence' in attrs:
|
| 271 |
+
attrs['license'] = attrs['licence']
|
| 272 |
+
del attrs['licence']
|
| 273 |
+
msg = "'licence' distribution option is deprecated; use 'license'"
|
| 274 |
+
warnings.warn(msg)
|
| 275 |
+
|
| 276 |
+
# Now work on the rest of the attributes. Any attribute that's
|
| 277 |
+
# not already defined is invalid!
|
| 278 |
+
for key, val in attrs.items():
|
| 279 |
+
if hasattr(self.metadata, "set_" + key):
|
| 280 |
+
getattr(self.metadata, "set_" + key)(val)
|
| 281 |
+
elif hasattr(self.metadata, key):
|
| 282 |
+
setattr(self.metadata, key, val)
|
| 283 |
+
elif hasattr(self, key):
|
| 284 |
+
setattr(self, key, val)
|
| 285 |
+
else:
|
| 286 |
+
msg = f"Unknown distribution option: {key!r}"
|
| 287 |
+
warnings.warn(msg)
|
| 288 |
+
|
| 289 |
+
# no-user-cfg is handled before other command line args
|
| 290 |
+
# because other args override the config files, and this
|
| 291 |
+
# one is needed before we can load the config files.
|
| 292 |
+
# If attrs['script_args'] wasn't passed, assume false.
|
| 293 |
+
#
|
| 294 |
+
# This also make sure we just look at the global options
|
| 295 |
+
self.want_user_cfg = True
|
| 296 |
+
|
| 297 |
+
if self.script_args is not None:
|
| 298 |
+
# Coerce any possible iterable from attrs into a list
|
| 299 |
+
self.script_args = list(self.script_args)
|
| 300 |
+
for arg in self.script_args:
|
| 301 |
+
if not arg.startswith('-'):
|
| 302 |
+
break
|
| 303 |
+
if arg == '--no-user-cfg':
|
| 304 |
+
self.want_user_cfg = False
|
| 305 |
+
break
|
| 306 |
+
|
| 307 |
+
self.finalize_options()
|
| 308 |
+
|
| 309 |
+
def get_option_dict(self, command):
|
| 310 |
+
"""Get the option dictionary for a given command. If that
|
| 311 |
+
command's option dictionary hasn't been created yet, then create it
|
| 312 |
+
and return the new dictionary; otherwise, return the existing
|
| 313 |
+
option dictionary.
|
| 314 |
+
"""
|
| 315 |
+
dict = self.command_options.get(command)
|
| 316 |
+
if dict is None:
|
| 317 |
+
dict = self.command_options[command] = {}
|
| 318 |
+
return dict
|
| 319 |
+
|
| 320 |
+
def dump_option_dicts(self, header=None, commands=None, indent: str = "") -> None:
|
| 321 |
+
from pprint import pformat
|
| 322 |
+
|
| 323 |
+
if commands is None: # dump all command option dicts
|
| 324 |
+
commands = sorted(self.command_options.keys())
|
| 325 |
+
|
| 326 |
+
if header is not None:
|
| 327 |
+
self.announce(indent + header)
|
| 328 |
+
indent = indent + " "
|
| 329 |
+
|
| 330 |
+
if not commands:
|
| 331 |
+
self.announce(indent + "no commands known yet")
|
| 332 |
+
return
|
| 333 |
+
|
| 334 |
+
for cmd_name in commands:
|
| 335 |
+
opt_dict = self.command_options.get(cmd_name)
|
| 336 |
+
if opt_dict is None:
|
| 337 |
+
self.announce(indent + f"no option dict for '{cmd_name}' command")
|
| 338 |
+
else:
|
| 339 |
+
self.announce(indent + f"option dict for '{cmd_name}' command:")
|
| 340 |
+
out = pformat(opt_dict)
|
| 341 |
+
for line in out.split('\n'):
|
| 342 |
+
self.announce(indent + " " + line)
|
| 343 |
+
|
| 344 |
+
# -- Config file finding/parsing methods ---------------------------
|
| 345 |
+
|
| 346 |
+
def find_config_files(self):
|
| 347 |
+
"""Find as many configuration files as should be processed for this
|
| 348 |
+
platform, and return a list of filenames in the order in which they
|
| 349 |
+
should be parsed. The filenames returned are guaranteed to exist
|
| 350 |
+
(modulo nasty race conditions).
|
| 351 |
+
|
| 352 |
+
There are multiple possible config files:
|
| 353 |
+
- distutils.cfg in the Distutils installation directory (i.e.
|
| 354 |
+
where the top-level Distutils __inst__.py file lives)
|
| 355 |
+
- a file in the user's home directory named .pydistutils.cfg
|
| 356 |
+
on Unix and pydistutils.cfg on Windows/Mac; may be disabled
|
| 357 |
+
with the ``--no-user-cfg`` option
|
| 358 |
+
- setup.cfg in the current directory
|
| 359 |
+
- a file named by an environment variable
|
| 360 |
+
"""
|
| 361 |
+
check_environ()
|
| 362 |
+
files = [str(path) for path in self._gen_paths() if os.path.isfile(path)]
|
| 363 |
+
|
| 364 |
+
if DEBUG:
|
| 365 |
+
self.announce("using config files: {}".format(', '.join(files)))
|
| 366 |
+
|
| 367 |
+
return files
|
| 368 |
+
|
| 369 |
+
def _gen_paths(self):
|
| 370 |
+
# The system-wide Distutils config file
|
| 371 |
+
sys_dir = pathlib.Path(sys.modules['distutils'].__file__).parent
|
| 372 |
+
yield sys_dir / "distutils.cfg"
|
| 373 |
+
|
| 374 |
+
# The per-user config file
|
| 375 |
+
prefix = '.' * (os.name == 'posix')
|
| 376 |
+
filename = prefix + 'pydistutils.cfg'
|
| 377 |
+
if self.want_user_cfg:
|
| 378 |
+
with contextlib.suppress(RuntimeError):
|
| 379 |
+
yield pathlib.Path('~').expanduser() / filename
|
| 380 |
+
|
| 381 |
+
# All platforms support local setup.cfg
|
| 382 |
+
yield pathlib.Path('setup.cfg')
|
| 383 |
+
|
| 384 |
+
# Additional config indicated in the environment
|
| 385 |
+
with contextlib.suppress(TypeError):
|
| 386 |
+
yield pathlib.Path(os.getenv("DIST_EXTRA_CONFIG"))
|
| 387 |
+
|
| 388 |
+
def parse_config_files(self, filenames=None): # noqa: C901
|
| 389 |
+
from configparser import ConfigParser
|
| 390 |
+
|
| 391 |
+
# Ignore install directory options if we have a venv
|
| 392 |
+
if sys.prefix != sys.base_prefix:
|
| 393 |
+
ignore_options = [
|
| 394 |
+
'install-base',
|
| 395 |
+
'install-platbase',
|
| 396 |
+
'install-lib',
|
| 397 |
+
'install-platlib',
|
| 398 |
+
'install-purelib',
|
| 399 |
+
'install-headers',
|
| 400 |
+
'install-scripts',
|
| 401 |
+
'install-data',
|
| 402 |
+
'prefix',
|
| 403 |
+
'exec-prefix',
|
| 404 |
+
'home',
|
| 405 |
+
'user',
|
| 406 |
+
'root',
|
| 407 |
+
]
|
| 408 |
+
else:
|
| 409 |
+
ignore_options = []
|
| 410 |
+
|
| 411 |
+
ignore_options = frozenset(ignore_options)
|
| 412 |
+
|
| 413 |
+
if filenames is None:
|
| 414 |
+
filenames = self.find_config_files()
|
| 415 |
+
|
| 416 |
+
if DEBUG:
|
| 417 |
+
self.announce("Distribution.parse_config_files():")
|
| 418 |
+
|
| 419 |
+
parser = ConfigParser()
|
| 420 |
+
for filename in filenames:
|
| 421 |
+
if DEBUG:
|
| 422 |
+
self.announce(f" reading {filename}")
|
| 423 |
+
parser.read(filename, encoding='utf-8')
|
| 424 |
+
for section in parser.sections():
|
| 425 |
+
options = parser.options(section)
|
| 426 |
+
opt_dict = self.get_option_dict(section)
|
| 427 |
+
|
| 428 |
+
for opt in options:
|
| 429 |
+
if opt != '__name__' and opt not in ignore_options:
|
| 430 |
+
val = parser.get(section, opt)
|
| 431 |
+
opt = opt.replace('-', '_')
|
| 432 |
+
opt_dict[opt] = (filename, val)
|
| 433 |
+
|
| 434 |
+
# Make the ConfigParser forget everything (so we retain
|
| 435 |
+
# the original filenames that options come from)
|
| 436 |
+
parser.__init__()
|
| 437 |
+
|
| 438 |
+
# If there was a "global" section in the config file, use it
|
| 439 |
+
# to set Distribution options.
|
| 440 |
+
|
| 441 |
+
if 'global' in self.command_options:
|
| 442 |
+
for opt, (_src, val) in self.command_options['global'].items():
|
| 443 |
+
alias = self.negative_opt.get(opt)
|
| 444 |
+
try:
|
| 445 |
+
if alias:
|
| 446 |
+
setattr(self, alias, not strtobool(val))
|
| 447 |
+
elif opt in ('verbose',): # ugh!
|
| 448 |
+
setattr(self, opt, strtobool(val))
|
| 449 |
+
else:
|
| 450 |
+
setattr(self, opt, val)
|
| 451 |
+
except ValueError as msg:
|
| 452 |
+
raise DistutilsOptionError(msg)
|
| 453 |
+
|
| 454 |
+
# -- Command-line parsing methods ----------------------------------
|
| 455 |
+
|
| 456 |
+
def parse_command_line(self):
|
| 457 |
+
"""Parse the setup script's command line, taken from the
|
| 458 |
+
'script_args' instance attribute (which defaults to 'sys.argv[1:]'
|
| 459 |
+
-- see 'setup()' in core.py). This list is first processed for
|
| 460 |
+
"global options" -- options that set attributes of the Distribution
|
| 461 |
+
instance. Then, it is alternately scanned for Distutils commands
|
| 462 |
+
and options for that command. Each new command terminates the
|
| 463 |
+
options for the previous command. The allowed options for a
|
| 464 |
+
command are determined by the 'user_options' attribute of the
|
| 465 |
+
command class -- thus, we have to be able to load command classes
|
| 466 |
+
in order to parse the command line. Any error in that 'options'
|
| 467 |
+
attribute raises DistutilsGetoptError; any error on the
|
| 468 |
+
command-line raises DistutilsArgError. If no Distutils commands
|
| 469 |
+
were found on the command line, raises DistutilsArgError. Return
|
| 470 |
+
true if command-line was successfully parsed and we should carry
|
| 471 |
+
on with executing commands; false if no errors but we shouldn't
|
| 472 |
+
execute commands (currently, this only happens if user asks for
|
| 473 |
+
help).
|
| 474 |
+
"""
|
| 475 |
+
#
|
| 476 |
+
# We now have enough information to show the Macintosh dialog
|
| 477 |
+
# that allows the user to interactively specify the "command line".
|
| 478 |
+
#
|
| 479 |
+
toplevel_options = self._get_toplevel_options()
|
| 480 |
+
|
| 481 |
+
# We have to parse the command line a bit at a time -- global
|
| 482 |
+
# options, then the first command, then its options, and so on --
|
| 483 |
+
# because each command will be handled by a different class, and
|
| 484 |
+
# the options that are valid for a particular class aren't known
|
| 485 |
+
# until we have loaded the command class, which doesn't happen
|
| 486 |
+
# until we know what the command is.
|
| 487 |
+
|
| 488 |
+
self.commands = []
|
| 489 |
+
parser = FancyGetopt(toplevel_options + self.display_options)
|
| 490 |
+
parser.set_negative_aliases(self.negative_opt)
|
| 491 |
+
parser.set_aliases({'licence': 'license'})
|
| 492 |
+
args = parser.getopt(args=self.script_args, object=self)
|
| 493 |
+
option_order = parser.get_option_order()
|
| 494 |
+
logging.getLogger().setLevel(logging.WARN - 10 * self.verbose)
|
| 495 |
+
|
| 496 |
+
# for display options we return immediately
|
| 497 |
+
if self.handle_display_options(option_order):
|
| 498 |
+
return
|
| 499 |
+
while args:
|
| 500 |
+
args = self._parse_command_opts(parser, args)
|
| 501 |
+
if args is None: # user asked for help (and got it)
|
| 502 |
+
return
|
| 503 |
+
|
| 504 |
+
# Handle the cases of --help as a "global" option, ie.
|
| 505 |
+
# "setup.py --help" and "setup.py --help command ...". For the
|
| 506 |
+
# former, we show global options (--verbose, --dry-run, etc.)
|
| 507 |
+
# and display-only options (--name, --version, etc.); for the
|
| 508 |
+
# latter, we omit the display-only options and show help for
|
| 509 |
+
# each command listed on the command line.
|
| 510 |
+
if self.help:
|
| 511 |
+
self._show_help(
|
| 512 |
+
parser, display_options=len(self.commands) == 0, commands=self.commands
|
| 513 |
+
)
|
| 514 |
+
return
|
| 515 |
+
|
| 516 |
+
# Oops, no commands found -- an end-user error
|
| 517 |
+
if not self.commands:
|
| 518 |
+
raise DistutilsArgError("no commands supplied")
|
| 519 |
+
|
| 520 |
+
# All is well: return true
|
| 521 |
+
return True
|
| 522 |
+
|
| 523 |
+
def _get_toplevel_options(self):
|
| 524 |
+
"""Return the non-display options recognized at the top level.
|
| 525 |
+
|
| 526 |
+
This includes options that are recognized *only* at the top
|
| 527 |
+
level as well as options recognized for commands.
|
| 528 |
+
"""
|
| 529 |
+
return self.global_options + [
|
| 530 |
+
(
|
| 531 |
+
"command-packages=",
|
| 532 |
+
None,
|
| 533 |
+
"list of packages that provide distutils commands",
|
| 534 |
+
),
|
| 535 |
+
]
|
| 536 |
+
|
| 537 |
+
def _parse_command_opts(self, parser, args): # noqa: C901
|
| 538 |
+
"""Parse the command-line options for a single command.
|
| 539 |
+
'parser' must be a FancyGetopt instance; 'args' must be the list
|
| 540 |
+
of arguments, starting with the current command (whose options
|
| 541 |
+
we are about to parse). Returns a new version of 'args' with
|
| 542 |
+
the next command at the front of the list; will be the empty
|
| 543 |
+
list if there are no more commands on the command line. Returns
|
| 544 |
+
None if the user asked for help on this command.
|
| 545 |
+
"""
|
| 546 |
+
# late import because of mutual dependence between these modules
|
| 547 |
+
from distutils.cmd import Command
|
| 548 |
+
|
| 549 |
+
# Pull the current command from the head of the command line
|
| 550 |
+
command = args[0]
|
| 551 |
+
if not command_re.match(command):
|
| 552 |
+
raise SystemExit(f"invalid command name '{command}'")
|
| 553 |
+
self.commands.append(command)
|
| 554 |
+
|
| 555 |
+
# Dig up the command class that implements this command, so we
|
| 556 |
+
# 1) know that it's a valid command, and 2) know which options
|
| 557 |
+
# it takes.
|
| 558 |
+
try:
|
| 559 |
+
cmd_class = self.get_command_class(command)
|
| 560 |
+
except DistutilsModuleError as msg:
|
| 561 |
+
raise DistutilsArgError(msg)
|
| 562 |
+
|
| 563 |
+
# Require that the command class be derived from Command -- want
|
| 564 |
+
# to be sure that the basic "command" interface is implemented.
|
| 565 |
+
if not issubclass(cmd_class, Command):
|
| 566 |
+
raise DistutilsClassError(
|
| 567 |
+
f"command class {cmd_class} must subclass Command"
|
| 568 |
+
)
|
| 569 |
+
|
| 570 |
+
# Also make sure that the command object provides a list of its
|
| 571 |
+
# known options.
|
| 572 |
+
if not (
|
| 573 |
+
hasattr(cmd_class, 'user_options')
|
| 574 |
+
and isinstance(cmd_class.user_options, list)
|
| 575 |
+
):
|
| 576 |
+
msg = (
|
| 577 |
+
"command class %s must provide "
|
| 578 |
+
"'user_options' attribute (a list of tuples)"
|
| 579 |
+
)
|
| 580 |
+
raise DistutilsClassError(msg % cmd_class)
|
| 581 |
+
|
| 582 |
+
# If the command class has a list of negative alias options,
|
| 583 |
+
# merge it in with the global negative aliases.
|
| 584 |
+
negative_opt = self.negative_opt
|
| 585 |
+
if hasattr(cmd_class, 'negative_opt'):
|
| 586 |
+
negative_opt = negative_opt.copy()
|
| 587 |
+
negative_opt.update(cmd_class.negative_opt)
|
| 588 |
+
|
| 589 |
+
# Check for help_options in command class. They have a different
|
| 590 |
+
# format (tuple of four) so we need to preprocess them here.
|
| 591 |
+
if hasattr(cmd_class, 'help_options') and isinstance(
|
| 592 |
+
cmd_class.help_options, list
|
| 593 |
+
):
|
| 594 |
+
help_options = fix_help_options(cmd_class.help_options)
|
| 595 |
+
else:
|
| 596 |
+
help_options = []
|
| 597 |
+
|
| 598 |
+
# All commands support the global options too, just by adding
|
| 599 |
+
# in 'global_options'.
|
| 600 |
+
parser.set_option_table(
|
| 601 |
+
self.global_options + cmd_class.user_options + help_options
|
| 602 |
+
)
|
| 603 |
+
parser.set_negative_aliases(negative_opt)
|
| 604 |
+
(args, opts) = parser.getopt(args[1:])
|
| 605 |
+
if hasattr(opts, 'help') and opts.help:
|
| 606 |
+
self._show_help(parser, display_options=False, commands=[cmd_class])
|
| 607 |
+
return
|
| 608 |
+
|
| 609 |
+
if hasattr(cmd_class, 'help_options') and isinstance(
|
| 610 |
+
cmd_class.help_options, list
|
| 611 |
+
):
|
| 612 |
+
help_option_found = 0
|
| 613 |
+
for help_option, _short, _desc, func in cmd_class.help_options:
|
| 614 |
+
if hasattr(opts, parser.get_attr_name(help_option)):
|
| 615 |
+
help_option_found = 1
|
| 616 |
+
if callable(func):
|
| 617 |
+
func()
|
| 618 |
+
else:
|
| 619 |
+
raise DistutilsClassError(
|
| 620 |
+
f"invalid help function {func!r} for help option '{help_option}': "
|
| 621 |
+
"must be a callable object (function, etc.)"
|
| 622 |
+
)
|
| 623 |
+
|
| 624 |
+
if help_option_found:
|
| 625 |
+
return
|
| 626 |
+
|
| 627 |
+
# Put the options from the command-line into their official
|
| 628 |
+
# holding pen, the 'command_options' dictionary.
|
| 629 |
+
opt_dict = self.get_option_dict(command)
|
| 630 |
+
for name, value in vars(opts).items():
|
| 631 |
+
opt_dict[name] = ("command line", value)
|
| 632 |
+
|
| 633 |
+
return args
|
| 634 |
+
|
| 635 |
+
def finalize_options(self) -> None:
|
| 636 |
+
"""Set final values for all the options on the Distribution
|
| 637 |
+
instance, analogous to the .finalize_options() method of Command
|
| 638 |
+
objects.
|
| 639 |
+
"""
|
| 640 |
+
for attr in ('keywords', 'platforms'):
|
| 641 |
+
value = getattr(self.metadata, attr)
|
| 642 |
+
if value is None:
|
| 643 |
+
continue
|
| 644 |
+
if isinstance(value, str):
|
| 645 |
+
value = [elm.strip() for elm in value.split(',')]
|
| 646 |
+
setattr(self.metadata, attr, value)
|
| 647 |
+
|
| 648 |
+
def _show_help(
|
| 649 |
+
self, parser, global_options=True, display_options=True, commands: Iterable = ()
|
| 650 |
+
):
|
| 651 |
+
"""Show help for the setup script command-line in the form of
|
| 652 |
+
several lists of command-line options. 'parser' should be a
|
| 653 |
+
FancyGetopt instance; do not expect it to be returned in the
|
| 654 |
+
same state, as its option table will be reset to make it
|
| 655 |
+
generate the correct help text.
|
| 656 |
+
|
| 657 |
+
If 'global_options' is true, lists the global options:
|
| 658 |
+
--verbose, --dry-run, etc. If 'display_options' is true, lists
|
| 659 |
+
the "display-only" options: --name, --version, etc. Finally,
|
| 660 |
+
lists per-command help for every command name or command class
|
| 661 |
+
in 'commands'.
|
| 662 |
+
"""
|
| 663 |
+
# late import because of mutual dependence between these modules
|
| 664 |
+
from distutils.cmd import Command
|
| 665 |
+
from distutils.core import gen_usage
|
| 666 |
+
|
| 667 |
+
if global_options:
|
| 668 |
+
if display_options:
|
| 669 |
+
options = self._get_toplevel_options()
|
| 670 |
+
else:
|
| 671 |
+
options = self.global_options
|
| 672 |
+
parser.set_option_table(options)
|
| 673 |
+
parser.print_help(self.common_usage + "\nGlobal options:")
|
| 674 |
+
print()
|
| 675 |
+
|
| 676 |
+
if display_options:
|
| 677 |
+
parser.set_option_table(self.display_options)
|
| 678 |
+
parser.print_help(
|
| 679 |
+
"Information display options (just display information, ignore any commands)"
|
| 680 |
+
)
|
| 681 |
+
print()
|
| 682 |
+
|
| 683 |
+
for command in commands:
|
| 684 |
+
if isinstance(command, type) and issubclass(command, Command):
|
| 685 |
+
klass = command
|
| 686 |
+
else:
|
| 687 |
+
klass = self.get_command_class(command)
|
| 688 |
+
if hasattr(klass, 'help_options') and isinstance(klass.help_options, list):
|
| 689 |
+
parser.set_option_table(
|
| 690 |
+
klass.user_options + fix_help_options(klass.help_options)
|
| 691 |
+
)
|
| 692 |
+
else:
|
| 693 |
+
parser.set_option_table(klass.user_options)
|
| 694 |
+
parser.print_help(f"Options for '{klass.__name__}' command:")
|
| 695 |
+
print()
|
| 696 |
+
|
| 697 |
+
print(gen_usage(self.script_name))
|
| 698 |
+
|
| 699 |
+
def handle_display_options(self, option_order):
|
| 700 |
+
"""If there were any non-global "display-only" options
|
| 701 |
+
(--help-commands or the metadata display options) on the command
|
| 702 |
+
line, display the requested info and return true; else return
|
| 703 |
+
false.
|
| 704 |
+
"""
|
| 705 |
+
from distutils.core import gen_usage
|
| 706 |
+
|
| 707 |
+
# User just wants a list of commands -- we'll print it out and stop
|
| 708 |
+
# processing now (ie. if they ran "setup --help-commands foo bar",
|
| 709 |
+
# we ignore "foo bar").
|
| 710 |
+
if self.help_commands:
|
| 711 |
+
self.print_commands()
|
| 712 |
+
print()
|
| 713 |
+
print(gen_usage(self.script_name))
|
| 714 |
+
return 1
|
| 715 |
+
|
| 716 |
+
# If user supplied any of the "display metadata" options, then
|
| 717 |
+
# display that metadata in the order in which the user supplied the
|
| 718 |
+
# metadata options.
|
| 719 |
+
any_display_options = 0
|
| 720 |
+
is_display_option = set()
|
| 721 |
+
for option in self.display_options:
|
| 722 |
+
is_display_option.add(option[0])
|
| 723 |
+
|
| 724 |
+
for opt, val in option_order:
|
| 725 |
+
if val and opt in is_display_option:
|
| 726 |
+
opt = translate_longopt(opt)
|
| 727 |
+
value = getattr(self.metadata, "get_" + opt)()
|
| 728 |
+
if opt in ('keywords', 'platforms'):
|
| 729 |
+
print(','.join(value))
|
| 730 |
+
elif opt in ('classifiers', 'provides', 'requires', 'obsoletes'):
|
| 731 |
+
print('\n'.join(value))
|
| 732 |
+
else:
|
| 733 |
+
print(value)
|
| 734 |
+
any_display_options = 1
|
| 735 |
+
|
| 736 |
+
return any_display_options
|
| 737 |
+
|
| 738 |
+
def print_command_list(self, commands, header, max_length) -> None:
|
| 739 |
+
"""Print a subset of the list of all commands -- used by
|
| 740 |
+
'print_commands()'.
|
| 741 |
+
"""
|
| 742 |
+
print(header + ":")
|
| 743 |
+
|
| 744 |
+
for cmd in commands:
|
| 745 |
+
klass = self.cmdclass.get(cmd)
|
| 746 |
+
if not klass:
|
| 747 |
+
klass = self.get_command_class(cmd)
|
| 748 |
+
try:
|
| 749 |
+
description = klass.description
|
| 750 |
+
except AttributeError:
|
| 751 |
+
description = "(no description available)"
|
| 752 |
+
|
| 753 |
+
print(f" {cmd:<{max_length}} {description}")
|
| 754 |
+
|
| 755 |
+
def print_commands(self) -> None:
|
| 756 |
+
"""Print out a help message listing all available commands with a
|
| 757 |
+
description of each. The list is divided into "standard commands"
|
| 758 |
+
(listed in distutils.command.__all__) and "extra commands"
|
| 759 |
+
(mentioned in self.cmdclass, but not a standard command). The
|
| 760 |
+
descriptions come from the command class attribute
|
| 761 |
+
'description'.
|
| 762 |
+
"""
|
| 763 |
+
import distutils.command
|
| 764 |
+
|
| 765 |
+
std_commands = distutils.command.__all__
|
| 766 |
+
is_std = set(std_commands)
|
| 767 |
+
|
| 768 |
+
extra_commands = [cmd for cmd in self.cmdclass.keys() if cmd not in is_std]
|
| 769 |
+
|
| 770 |
+
max_length = 0
|
| 771 |
+
for cmd in std_commands + extra_commands:
|
| 772 |
+
if len(cmd) > max_length:
|
| 773 |
+
max_length = len(cmd)
|
| 774 |
+
|
| 775 |
+
self.print_command_list(std_commands, "Standard commands", max_length)
|
| 776 |
+
if extra_commands:
|
| 777 |
+
print()
|
| 778 |
+
self.print_command_list(extra_commands, "Extra commands", max_length)
|
| 779 |
+
|
| 780 |
+
def get_command_list(self):
|
| 781 |
+
"""Get a list of (command, description) tuples.
|
| 782 |
+
The list is divided into "standard commands" (listed in
|
| 783 |
+
distutils.command.__all__) and "extra commands" (mentioned in
|
| 784 |
+
self.cmdclass, but not a standard command). The descriptions come
|
| 785 |
+
from the command class attribute 'description'.
|
| 786 |
+
"""
|
| 787 |
+
# Currently this is only used on Mac OS, for the Mac-only GUI
|
| 788 |
+
# Distutils interface (by Jack Jansen)
|
| 789 |
+
import distutils.command
|
| 790 |
+
|
| 791 |
+
std_commands = distutils.command.__all__
|
| 792 |
+
is_std = set(std_commands)
|
| 793 |
+
|
| 794 |
+
extra_commands = [cmd for cmd in self.cmdclass.keys() if cmd not in is_std]
|
| 795 |
+
|
| 796 |
+
rv = []
|
| 797 |
+
for cmd in std_commands + extra_commands:
|
| 798 |
+
klass = self.cmdclass.get(cmd)
|
| 799 |
+
if not klass:
|
| 800 |
+
klass = self.get_command_class(cmd)
|
| 801 |
+
try:
|
| 802 |
+
description = klass.description
|
| 803 |
+
except AttributeError:
|
| 804 |
+
description = "(no description available)"
|
| 805 |
+
rv.append((cmd, description))
|
| 806 |
+
return rv
|
| 807 |
+
|
| 808 |
+
# -- Command class/object methods ----------------------------------
|
| 809 |
+
|
| 810 |
+
def get_command_packages(self):
|
| 811 |
+
"""Return a list of packages from which commands are loaded."""
|
| 812 |
+
pkgs = self.command_packages
|
| 813 |
+
if not isinstance(pkgs, list):
|
| 814 |
+
if pkgs is None:
|
| 815 |
+
pkgs = ''
|
| 816 |
+
pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != '']
|
| 817 |
+
if "distutils.command" not in pkgs:
|
| 818 |
+
pkgs.insert(0, "distutils.command")
|
| 819 |
+
self.command_packages = pkgs
|
| 820 |
+
return pkgs
|
| 821 |
+
|
| 822 |
+
def get_command_class(self, command: str) -> type[Command]:
|
| 823 |
+
"""Return the class that implements the Distutils command named by
|
| 824 |
+
'command'. First we check the 'cmdclass' dictionary; if the
|
| 825 |
+
command is mentioned there, we fetch the class object from the
|
| 826 |
+
dictionary and return it. Otherwise we load the command module
|
| 827 |
+
("distutils.command." + command) and fetch the command class from
|
| 828 |
+
the module. The loaded class is also stored in 'cmdclass'
|
| 829 |
+
to speed future calls to 'get_command_class()'.
|
| 830 |
+
|
| 831 |
+
Raises DistutilsModuleError if the expected module could not be
|
| 832 |
+
found, or if that module does not define the expected class.
|
| 833 |
+
"""
|
| 834 |
+
klass = self.cmdclass.get(command)
|
| 835 |
+
if klass:
|
| 836 |
+
return klass
|
| 837 |
+
|
| 838 |
+
for pkgname in self.get_command_packages():
|
| 839 |
+
module_name = f"{pkgname}.{command}"
|
| 840 |
+
klass_name = command
|
| 841 |
+
|
| 842 |
+
try:
|
| 843 |
+
__import__(module_name)
|
| 844 |
+
module = sys.modules[module_name]
|
| 845 |
+
except ImportError:
|
| 846 |
+
continue
|
| 847 |
+
|
| 848 |
+
try:
|
| 849 |
+
klass = getattr(module, klass_name)
|
| 850 |
+
except AttributeError:
|
| 851 |
+
raise DistutilsModuleError(
|
| 852 |
+
f"invalid command '{command}' (no class '{klass_name}' in module '{module_name}')"
|
| 853 |
+
)
|
| 854 |
+
|
| 855 |
+
self.cmdclass[command] = klass
|
| 856 |
+
return klass
|
| 857 |
+
|
| 858 |
+
raise DistutilsModuleError(f"invalid command '{command}'")
|
| 859 |
+
|
| 860 |
+
@overload
|
| 861 |
+
def get_command_obj(
|
| 862 |
+
self, command: str, create: Literal[True] = True
|
| 863 |
+
) -> Command: ...
|
| 864 |
+
@overload
|
| 865 |
+
def get_command_obj(
|
| 866 |
+
self, command: str, create: Literal[False]
|
| 867 |
+
) -> Command | None: ...
|
| 868 |
+
def get_command_obj(self, command: str, create: bool = True) -> Command | None:
|
| 869 |
+
"""Return the command object for 'command'. Normally this object
|
| 870 |
+
is cached on a previous call to 'get_command_obj()'; if no command
|
| 871 |
+
object for 'command' is in the cache, then we either create and
|
| 872 |
+
return it (if 'create' is true) or return None.
|
| 873 |
+
"""
|
| 874 |
+
cmd_obj = self.command_obj.get(command)
|
| 875 |
+
if not cmd_obj and create:
|
| 876 |
+
if DEBUG:
|
| 877 |
+
self.announce(
|
| 878 |
+
"Distribution.get_command_obj(): "
|
| 879 |
+
f"creating '{command}' command object"
|
| 880 |
+
)
|
| 881 |
+
|
| 882 |
+
klass = self.get_command_class(command)
|
| 883 |
+
cmd_obj = self.command_obj[command] = klass(self)
|
| 884 |
+
self.have_run[command] = False
|
| 885 |
+
|
| 886 |
+
# Set any options that were supplied in config files
|
| 887 |
+
# or on the command line. (NB. support for error
|
| 888 |
+
# reporting is lame here: any errors aren't reported
|
| 889 |
+
# until 'finalize_options()' is called, which means
|
| 890 |
+
# we won't report the source of the error.)
|
| 891 |
+
options = self.command_options.get(command)
|
| 892 |
+
if options:
|
| 893 |
+
self._set_command_options(cmd_obj, options)
|
| 894 |
+
|
| 895 |
+
return cmd_obj
|
| 896 |
+
|
| 897 |
+
def _set_command_options(self, command_obj, option_dict=None): # noqa: C901
|
| 898 |
+
"""Set the options for 'command_obj' from 'option_dict'. Basically
|
| 899 |
+
this means copying elements of a dictionary ('option_dict') to
|
| 900 |
+
attributes of an instance ('command').
|
| 901 |
+
|
| 902 |
+
'command_obj' must be a Command instance. If 'option_dict' is not
|
| 903 |
+
supplied, uses the standard option dictionary for this command
|
| 904 |
+
(from 'self.command_options').
|
| 905 |
+
"""
|
| 906 |
+
command_name = command_obj.get_command_name()
|
| 907 |
+
if option_dict is None:
|
| 908 |
+
option_dict = self.get_option_dict(command_name)
|
| 909 |
+
|
| 910 |
+
if DEBUG:
|
| 911 |
+
self.announce(f" setting options for '{command_name}' command:")
|
| 912 |
+
for option, (source, value) in option_dict.items():
|
| 913 |
+
if DEBUG:
|
| 914 |
+
self.announce(f" {option} = {value} (from {source})")
|
| 915 |
+
try:
|
| 916 |
+
bool_opts = [translate_longopt(o) for o in command_obj.boolean_options]
|
| 917 |
+
except AttributeError:
|
| 918 |
+
bool_opts = []
|
| 919 |
+
try:
|
| 920 |
+
neg_opt = command_obj.negative_opt
|
| 921 |
+
except AttributeError:
|
| 922 |
+
neg_opt = {}
|
| 923 |
+
|
| 924 |
+
try:
|
| 925 |
+
is_string = isinstance(value, str)
|
| 926 |
+
if option in neg_opt and is_string:
|
| 927 |
+
setattr(command_obj, neg_opt[option], not strtobool(value))
|
| 928 |
+
elif option in bool_opts and is_string:
|
| 929 |
+
setattr(command_obj, option, strtobool(value))
|
| 930 |
+
elif hasattr(command_obj, option):
|
| 931 |
+
setattr(command_obj, option, value)
|
| 932 |
+
else:
|
| 933 |
+
raise DistutilsOptionError(
|
| 934 |
+
f"error in {source}: command '{command_name}' has no such option '{option}'"
|
| 935 |
+
)
|
| 936 |
+
except ValueError as msg:
|
| 937 |
+
raise DistutilsOptionError(msg)
|
| 938 |
+
|
| 939 |
+
@overload
|
| 940 |
+
def reinitialize_command(
|
| 941 |
+
self, command: str, reinit_subcommands: bool = False
|
| 942 |
+
) -> Command: ...
|
| 943 |
+
@overload
|
| 944 |
+
def reinitialize_command(
|
| 945 |
+
self, command: _CommandT, reinit_subcommands: bool = False
|
| 946 |
+
) -> _CommandT: ...
|
| 947 |
+
def reinitialize_command(
|
| 948 |
+
self, command: str | Command, reinit_subcommands=False
|
| 949 |
+
) -> Command:
|
| 950 |
+
"""Reinitializes a command to the state it was in when first
|
| 951 |
+
returned by 'get_command_obj()': ie., initialized but not yet
|
| 952 |
+
finalized. This provides the opportunity to sneak option
|
| 953 |
+
values in programmatically, overriding or supplementing
|
| 954 |
+
user-supplied values from the config files and command line.
|
| 955 |
+
You'll have to re-finalize the command object (by calling
|
| 956 |
+
'finalize_options()' or 'ensure_finalized()') before using it for
|
| 957 |
+
real.
|
| 958 |
+
|
| 959 |
+
'command' should be a command name (string) or command object. If
|
| 960 |
+
'reinit_subcommands' is true, also reinitializes the command's
|
| 961 |
+
sub-commands, as declared by the 'sub_commands' class attribute (if
|
| 962 |
+
it has one). See the "install" command for an example. Only
|
| 963 |
+
reinitializes the sub-commands that actually matter, ie. those
|
| 964 |
+
whose test predicates return true.
|
| 965 |
+
|
| 966 |
+
Returns the reinitialized command object.
|
| 967 |
+
"""
|
| 968 |
+
from distutils.cmd import Command
|
| 969 |
+
|
| 970 |
+
if not isinstance(command, Command):
|
| 971 |
+
command_name = command
|
| 972 |
+
command = self.get_command_obj(command_name)
|
| 973 |
+
else:
|
| 974 |
+
command_name = command.get_command_name()
|
| 975 |
+
|
| 976 |
+
if not command.finalized:
|
| 977 |
+
return command
|
| 978 |
+
command.initialize_options()
|
| 979 |
+
command.finalized = False
|
| 980 |
+
self.have_run[command_name] = False
|
| 981 |
+
self._set_command_options(command)
|
| 982 |
+
|
| 983 |
+
if reinit_subcommands:
|
| 984 |
+
for sub in command.get_sub_commands():
|
| 985 |
+
self.reinitialize_command(sub, reinit_subcommands)
|
| 986 |
+
|
| 987 |
+
return command
|
| 988 |
+
|
| 989 |
+
# -- Methods that operate on the Distribution ----------------------
|
| 990 |
+
|
| 991 |
+
def announce(self, msg, level: int = logging.INFO) -> None:
|
| 992 |
+
log.log(level, msg)
|
| 993 |
+
|
| 994 |
+
def run_commands(self) -> None:
|
| 995 |
+
"""Run each command that was seen on the setup script command line.
|
| 996 |
+
Uses the list of commands found and cache of command objects
|
| 997 |
+
created by 'get_command_obj()'.
|
| 998 |
+
"""
|
| 999 |
+
for cmd in self.commands:
|
| 1000 |
+
self.run_command(cmd)
|
| 1001 |
+
|
| 1002 |
+
# -- Methods that operate on its Commands --------------------------
|
| 1003 |
+
|
| 1004 |
+
def run_command(self, command: str) -> None:
|
| 1005 |
+
"""Do whatever it takes to run a command (including nothing at all,
|
| 1006 |
+
if the command has already been run). Specifically: if we have
|
| 1007 |
+
already created and run the command named by 'command', return
|
| 1008 |
+
silently without doing anything. If the command named by 'command'
|
| 1009 |
+
doesn't even have a command object yet, create one. Then invoke
|
| 1010 |
+
'run()' on that command object (or an existing one).
|
| 1011 |
+
"""
|
| 1012 |
+
# Already been here, done that? then return silently.
|
| 1013 |
+
if self.have_run.get(command):
|
| 1014 |
+
return
|
| 1015 |
+
|
| 1016 |
+
log.info("running %s", command)
|
| 1017 |
+
cmd_obj = self.get_command_obj(command)
|
| 1018 |
+
cmd_obj.ensure_finalized()
|
| 1019 |
+
cmd_obj.run()
|
| 1020 |
+
self.have_run[command] = True
|
| 1021 |
+
|
| 1022 |
+
# -- Distribution query methods ------------------------------------
|
| 1023 |
+
|
| 1024 |
+
def has_pure_modules(self) -> bool:
|
| 1025 |
+
return len(self.packages or self.py_modules or []) > 0
|
| 1026 |
+
|
| 1027 |
+
def has_ext_modules(self) -> bool:
|
| 1028 |
+
return self.ext_modules and len(self.ext_modules) > 0
|
| 1029 |
+
|
| 1030 |
+
def has_c_libraries(self) -> bool:
|
| 1031 |
+
return self.libraries and len(self.libraries) > 0
|
| 1032 |
+
|
| 1033 |
+
def has_modules(self) -> bool:
|
| 1034 |
+
return self.has_pure_modules() or self.has_ext_modules()
|
| 1035 |
+
|
| 1036 |
+
def has_headers(self) -> bool:
|
| 1037 |
+
return self.headers and len(self.headers) > 0
|
| 1038 |
+
|
| 1039 |
+
def has_scripts(self) -> bool:
|
| 1040 |
+
return self.scripts and len(self.scripts) > 0
|
| 1041 |
+
|
| 1042 |
+
def has_data_files(self) -> bool:
|
| 1043 |
+
return self.data_files and len(self.data_files) > 0
|
| 1044 |
+
|
| 1045 |
+
def is_pure(self) -> bool:
|
| 1046 |
+
return (
|
| 1047 |
+
self.has_pure_modules()
|
| 1048 |
+
and not self.has_ext_modules()
|
| 1049 |
+
and not self.has_c_libraries()
|
| 1050 |
+
)
|
| 1051 |
+
|
| 1052 |
+
# -- Metadata query methods ----------------------------------------
|
| 1053 |
+
|
| 1054 |
+
# If you're looking for 'get_name()', 'get_version()', and so forth,
|
| 1055 |
+
# they are defined in a sneaky way: the constructor binds self.get_XXX
|
| 1056 |
+
# to self.metadata.get_XXX. The actual code is in the
|
| 1057 |
+
# DistributionMetadata class, below.
|
| 1058 |
+
if TYPE_CHECKING:
|
| 1059 |
+
# Unfortunately this means we need to specify them manually or not expose statically
|
| 1060 |
+
def _(self) -> None:
|
| 1061 |
+
self.get_name = self.metadata.get_name
|
| 1062 |
+
self.get_version = self.metadata.get_version
|
| 1063 |
+
self.get_fullname = self.metadata.get_fullname
|
| 1064 |
+
self.get_author = self.metadata.get_author
|
| 1065 |
+
self.get_author_email = self.metadata.get_author_email
|
| 1066 |
+
self.get_maintainer = self.metadata.get_maintainer
|
| 1067 |
+
self.get_maintainer_email = self.metadata.get_maintainer_email
|
| 1068 |
+
self.get_contact = self.metadata.get_contact
|
| 1069 |
+
self.get_contact_email = self.metadata.get_contact_email
|
| 1070 |
+
self.get_url = self.metadata.get_url
|
| 1071 |
+
self.get_license = self.metadata.get_license
|
| 1072 |
+
self.get_licence = self.metadata.get_licence
|
| 1073 |
+
self.get_description = self.metadata.get_description
|
| 1074 |
+
self.get_long_description = self.metadata.get_long_description
|
| 1075 |
+
self.get_keywords = self.metadata.get_keywords
|
| 1076 |
+
self.get_platforms = self.metadata.get_platforms
|
| 1077 |
+
self.get_classifiers = self.metadata.get_classifiers
|
| 1078 |
+
self.get_download_url = self.metadata.get_download_url
|
| 1079 |
+
self.get_requires = self.metadata.get_requires
|
| 1080 |
+
self.get_provides = self.metadata.get_provides
|
| 1081 |
+
self.get_obsoletes = self.metadata.get_obsoletes
|
| 1082 |
+
|
| 1083 |
+
# Default attributes generated in __init__ from self.display_option_names
|
| 1084 |
+
help_commands: bool
|
| 1085 |
+
name: str | Literal[False]
|
| 1086 |
+
version: str | Literal[False]
|
| 1087 |
+
fullname: str | Literal[False]
|
| 1088 |
+
author: str | Literal[False]
|
| 1089 |
+
author_email: str | Literal[False]
|
| 1090 |
+
maintainer: str | Literal[False]
|
| 1091 |
+
maintainer_email: str | Literal[False]
|
| 1092 |
+
contact: str | Literal[False]
|
| 1093 |
+
contact_email: str | Literal[False]
|
| 1094 |
+
url: str | Literal[False]
|
| 1095 |
+
license: str | Literal[False]
|
| 1096 |
+
licence: str | Literal[False]
|
| 1097 |
+
description: str | Literal[False]
|
| 1098 |
+
long_description: str | Literal[False]
|
| 1099 |
+
platforms: str | list[str] | Literal[False]
|
| 1100 |
+
classifiers: str | list[str] | Literal[False]
|
| 1101 |
+
keywords: str | list[str] | Literal[False]
|
| 1102 |
+
provides: list[str] | Literal[False]
|
| 1103 |
+
requires: list[str] | Literal[False]
|
| 1104 |
+
obsoletes: list[str] | Literal[False]
|
| 1105 |
+
|
| 1106 |
+
|
| 1107 |
+
class DistributionMetadata:
|
| 1108 |
+
"""Dummy class to hold the distribution meta-data: name, version,
|
| 1109 |
+
author, and so forth.
|
| 1110 |
+
"""
|
| 1111 |
+
|
| 1112 |
+
_METHOD_BASENAMES = (
|
| 1113 |
+
"name",
|
| 1114 |
+
"version",
|
| 1115 |
+
"author",
|
| 1116 |
+
"author_email",
|
| 1117 |
+
"maintainer",
|
| 1118 |
+
"maintainer_email",
|
| 1119 |
+
"url",
|
| 1120 |
+
"license",
|
| 1121 |
+
"description",
|
| 1122 |
+
"long_description",
|
| 1123 |
+
"keywords",
|
| 1124 |
+
"platforms",
|
| 1125 |
+
"fullname",
|
| 1126 |
+
"contact",
|
| 1127 |
+
"contact_email",
|
| 1128 |
+
"classifiers",
|
| 1129 |
+
"download_url",
|
| 1130 |
+
# PEP 314
|
| 1131 |
+
"provides",
|
| 1132 |
+
"requires",
|
| 1133 |
+
"obsoletes",
|
| 1134 |
+
)
|
| 1135 |
+
|
| 1136 |
+
def __init__(
|
| 1137 |
+
self, path: str | bytes | os.PathLike[str] | os.PathLike[bytes] | None = None
|
| 1138 |
+
) -> None:
|
| 1139 |
+
if path is not None:
|
| 1140 |
+
self.read_pkg_file(open(path))
|
| 1141 |
+
else:
|
| 1142 |
+
self.name: str | None = None
|
| 1143 |
+
self.version: str | None = None
|
| 1144 |
+
self.author: str | None = None
|
| 1145 |
+
self.author_email: str | None = None
|
| 1146 |
+
self.maintainer: str | None = None
|
| 1147 |
+
self.maintainer_email: str | None = None
|
| 1148 |
+
self.url: str | None = None
|
| 1149 |
+
self.license: str | None = None
|
| 1150 |
+
self.description: str | None = None
|
| 1151 |
+
self.long_description: str | None = None
|
| 1152 |
+
self.keywords: str | list[str] | None = None
|
| 1153 |
+
self.platforms: str | list[str] | None = None
|
| 1154 |
+
self.classifiers: str | list[str] | None = None
|
| 1155 |
+
self.download_url: str | None = None
|
| 1156 |
+
# PEP 314
|
| 1157 |
+
self.provides: str | list[str] | None = None
|
| 1158 |
+
self.requires: str | list[str] | None = None
|
| 1159 |
+
self.obsoletes: str | list[str] | None = None
|
| 1160 |
+
|
| 1161 |
+
def read_pkg_file(self, file: IO[str]) -> None:
|
| 1162 |
+
"""Reads the metadata values from a file object."""
|
| 1163 |
+
msg = message_from_file(file)
|
| 1164 |
+
|
| 1165 |
+
def _read_field(name: str) -> str | None:
|
| 1166 |
+
value = msg[name]
|
| 1167 |
+
if value and value != "UNKNOWN":
|
| 1168 |
+
return value
|
| 1169 |
+
return None
|
| 1170 |
+
|
| 1171 |
+
def _read_list(name):
|
| 1172 |
+
values = msg.get_all(name, None)
|
| 1173 |
+
if values == []:
|
| 1174 |
+
return None
|
| 1175 |
+
return values
|
| 1176 |
+
|
| 1177 |
+
metadata_version = msg['metadata-version']
|
| 1178 |
+
self.name = _read_field('name')
|
| 1179 |
+
self.version = _read_field('version')
|
| 1180 |
+
self.description = _read_field('summary')
|
| 1181 |
+
# we are filling author only.
|
| 1182 |
+
self.author = _read_field('author')
|
| 1183 |
+
self.maintainer = None
|
| 1184 |
+
self.author_email = _read_field('author-email')
|
| 1185 |
+
self.maintainer_email = None
|
| 1186 |
+
self.url = _read_field('home-page')
|
| 1187 |
+
self.license = _read_field('license')
|
| 1188 |
+
|
| 1189 |
+
if 'download-url' in msg:
|
| 1190 |
+
self.download_url = _read_field('download-url')
|
| 1191 |
+
else:
|
| 1192 |
+
self.download_url = None
|
| 1193 |
+
|
| 1194 |
+
self.long_description = _read_field('description')
|
| 1195 |
+
self.description = _read_field('summary')
|
| 1196 |
+
|
| 1197 |
+
if 'keywords' in msg:
|
| 1198 |
+
self.keywords = _read_field('keywords').split(',')
|
| 1199 |
+
|
| 1200 |
+
self.platforms = _read_list('platform')
|
| 1201 |
+
self.classifiers = _read_list('classifier')
|
| 1202 |
+
|
| 1203 |
+
# PEP 314 - these fields only exist in 1.1
|
| 1204 |
+
if metadata_version == '1.1':
|
| 1205 |
+
self.requires = _read_list('requires')
|
| 1206 |
+
self.provides = _read_list('provides')
|
| 1207 |
+
self.obsoletes = _read_list('obsoletes')
|
| 1208 |
+
else:
|
| 1209 |
+
self.requires = None
|
| 1210 |
+
self.provides = None
|
| 1211 |
+
self.obsoletes = None
|
| 1212 |
+
|
| 1213 |
+
def write_pkg_info(self, base_dir: str | os.PathLike[str]) -> None:
|
| 1214 |
+
"""Write the PKG-INFO file into the release tree."""
|
| 1215 |
+
with open(
|
| 1216 |
+
os.path.join(base_dir, 'PKG-INFO'), 'w', encoding='UTF-8'
|
| 1217 |
+
) as pkg_info:
|
| 1218 |
+
self.write_pkg_file(pkg_info)
|
| 1219 |
+
|
| 1220 |
+
def write_pkg_file(self, file: SupportsWrite[str]) -> None:
|
| 1221 |
+
"""Write the PKG-INFO format data to a file object."""
|
| 1222 |
+
version = '1.0'
|
| 1223 |
+
if (
|
| 1224 |
+
self.provides
|
| 1225 |
+
or self.requires
|
| 1226 |
+
or self.obsoletes
|
| 1227 |
+
or self.classifiers
|
| 1228 |
+
or self.download_url
|
| 1229 |
+
):
|
| 1230 |
+
version = '1.1'
|
| 1231 |
+
|
| 1232 |
+
# required fields
|
| 1233 |
+
file.write(f'Metadata-Version: {version}\n')
|
| 1234 |
+
file.write(f'Name: {self.get_name()}\n')
|
| 1235 |
+
file.write(f'Version: {self.get_version()}\n')
|
| 1236 |
+
|
| 1237 |
+
def maybe_write(header, val):
|
| 1238 |
+
if val:
|
| 1239 |
+
file.write(f"{header}: {val}\n")
|
| 1240 |
+
|
| 1241 |
+
# optional fields
|
| 1242 |
+
maybe_write("Summary", self.get_description())
|
| 1243 |
+
maybe_write("Home-page", self.get_url())
|
| 1244 |
+
maybe_write("Author", self.get_contact())
|
| 1245 |
+
maybe_write("Author-email", self.get_contact_email())
|
| 1246 |
+
maybe_write("License", self.get_license())
|
| 1247 |
+
maybe_write("Download-URL", self.download_url)
|
| 1248 |
+
maybe_write("Description", rfc822_escape(self.get_long_description() or ""))
|
| 1249 |
+
maybe_write("Keywords", ",".join(self.get_keywords()))
|
| 1250 |
+
|
| 1251 |
+
self._write_list(file, 'Platform', self.get_platforms())
|
| 1252 |
+
self._write_list(file, 'Classifier', self.get_classifiers())
|
| 1253 |
+
|
| 1254 |
+
# PEP 314
|
| 1255 |
+
self._write_list(file, 'Requires', self.get_requires())
|
| 1256 |
+
self._write_list(file, 'Provides', self.get_provides())
|
| 1257 |
+
self._write_list(file, 'Obsoletes', self.get_obsoletes())
|
| 1258 |
+
|
| 1259 |
+
def _write_list(self, file, name, values):
|
| 1260 |
+
values = values or []
|
| 1261 |
+
for value in values:
|
| 1262 |
+
file.write(f'{name}: {value}\n')
|
| 1263 |
+
|
| 1264 |
+
# -- Metadata query methods ----------------------------------------
|
| 1265 |
+
|
| 1266 |
+
def get_name(self) -> str:
|
| 1267 |
+
return self.name or "UNKNOWN"
|
| 1268 |
+
|
| 1269 |
+
def get_version(self) -> str:
|
| 1270 |
+
return self.version or "0.0.0"
|
| 1271 |
+
|
| 1272 |
+
def get_fullname(self) -> str:
|
| 1273 |
+
return self._fullname(self.get_name(), self.get_version())
|
| 1274 |
+
|
| 1275 |
+
@staticmethod
|
| 1276 |
+
def _fullname(name: str, version: str) -> str:
|
| 1277 |
+
"""
|
| 1278 |
+
>>> DistributionMetadata._fullname('setup.tools', '1.0-2')
|
| 1279 |
+
'setup_tools-1.0.post2'
|
| 1280 |
+
>>> DistributionMetadata._fullname('setup-tools', '1.2post2')
|
| 1281 |
+
'setup_tools-1.2.post2'
|
| 1282 |
+
>>> DistributionMetadata._fullname('setup-tools', '1.0-r2')
|
| 1283 |
+
'setup_tools-1.0.post2'
|
| 1284 |
+
>>> DistributionMetadata._fullname('setup.tools', '1.0.post')
|
| 1285 |
+
'setup_tools-1.0.post0'
|
| 1286 |
+
>>> DistributionMetadata._fullname('setup.tools', '1.0+ubuntu-1')
|
| 1287 |
+
'setup_tools-1.0+ubuntu.1'
|
| 1288 |
+
"""
|
| 1289 |
+
return "{}-{}".format(
|
| 1290 |
+
canonicalize_name(name).replace('-', '_'),
|
| 1291 |
+
canonicalize_version(version, strip_trailing_zero=False),
|
| 1292 |
+
)
|
| 1293 |
+
|
| 1294 |
+
def get_author(self) -> str | None:
|
| 1295 |
+
return self.author
|
| 1296 |
+
|
| 1297 |
+
def get_author_email(self) -> str | None:
|
| 1298 |
+
return self.author_email
|
| 1299 |
+
|
| 1300 |
+
def get_maintainer(self) -> str | None:
|
| 1301 |
+
return self.maintainer
|
| 1302 |
+
|
| 1303 |
+
def get_maintainer_email(self) -> str | None:
|
| 1304 |
+
return self.maintainer_email
|
| 1305 |
+
|
| 1306 |
+
def get_contact(self) -> str | None:
|
| 1307 |
+
return self.maintainer or self.author
|
| 1308 |
+
|
| 1309 |
+
def get_contact_email(self) -> str | None:
|
| 1310 |
+
return self.maintainer_email or self.author_email
|
| 1311 |
+
|
| 1312 |
+
def get_url(self) -> str | None:
|
| 1313 |
+
return self.url
|
| 1314 |
+
|
| 1315 |
+
def get_license(self) -> str | None:
|
| 1316 |
+
return self.license
|
| 1317 |
+
|
| 1318 |
+
get_licence = get_license
|
| 1319 |
+
|
| 1320 |
+
def get_description(self) -> str | None:
|
| 1321 |
+
return self.description
|
| 1322 |
+
|
| 1323 |
+
def get_long_description(self) -> str | None:
|
| 1324 |
+
return self.long_description
|
| 1325 |
+
|
| 1326 |
+
def get_keywords(self) -> str | list[str]:
|
| 1327 |
+
return self.keywords or []
|
| 1328 |
+
|
| 1329 |
+
def set_keywords(self, value: str | Iterable[str]) -> None:
|
| 1330 |
+
self.keywords = _ensure_list(value, 'keywords')
|
| 1331 |
+
|
| 1332 |
+
def get_platforms(self) -> str | list[str] | None:
|
| 1333 |
+
return self.platforms
|
| 1334 |
+
|
| 1335 |
+
def set_platforms(self, value: str | Iterable[str]) -> None:
|
| 1336 |
+
self.platforms = _ensure_list(value, 'platforms')
|
| 1337 |
+
|
| 1338 |
+
def get_classifiers(self) -> str | list[str]:
|
| 1339 |
+
return self.classifiers or []
|
| 1340 |
+
|
| 1341 |
+
def set_classifiers(self, value: str | Iterable[str]) -> None:
|
| 1342 |
+
self.classifiers = _ensure_list(value, 'classifiers')
|
| 1343 |
+
|
| 1344 |
+
def get_download_url(self) -> str | None:
|
| 1345 |
+
return self.download_url
|
| 1346 |
+
|
| 1347 |
+
# PEP 314
|
| 1348 |
+
def get_requires(self) -> str | list[str]:
|
| 1349 |
+
return self.requires or []
|
| 1350 |
+
|
| 1351 |
+
def set_requires(self, value: Iterable[str]) -> None:
|
| 1352 |
+
import distutils.versionpredicate
|
| 1353 |
+
|
| 1354 |
+
for v in value:
|
| 1355 |
+
distutils.versionpredicate.VersionPredicate(v)
|
| 1356 |
+
self.requires = list(value)
|
| 1357 |
+
|
| 1358 |
+
def get_provides(self) -> str | list[str]:
|
| 1359 |
+
return self.provides or []
|
| 1360 |
+
|
| 1361 |
+
def set_provides(self, value: Iterable[str]) -> None:
|
| 1362 |
+
value = [v.strip() for v in value]
|
| 1363 |
+
for v in value:
|
| 1364 |
+
import distutils.versionpredicate
|
| 1365 |
+
|
| 1366 |
+
distutils.versionpredicate.split_provision(v)
|
| 1367 |
+
self.provides = value
|
| 1368 |
+
|
| 1369 |
+
def get_obsoletes(self) -> str | list[str]:
|
| 1370 |
+
return self.obsoletes or []
|
| 1371 |
+
|
| 1372 |
+
def set_obsoletes(self, value: Iterable[str]) -> None:
|
| 1373 |
+
import distutils.versionpredicate
|
| 1374 |
+
|
| 1375 |
+
for v in value:
|
| 1376 |
+
distutils.versionpredicate.VersionPredicate(v)
|
| 1377 |
+
self.obsoletes = list(value)
|
| 1378 |
+
|
| 1379 |
+
|
| 1380 |
+
def fix_help_options(options):
|
| 1381 |
+
"""Convert a 4-tuple 'help_options' list as found in various command
|
| 1382 |
+
classes to the 3-tuple form required by FancyGetopt.
|
| 1383 |
+
"""
|
| 1384 |
+
return [opt[0:3] for opt in options]
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/errors.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Exceptions used by the Distutils modules.
|
| 3 |
+
|
| 4 |
+
Distutils modules may raise these or standard exceptions,
|
| 5 |
+
including :exc:`SystemExit`.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
# compiler exceptions aliased for compatibility
|
| 9 |
+
from .compilers.C.errors import CompileError as CompileError
|
| 10 |
+
from .compilers.C.errors import Error as _Error
|
| 11 |
+
from .compilers.C.errors import LibError as LibError
|
| 12 |
+
from .compilers.C.errors import LinkError as LinkError
|
| 13 |
+
from .compilers.C.errors import PreprocessError as PreprocessError
|
| 14 |
+
from .compilers.C.errors import UnknownFileType as _UnknownFileType
|
| 15 |
+
|
| 16 |
+
CCompilerError = _Error
|
| 17 |
+
UnknownFileError = _UnknownFileType
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class DistutilsError(Exception):
|
| 21 |
+
"""The root of all Distutils evil."""
|
| 22 |
+
|
| 23 |
+
pass
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
class DistutilsModuleError(DistutilsError):
|
| 27 |
+
"""Unable to load an expected module, or to find an expected class
|
| 28 |
+
within some module (in particular, command modules and classes)."""
|
| 29 |
+
|
| 30 |
+
pass
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class DistutilsClassError(DistutilsError):
|
| 34 |
+
"""Some command class (or possibly distribution class, if anyone
|
| 35 |
+
feels a need to subclass Distribution) is found not to be holding
|
| 36 |
+
up its end of the bargain, ie. implementing some part of the
|
| 37 |
+
"command "interface."""
|
| 38 |
+
|
| 39 |
+
pass
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class DistutilsGetoptError(DistutilsError):
|
| 43 |
+
"""The option table provided to 'fancy_getopt()' is bogus."""
|
| 44 |
+
|
| 45 |
+
pass
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
class DistutilsArgError(DistutilsError):
|
| 49 |
+
"""Raised by fancy_getopt in response to getopt.error -- ie. an
|
| 50 |
+
error in the command line usage."""
|
| 51 |
+
|
| 52 |
+
pass
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
class DistutilsFileError(DistutilsError):
|
| 56 |
+
"""Any problems in the filesystem: expected file not found, etc.
|
| 57 |
+
Typically this is for problems that we detect before OSError
|
| 58 |
+
could be raised."""
|
| 59 |
+
|
| 60 |
+
pass
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
class DistutilsOptionError(DistutilsError):
|
| 64 |
+
"""Syntactic/semantic errors in command options, such as use of
|
| 65 |
+
mutually conflicting options, or inconsistent options,
|
| 66 |
+
badly-spelled values, etc. No distinction is made between option
|
| 67 |
+
values originating in the setup script, the command line, config
|
| 68 |
+
files, or what-have-you -- but if we *know* something originated in
|
| 69 |
+
the setup script, we'll raise DistutilsSetupError instead."""
|
| 70 |
+
|
| 71 |
+
pass
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
class DistutilsSetupError(DistutilsError):
|
| 75 |
+
"""For errors that can be definitely blamed on the setup script,
|
| 76 |
+
such as invalid keyword arguments to 'setup()'."""
|
| 77 |
+
|
| 78 |
+
pass
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
class DistutilsPlatformError(DistutilsError):
|
| 82 |
+
"""We don't know how to do something on the current platform (but
|
| 83 |
+
we do know how to do it on some platform) -- eg. trying to compile
|
| 84 |
+
C files on a platform not supported by a CCompiler subclass."""
|
| 85 |
+
|
| 86 |
+
pass
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
class DistutilsExecError(DistutilsError):
|
| 90 |
+
"""Any problems executing an external program (such as the C
|
| 91 |
+
compiler, when compiling C files)."""
|
| 92 |
+
|
| 93 |
+
pass
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
class DistutilsInternalError(DistutilsError):
|
| 97 |
+
"""Internal inconsistencies or impossibilities (obviously, this
|
| 98 |
+
should never be seen if the code is working!)."""
|
| 99 |
+
|
| 100 |
+
pass
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
class DistutilsTemplateError(DistutilsError):
|
| 104 |
+
"""Syntax error in a file list template."""
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
class DistutilsByteCompileError(DistutilsError):
|
| 108 |
+
"""Byte compile error."""
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/extension.py
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.extension
|
| 2 |
+
|
| 3 |
+
Provides the Extension class, used to describe C/C++ extension
|
| 4 |
+
modules in setup scripts."""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
import warnings
|
| 10 |
+
from collections.abc import Iterable
|
| 11 |
+
|
| 12 |
+
# This class is really only used by the "build_ext" command, so it might
|
| 13 |
+
# make sense to put it in distutils.command.build_ext. However, that
|
| 14 |
+
# module is already big enough, and I want to make this class a bit more
|
| 15 |
+
# complex to simplify some common cases ("foo" module in "foo.c") and do
|
| 16 |
+
# better error-checking ("foo.c" actually exists).
|
| 17 |
+
#
|
| 18 |
+
# Also, putting this in build_ext.py means every setup script would have to
|
| 19 |
+
# import that large-ish module (indirectly, through distutils.core) in
|
| 20 |
+
# order to do anything.
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class Extension:
|
| 24 |
+
"""Just a collection of attributes that describes an extension
|
| 25 |
+
module and everything needed to build it (hopefully in a portable
|
| 26 |
+
way, but there are hooks that let you be as unportable as you need).
|
| 27 |
+
|
| 28 |
+
Instance attributes:
|
| 29 |
+
name : string
|
| 30 |
+
the full name of the extension, including any packages -- ie.
|
| 31 |
+
*not* a filename or pathname, but Python dotted name
|
| 32 |
+
sources : Iterable[string | os.PathLike]
|
| 33 |
+
iterable of source filenames (except strings, which could be misinterpreted
|
| 34 |
+
as a single filename), relative to the distribution root (where the setup
|
| 35 |
+
script lives), in Unix form (slash-separated) for portability. Can be any
|
| 36 |
+
non-string iterable (list, tuple, set, etc.) containing strings or
|
| 37 |
+
PathLike objects. Source files may be C, C++, SWIG (.i), platform-specific
|
| 38 |
+
resource files, or whatever else is recognized by the "build_ext" command
|
| 39 |
+
as source for a Python extension.
|
| 40 |
+
include_dirs : [string]
|
| 41 |
+
list of directories to search for C/C++ header files (in Unix
|
| 42 |
+
form for portability)
|
| 43 |
+
define_macros : [(name : string, value : string|None)]
|
| 44 |
+
list of macros to define; each macro is defined using a 2-tuple,
|
| 45 |
+
where 'value' is either the string to define it to or None to
|
| 46 |
+
define it without a particular value (equivalent of "#define
|
| 47 |
+
FOO" in source or -DFOO on Unix C compiler command line)
|
| 48 |
+
undef_macros : [string]
|
| 49 |
+
list of macros to undefine explicitly
|
| 50 |
+
library_dirs : [string]
|
| 51 |
+
list of directories to search for C/C++ libraries at link time
|
| 52 |
+
libraries : [string]
|
| 53 |
+
list of library names (not filenames or paths) to link against
|
| 54 |
+
runtime_library_dirs : [string]
|
| 55 |
+
list of directories to search for C/C++ libraries at run time
|
| 56 |
+
(for shared extensions, this is when the extension is loaded)
|
| 57 |
+
extra_objects : [string]
|
| 58 |
+
list of extra files to link with (eg. object files not implied
|
| 59 |
+
by 'sources', static library that must be explicitly specified,
|
| 60 |
+
binary resource files, etc.)
|
| 61 |
+
extra_compile_args : [string]
|
| 62 |
+
any extra platform- and compiler-specific information to use
|
| 63 |
+
when compiling the source files in 'sources'. For platforms and
|
| 64 |
+
compilers where "command line" makes sense, this is typically a
|
| 65 |
+
list of command-line arguments, but for other platforms it could
|
| 66 |
+
be anything.
|
| 67 |
+
extra_link_args : [string]
|
| 68 |
+
any extra platform- and compiler-specific information to use
|
| 69 |
+
when linking object files together to create the extension (or
|
| 70 |
+
to create a new static Python interpreter). Similar
|
| 71 |
+
interpretation as for 'extra_compile_args'.
|
| 72 |
+
export_symbols : [string]
|
| 73 |
+
list of symbols to be exported from a shared extension. Not
|
| 74 |
+
used on all platforms, and not generally necessary for Python
|
| 75 |
+
extensions, which typically export exactly one symbol: "init" +
|
| 76 |
+
extension_name.
|
| 77 |
+
swig_opts : [string]
|
| 78 |
+
any extra options to pass to SWIG if a source file has the .i
|
| 79 |
+
extension.
|
| 80 |
+
depends : [string]
|
| 81 |
+
list of files that the extension depends on
|
| 82 |
+
language : string
|
| 83 |
+
extension language (i.e. "c", "c++", "objc"). Will be detected
|
| 84 |
+
from the source extensions if not provided.
|
| 85 |
+
optional : boolean
|
| 86 |
+
specifies that a build failure in the extension should not abort the
|
| 87 |
+
build process, but simply not install the failing extension.
|
| 88 |
+
"""
|
| 89 |
+
|
| 90 |
+
# When adding arguments to this constructor, be sure to update
|
| 91 |
+
# setup_keywords in core.py.
|
| 92 |
+
def __init__(
|
| 93 |
+
self,
|
| 94 |
+
name: str,
|
| 95 |
+
sources: Iterable[str | os.PathLike[str]],
|
| 96 |
+
include_dirs: list[str] | None = None,
|
| 97 |
+
define_macros: list[tuple[str, str | None]] | None = None,
|
| 98 |
+
undef_macros: list[str] | None = None,
|
| 99 |
+
library_dirs: list[str] | None = None,
|
| 100 |
+
libraries: list[str] | None = None,
|
| 101 |
+
runtime_library_dirs: list[str] | None = None,
|
| 102 |
+
extra_objects: list[str] | None = None,
|
| 103 |
+
extra_compile_args: list[str] | None = None,
|
| 104 |
+
extra_link_args: list[str] | None = None,
|
| 105 |
+
export_symbols: list[str] | None = None,
|
| 106 |
+
swig_opts: list[str] | None = None,
|
| 107 |
+
depends: list[str] | None = None,
|
| 108 |
+
language: str | None = None,
|
| 109 |
+
optional: bool | None = None,
|
| 110 |
+
**kw, # To catch unknown keywords
|
| 111 |
+
):
|
| 112 |
+
if not isinstance(name, str):
|
| 113 |
+
raise TypeError("'name' must be a string")
|
| 114 |
+
|
| 115 |
+
# handle the string case first; since strings are iterable, disallow them
|
| 116 |
+
if isinstance(sources, str):
|
| 117 |
+
raise TypeError(
|
| 118 |
+
"'sources' must be an iterable of strings or PathLike objects, not a string"
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
# now we check if it's iterable and contains valid types
|
| 122 |
+
try:
|
| 123 |
+
self.sources = list(map(os.fspath, sources))
|
| 124 |
+
except TypeError:
|
| 125 |
+
raise TypeError(
|
| 126 |
+
"'sources' must be an iterable of strings or PathLike objects"
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
self.name = name
|
| 130 |
+
self.include_dirs = include_dirs or []
|
| 131 |
+
self.define_macros = define_macros or []
|
| 132 |
+
self.undef_macros = undef_macros or []
|
| 133 |
+
self.library_dirs = library_dirs or []
|
| 134 |
+
self.libraries = libraries or []
|
| 135 |
+
self.runtime_library_dirs = runtime_library_dirs or []
|
| 136 |
+
self.extra_objects = extra_objects or []
|
| 137 |
+
self.extra_compile_args = extra_compile_args or []
|
| 138 |
+
self.extra_link_args = extra_link_args or []
|
| 139 |
+
self.export_symbols = export_symbols or []
|
| 140 |
+
self.swig_opts = swig_opts or []
|
| 141 |
+
self.depends = depends or []
|
| 142 |
+
self.language = language
|
| 143 |
+
self.optional = optional
|
| 144 |
+
|
| 145 |
+
# If there are unknown keyword options, warn about them
|
| 146 |
+
if len(kw) > 0:
|
| 147 |
+
options = [repr(option) for option in kw]
|
| 148 |
+
options = ', '.join(sorted(options))
|
| 149 |
+
msg = f"Unknown Extension options: {options}"
|
| 150 |
+
warnings.warn(msg)
|
| 151 |
+
|
| 152 |
+
def __repr__(self):
|
| 153 |
+
return f'<{self.__class__.__module__}.{self.__class__.__qualname__}({self.name!r}) at {id(self):#x}>'
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def read_setup_file(filename): # noqa: C901
|
| 157 |
+
"""Reads a Setup file and returns Extension instances."""
|
| 158 |
+
from distutils.sysconfig import _variable_rx, expand_makefile_vars, parse_makefile
|
| 159 |
+
from distutils.text_file import TextFile
|
| 160 |
+
from distutils.util import split_quoted
|
| 161 |
+
|
| 162 |
+
# First pass over the file to gather "VAR = VALUE" assignments.
|
| 163 |
+
vars = parse_makefile(filename)
|
| 164 |
+
|
| 165 |
+
# Second pass to gobble up the real content: lines of the form
|
| 166 |
+
# <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
|
| 167 |
+
file = TextFile(
|
| 168 |
+
filename,
|
| 169 |
+
strip_comments=True,
|
| 170 |
+
skip_blanks=True,
|
| 171 |
+
join_lines=True,
|
| 172 |
+
lstrip_ws=True,
|
| 173 |
+
rstrip_ws=True,
|
| 174 |
+
)
|
| 175 |
+
try:
|
| 176 |
+
extensions = []
|
| 177 |
+
|
| 178 |
+
while True:
|
| 179 |
+
line = file.readline()
|
| 180 |
+
if line is None: # eof
|
| 181 |
+
break
|
| 182 |
+
if _variable_rx.match(line): # VAR=VALUE, handled in first pass
|
| 183 |
+
continue
|
| 184 |
+
|
| 185 |
+
if line[0] == line[-1] == "*":
|
| 186 |
+
file.warn(f"'{line}' lines not handled yet")
|
| 187 |
+
continue
|
| 188 |
+
|
| 189 |
+
line = expand_makefile_vars(line, vars)
|
| 190 |
+
words = split_quoted(line)
|
| 191 |
+
|
| 192 |
+
# NB. this parses a slightly different syntax than the old
|
| 193 |
+
# makesetup script: here, there must be exactly one extension per
|
| 194 |
+
# line, and it must be the first word of the line. I have no idea
|
| 195 |
+
# why the old syntax supported multiple extensions per line, as
|
| 196 |
+
# they all wind up being the same.
|
| 197 |
+
|
| 198 |
+
module = words[0]
|
| 199 |
+
ext = Extension(module, [])
|
| 200 |
+
append_next_word = None
|
| 201 |
+
|
| 202 |
+
for word in words[1:]:
|
| 203 |
+
if append_next_word is not None:
|
| 204 |
+
append_next_word.append(word)
|
| 205 |
+
append_next_word = None
|
| 206 |
+
continue
|
| 207 |
+
|
| 208 |
+
suffix = os.path.splitext(word)[1]
|
| 209 |
+
switch = word[0:2]
|
| 210 |
+
value = word[2:]
|
| 211 |
+
|
| 212 |
+
if suffix in (".c", ".cc", ".cpp", ".cxx", ".c++", ".m", ".mm"):
|
| 213 |
+
# hmm, should we do something about C vs. C++ sources?
|
| 214 |
+
# or leave it up to the CCompiler implementation to
|
| 215 |
+
# worry about?
|
| 216 |
+
ext.sources.append(word)
|
| 217 |
+
elif switch == "-I":
|
| 218 |
+
ext.include_dirs.append(value)
|
| 219 |
+
elif switch == "-D":
|
| 220 |
+
equals = value.find("=")
|
| 221 |
+
if equals == -1: # bare "-DFOO" -- no value
|
| 222 |
+
ext.define_macros.append((value, None))
|
| 223 |
+
else: # "-DFOO=blah"
|
| 224 |
+
ext.define_macros.append((value[0:equals], value[equals + 2 :]))
|
| 225 |
+
elif switch == "-U":
|
| 226 |
+
ext.undef_macros.append(value)
|
| 227 |
+
elif switch == "-C": # only here 'cause makesetup has it!
|
| 228 |
+
ext.extra_compile_args.append(word)
|
| 229 |
+
elif switch == "-l":
|
| 230 |
+
ext.libraries.append(value)
|
| 231 |
+
elif switch == "-L":
|
| 232 |
+
ext.library_dirs.append(value)
|
| 233 |
+
elif switch == "-R":
|
| 234 |
+
ext.runtime_library_dirs.append(value)
|
| 235 |
+
elif word == "-rpath":
|
| 236 |
+
append_next_word = ext.runtime_library_dirs
|
| 237 |
+
elif word == "-Xlinker":
|
| 238 |
+
append_next_word = ext.extra_link_args
|
| 239 |
+
elif word == "-Xcompiler":
|
| 240 |
+
append_next_word = ext.extra_compile_args
|
| 241 |
+
elif switch == "-u":
|
| 242 |
+
ext.extra_link_args.append(word)
|
| 243 |
+
if not value:
|
| 244 |
+
append_next_word = ext.extra_link_args
|
| 245 |
+
elif suffix in (".a", ".so", ".sl", ".o", ".dylib"):
|
| 246 |
+
# NB. a really faithful emulation of makesetup would
|
| 247 |
+
# append a .o file to extra_objects only if it
|
| 248 |
+
# had a slash in it; otherwise, it would s/.o/.c/
|
| 249 |
+
# and append it to sources. Hmmmm.
|
| 250 |
+
ext.extra_objects.append(word)
|
| 251 |
+
else:
|
| 252 |
+
file.warn(f"unrecognized argument '{word}'")
|
| 253 |
+
|
| 254 |
+
extensions.append(ext)
|
| 255 |
+
finally:
|
| 256 |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.fancy_getopt
|
| 2 |
+
|
| 3 |
+
Wrapper around the standard getopt module that provides the following
|
| 4 |
+
additional features:
|
| 5 |
+
* short and long options are tied together
|
| 6 |
+
* options have help strings, so fancy_getopt could potentially
|
| 7 |
+
create a complete usage summary
|
| 8 |
+
* options set attributes of a passed-in object
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import getopt
|
| 14 |
+
import re
|
| 15 |
+
import string
|
| 16 |
+
import sys
|
| 17 |
+
from collections.abc import Sequence
|
| 18 |
+
from typing import Any
|
| 19 |
+
|
| 20 |
+
from .errors import DistutilsArgError, DistutilsGetoptError
|
| 21 |
+
|
| 22 |
+
# Much like command_re in distutils.core, this is close to but not quite
|
| 23 |
+
# the same as a Python NAME -- except, in the spirit of most GNU
|
| 24 |
+
# utilities, we use '-' in place of '_'. (The spirit of LISP lives on!)
|
| 25 |
+
# The similarities to NAME are again not a coincidence...
|
| 26 |
+
longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)'
|
| 27 |
+
longopt_re = re.compile(rf'^{longopt_pat}$')
|
| 28 |
+
|
| 29 |
+
# For recognizing "negative alias" options, eg. "quiet=!verbose"
|
| 30 |
+
neg_alias_re = re.compile(f"^({longopt_pat})=!({longopt_pat})$")
|
| 31 |
+
|
| 32 |
+
# This is used to translate long options to legitimate Python identifiers
|
| 33 |
+
# (for use as attributes of some object).
|
| 34 |
+
longopt_xlate = str.maketrans('-', '_')
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class FancyGetopt:
|
| 38 |
+
"""Wrapper around the standard 'getopt()' module that provides some
|
| 39 |
+
handy extra functionality:
|
| 40 |
+
* short and long options are tied together
|
| 41 |
+
* options have help strings, and help text can be assembled
|
| 42 |
+
from them
|
| 43 |
+
* options set attributes of a passed-in object
|
| 44 |
+
* boolean options can have "negative aliases" -- eg. if
|
| 45 |
+
--quiet is the "negative alias" of --verbose, then "--quiet"
|
| 46 |
+
on the command line sets 'verbose' to false
|
| 47 |
+
"""
|
| 48 |
+
|
| 49 |
+
def __init__(self, option_table=None):
|
| 50 |
+
# The option table is (currently) a list of tuples. The
|
| 51 |
+
# tuples may have 3 or four values:
|
| 52 |
+
# (long_option, short_option, help_string [, repeatable])
|
| 53 |
+
# if an option takes an argument, its long_option should have '='
|
| 54 |
+
# appended; short_option should just be a single character, no ':'
|
| 55 |
+
# in any case. If a long_option doesn't have a corresponding
|
| 56 |
+
# short_option, short_option should be None. All option tuples
|
| 57 |
+
# must have long options.
|
| 58 |
+
self.option_table = option_table
|
| 59 |
+
|
| 60 |
+
# 'option_index' maps long option names to entries in the option
|
| 61 |
+
# table (ie. those 3-tuples).
|
| 62 |
+
self.option_index = {}
|
| 63 |
+
if self.option_table:
|
| 64 |
+
self._build_index()
|
| 65 |
+
|
| 66 |
+
# 'alias' records (duh) alias options; {'foo': 'bar'} means
|
| 67 |
+
# --foo is an alias for --bar
|
| 68 |
+
self.alias = {}
|
| 69 |
+
|
| 70 |
+
# 'negative_alias' keeps track of options that are the boolean
|
| 71 |
+
# opposite of some other option
|
| 72 |
+
self.negative_alias = {}
|
| 73 |
+
|
| 74 |
+
# These keep track of the information in the option table. We
|
| 75 |
+
# don't actually populate these structures until we're ready to
|
| 76 |
+
# parse the command-line, since the 'option_table' passed in here
|
| 77 |
+
# isn't necessarily the final word.
|
| 78 |
+
self.short_opts = []
|
| 79 |
+
self.long_opts = []
|
| 80 |
+
self.short2long = {}
|
| 81 |
+
self.attr_name = {}
|
| 82 |
+
self.takes_arg = {}
|
| 83 |
+
|
| 84 |
+
# And 'option_order' is filled up in 'getopt()'; it records the
|
| 85 |
+
# original order of options (and their values) on the command-line,
|
| 86 |
+
# but expands short options, converts aliases, etc.
|
| 87 |
+
self.option_order = []
|
| 88 |
+
|
| 89 |
+
def _build_index(self):
|
| 90 |
+
self.option_index.clear()
|
| 91 |
+
for option in self.option_table:
|
| 92 |
+
self.option_index[option[0]] = option
|
| 93 |
+
|
| 94 |
+
def set_option_table(self, option_table):
|
| 95 |
+
self.option_table = option_table
|
| 96 |
+
self._build_index()
|
| 97 |
+
|
| 98 |
+
def add_option(self, long_option, short_option=None, help_string=None):
|
| 99 |
+
if long_option in self.option_index:
|
| 100 |
+
raise DistutilsGetoptError(
|
| 101 |
+
f"option conflict: already an option '{long_option}'"
|
| 102 |
+
)
|
| 103 |
+
else:
|
| 104 |
+
option = (long_option, short_option, help_string)
|
| 105 |
+
self.option_table.append(option)
|
| 106 |
+
self.option_index[long_option] = option
|
| 107 |
+
|
| 108 |
+
def has_option(self, long_option):
|
| 109 |
+
"""Return true if the option table for this parser has an
|
| 110 |
+
option with long name 'long_option'."""
|
| 111 |
+
return long_option in self.option_index
|
| 112 |
+
|
| 113 |
+
def get_attr_name(self, long_option):
|
| 114 |
+
"""Translate long option name 'long_option' to the form it
|
| 115 |
+
has as an attribute of some object: ie., translate hyphens
|
| 116 |
+
to underscores."""
|
| 117 |
+
return long_option.translate(longopt_xlate)
|
| 118 |
+
|
| 119 |
+
def _check_alias_dict(self, aliases, what):
|
| 120 |
+
assert isinstance(aliases, dict)
|
| 121 |
+
for alias, opt in aliases.items():
|
| 122 |
+
if alias not in self.option_index:
|
| 123 |
+
raise DistutilsGetoptError(
|
| 124 |
+
f"invalid {what} '{alias}': option '{alias}' not defined"
|
| 125 |
+
)
|
| 126 |
+
if opt not in self.option_index:
|
| 127 |
+
raise DistutilsGetoptError(
|
| 128 |
+
f"invalid {what} '{alias}': aliased option '{opt}' not defined"
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
+
def set_aliases(self, alias):
|
| 132 |
+
"""Set the aliases for this option parser."""
|
| 133 |
+
self._check_alias_dict(alias, "alias")
|
| 134 |
+
self.alias = alias
|
| 135 |
+
|
| 136 |
+
def set_negative_aliases(self, negative_alias):
|
| 137 |
+
"""Set the negative aliases for this option parser.
|
| 138 |
+
'negative_alias' should be a dictionary mapping option names to
|
| 139 |
+
option names, both the key and value must already be defined
|
| 140 |
+
in the option table."""
|
| 141 |
+
self._check_alias_dict(negative_alias, "negative alias")
|
| 142 |
+
self.negative_alias = negative_alias
|
| 143 |
+
|
| 144 |
+
def _grok_option_table(self): # noqa: C901
|
| 145 |
+
"""Populate the various data structures that keep tabs on the
|
| 146 |
+
option table. Called by 'getopt()' before it can do anything
|
| 147 |
+
worthwhile.
|
| 148 |
+
"""
|
| 149 |
+
self.long_opts = []
|
| 150 |
+
self.short_opts = []
|
| 151 |
+
self.short2long.clear()
|
| 152 |
+
self.repeat = {}
|
| 153 |
+
|
| 154 |
+
for option in self.option_table:
|
| 155 |
+
if len(option) == 3:
|
| 156 |
+
long, short, help = option
|
| 157 |
+
repeat = 0
|
| 158 |
+
elif len(option) == 4:
|
| 159 |
+
long, short, help, repeat = option
|
| 160 |
+
else:
|
| 161 |
+
# the option table is part of the code, so simply
|
| 162 |
+
# assert that it is correct
|
| 163 |
+
raise ValueError(f"invalid option tuple: {option!r}")
|
| 164 |
+
|
| 165 |
+
# Type- and value-check the option names
|
| 166 |
+
if not isinstance(long, str) or len(long) < 2:
|
| 167 |
+
raise DistutilsGetoptError(
|
| 168 |
+
f"invalid long option '{long}': must be a string of length >= 2"
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
if not ((short is None) or (isinstance(short, str) and len(short) == 1)):
|
| 172 |
+
raise DistutilsGetoptError(
|
| 173 |
+
f"invalid short option '{short}': must a single character or None"
|
| 174 |
+
)
|
| 175 |
+
|
| 176 |
+
self.repeat[long] = repeat
|
| 177 |
+
self.long_opts.append(long)
|
| 178 |
+
|
| 179 |
+
if long[-1] == '=': # option takes an argument?
|
| 180 |
+
if short:
|
| 181 |
+
short = short + ':'
|
| 182 |
+
long = long[0:-1]
|
| 183 |
+
self.takes_arg[long] = True
|
| 184 |
+
else:
|
| 185 |
+
# Is option is a "negative alias" for some other option (eg.
|
| 186 |
+
# "quiet" == "!verbose")?
|
| 187 |
+
alias_to = self.negative_alias.get(long)
|
| 188 |
+
if alias_to is not None:
|
| 189 |
+
if self.takes_arg[alias_to]:
|
| 190 |
+
raise DistutilsGetoptError(
|
| 191 |
+
f"invalid negative alias '{long}': "
|
| 192 |
+
f"aliased option '{alias_to}' takes a value"
|
| 193 |
+
)
|
| 194 |
+
|
| 195 |
+
self.long_opts[-1] = long # XXX redundant?!
|
| 196 |
+
self.takes_arg[long] = False
|
| 197 |
+
|
| 198 |
+
# If this is an alias option, make sure its "takes arg" flag is
|
| 199 |
+
# the same as the option it's aliased to.
|
| 200 |
+
alias_to = self.alias.get(long)
|
| 201 |
+
if alias_to is not None:
|
| 202 |
+
if self.takes_arg[long] != self.takes_arg[alias_to]:
|
| 203 |
+
raise DistutilsGetoptError(
|
| 204 |
+
f"invalid alias '{long}': inconsistent with "
|
| 205 |
+
f"aliased option '{alias_to}' (one of them takes a value, "
|
| 206 |
+
"the other doesn't"
|
| 207 |
+
)
|
| 208 |
+
|
| 209 |
+
# Now enforce some bondage on the long option name, so we can
|
| 210 |
+
# later translate it to an attribute name on some object. Have
|
| 211 |
+
# to do this a bit late to make sure we've removed any trailing
|
| 212 |
+
# '='.
|
| 213 |
+
if not longopt_re.match(long):
|
| 214 |
+
raise DistutilsGetoptError(
|
| 215 |
+
f"invalid long option name '{long}' "
|
| 216 |
+
"(must be letters, numbers, hyphens only"
|
| 217 |
+
)
|
| 218 |
+
|
| 219 |
+
self.attr_name[long] = self.get_attr_name(long)
|
| 220 |
+
if short:
|
| 221 |
+
self.short_opts.append(short)
|
| 222 |
+
self.short2long[short[0]] = long
|
| 223 |
+
|
| 224 |
+
def getopt(self, args: Sequence[str] | None = None, object=None): # noqa: C901
|
| 225 |
+
"""Parse command-line options in args. Store as attributes on object.
|
| 226 |
+
|
| 227 |
+
If 'args' is None or not supplied, uses 'sys.argv[1:]'. If
|
| 228 |
+
'object' is None or not supplied, creates a new OptionDummy
|
| 229 |
+
object, stores option values there, and returns a tuple (args,
|
| 230 |
+
object). If 'object' is supplied, it is modified in place and
|
| 231 |
+
'getopt()' just returns 'args'; in both cases, the returned
|
| 232 |
+
'args' is a modified copy of the passed-in 'args' list, which
|
| 233 |
+
is left untouched.
|
| 234 |
+
"""
|
| 235 |
+
if args is None:
|
| 236 |
+
args = sys.argv[1:]
|
| 237 |
+
if object is None:
|
| 238 |
+
object = OptionDummy()
|
| 239 |
+
created_object = True
|
| 240 |
+
else:
|
| 241 |
+
created_object = False
|
| 242 |
+
|
| 243 |
+
self._grok_option_table()
|
| 244 |
+
|
| 245 |
+
short_opts = ' '.join(self.short_opts)
|
| 246 |
+
try:
|
| 247 |
+
opts, args = getopt.getopt(args, short_opts, self.long_opts)
|
| 248 |
+
except getopt.error as msg:
|
| 249 |
+
raise DistutilsArgError(msg)
|
| 250 |
+
|
| 251 |
+
for opt, val in opts:
|
| 252 |
+
if len(opt) == 2 and opt[0] == '-': # it's a short option
|
| 253 |
+
opt = self.short2long[opt[1]]
|
| 254 |
+
else:
|
| 255 |
+
assert len(opt) > 2 and opt[:2] == '--'
|
| 256 |
+
opt = opt[2:]
|
| 257 |
+
|
| 258 |
+
alias = self.alias.get(opt)
|
| 259 |
+
if alias:
|
| 260 |
+
opt = alias
|
| 261 |
+
|
| 262 |
+
if not self.takes_arg[opt]: # boolean option?
|
| 263 |
+
assert val == '', "boolean option can't have value"
|
| 264 |
+
alias = self.negative_alias.get(opt)
|
| 265 |
+
if alias:
|
| 266 |
+
opt = alias
|
| 267 |
+
val = 0
|
| 268 |
+
else:
|
| 269 |
+
val = 1
|
| 270 |
+
|
| 271 |
+
attr = self.attr_name[opt]
|
| 272 |
+
# The only repeating option at the moment is 'verbose'.
|
| 273 |
+
# It has a negative option -q quiet, which should set verbose = False.
|
| 274 |
+
if val and self.repeat.get(attr) is not None:
|
| 275 |
+
val = getattr(object, attr, 0) + 1
|
| 276 |
+
setattr(object, attr, val)
|
| 277 |
+
self.option_order.append((opt, val))
|
| 278 |
+
|
| 279 |
+
# for opts
|
| 280 |
+
if created_object:
|
| 281 |
+
return args, object
|
| 282 |
+
else:
|
| 283 |
+
return args
|
| 284 |
+
|
| 285 |
+
def get_option_order(self):
|
| 286 |
+
"""Returns the list of (option, value) tuples processed by the
|
| 287 |
+
previous run of 'getopt()'. Raises RuntimeError if
|
| 288 |
+
'getopt()' hasn't been called yet.
|
| 289 |
+
"""
|
| 290 |
+
if self.option_order is None:
|
| 291 |
+
raise RuntimeError("'getopt()' hasn't been called yet")
|
| 292 |
+
else:
|
| 293 |
+
return self.option_order
|
| 294 |
+
|
| 295 |
+
def generate_help(self, header=None): # noqa: C901
|
| 296 |
+
"""Generate help text (a list of strings, one per suggested line of
|
| 297 |
+
output) from the option table for this FancyGetopt object.
|
| 298 |
+
"""
|
| 299 |
+
# Blithely assume the option table is good: probably wouldn't call
|
| 300 |
+
# 'generate_help()' unless you've already called 'getopt()'.
|
| 301 |
+
|
| 302 |
+
# First pass: determine maximum length of long option names
|
| 303 |
+
max_opt = 0
|
| 304 |
+
for option in self.option_table:
|
| 305 |
+
long = option[0]
|
| 306 |
+
short = option[1]
|
| 307 |
+
ell = len(long)
|
| 308 |
+
if long[-1] == '=':
|
| 309 |
+
ell = ell - 1
|
| 310 |
+
if short is not None:
|
| 311 |
+
ell = ell + 5 # " (-x)" where short == 'x'
|
| 312 |
+
if ell > max_opt:
|
| 313 |
+
max_opt = ell
|
| 314 |
+
|
| 315 |
+
opt_width = max_opt + 2 + 2 + 2 # room for indent + dashes + gutter
|
| 316 |
+
|
| 317 |
+
# Typical help block looks like this:
|
| 318 |
+
# --foo controls foonabulation
|
| 319 |
+
# Help block for longest option looks like this:
|
| 320 |
+
# --flimflam set the flim-flam level
|
| 321 |
+
# and with wrapped text:
|
| 322 |
+
# --flimflam set the flim-flam level (must be between
|
| 323 |
+
# 0 and 100, except on Tuesdays)
|
| 324 |
+
# Options with short names will have the short name shown (but
|
| 325 |
+
# it doesn't contribute to max_opt):
|
| 326 |
+
# --foo (-f) controls foonabulation
|
| 327 |
+
# If adding the short option would make the left column too wide,
|
| 328 |
+
# we push the explanation off to the next line
|
| 329 |
+
# --flimflam (-l)
|
| 330 |
+
# set the flim-flam level
|
| 331 |
+
# Important parameters:
|
| 332 |
+
# - 2 spaces before option block start lines
|
| 333 |
+
# - 2 dashes for each long option name
|
| 334 |
+
# - min. 2 spaces between option and explanation (gutter)
|
| 335 |
+
# - 5 characters (incl. space) for short option name
|
| 336 |
+
|
| 337 |
+
# Now generate lines of help text. (If 80 columns were good enough
|
| 338 |
+
# for Jesus, then 78 columns are good enough for me!)
|
| 339 |
+
line_width = 78
|
| 340 |
+
text_width = line_width - opt_width
|
| 341 |
+
big_indent = ' ' * opt_width
|
| 342 |
+
if header:
|
| 343 |
+
lines = [header]
|
| 344 |
+
else:
|
| 345 |
+
lines = ['Option summary:']
|
| 346 |
+
|
| 347 |
+
for option in self.option_table:
|
| 348 |
+
long, short, help = option[:3]
|
| 349 |
+
text = wrap_text(help, text_width)
|
| 350 |
+
if long[-1] == '=':
|
| 351 |
+
long = long[0:-1]
|
| 352 |
+
|
| 353 |
+
# Case 1: no short option at all (makes life easy)
|
| 354 |
+
if short is None:
|
| 355 |
+
if text:
|
| 356 |
+
lines.append(f" --{long:<{max_opt}} {text[0]}")
|
| 357 |
+
else:
|
| 358 |
+
lines.append(f" --{long:<{max_opt}}")
|
| 359 |
+
|
| 360 |
+
# Case 2: we have a short option, so we have to include it
|
| 361 |
+
# just after the long option
|
| 362 |
+
else:
|
| 363 |
+
opt_names = f"{long} (-{short})"
|
| 364 |
+
if text:
|
| 365 |
+
lines.append(f" --{opt_names:<{max_opt}} {text[0]}")
|
| 366 |
+
else:
|
| 367 |
+
lines.append(f" --{opt_names:<{max_opt}}")
|
| 368 |
+
|
| 369 |
+
for ell in text[1:]:
|
| 370 |
+
lines.append(big_indent + ell)
|
| 371 |
+
return lines
|
| 372 |
+
|
| 373 |
+
def print_help(self, header=None, file=None):
|
| 374 |
+
if file is None:
|
| 375 |
+
file = sys.stdout
|
| 376 |
+
for line in self.generate_help(header):
|
| 377 |
+
file.write(line + "\n")
|
| 378 |
+
|
| 379 |
+
|
| 380 |
+
def fancy_getopt(options, negative_opt, object, args: Sequence[str] | None):
|
| 381 |
+
parser = FancyGetopt(options)
|
| 382 |
+
parser.set_negative_aliases(negative_opt)
|
| 383 |
+
return parser.getopt(args, object)
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
WS_TRANS = {ord(_wschar): ' ' for _wschar in string.whitespace}
|
| 387 |
+
|
| 388 |
+
|
| 389 |
+
def wrap_text(text, width):
|
| 390 |
+
"""wrap_text(text : string, width : int) -> [string]
|
| 391 |
+
|
| 392 |
+
Split 'text' into multiple lines of no more than 'width' characters
|
| 393 |
+
each, and return the list of strings that results.
|
| 394 |
+
"""
|
| 395 |
+
if text is None:
|
| 396 |
+
return []
|
| 397 |
+
if len(text) <= width:
|
| 398 |
+
return [text]
|
| 399 |
+
|
| 400 |
+
text = text.expandtabs()
|
| 401 |
+
text = text.translate(WS_TRANS)
|
| 402 |
+
chunks = re.split(r'( +|-+)', text)
|
| 403 |
+
chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings
|
| 404 |
+
lines = []
|
| 405 |
+
|
| 406 |
+
while chunks:
|
| 407 |
+
cur_line = [] # list of chunks (to-be-joined)
|
| 408 |
+
cur_len = 0 # length of current line
|
| 409 |
+
|
| 410 |
+
while chunks:
|
| 411 |
+
ell = len(chunks[0])
|
| 412 |
+
if cur_len + ell <= width: # can squeeze (at least) this chunk in
|
| 413 |
+
cur_line.append(chunks[0])
|
| 414 |
+
del chunks[0]
|
| 415 |
+
cur_len = cur_len + ell
|
| 416 |
+
else: # this line is full
|
| 417 |
+
# drop last chunk if all space
|
| 418 |
+
if cur_line and cur_line[-1][0] == ' ':
|
| 419 |
+
del cur_line[-1]
|
| 420 |
+
break
|
| 421 |
+
|
| 422 |
+
if chunks: # any chunks left to process?
|
| 423 |
+
# if the current line is still empty, then we had a single
|
| 424 |
+
# chunk that's too big too fit on a line -- so we break
|
| 425 |
+
# down and break it up at the line width
|
| 426 |
+
if cur_len == 0:
|
| 427 |
+
cur_line.append(chunks[0][0:width])
|
| 428 |
+
chunks[0] = chunks[0][width:]
|
| 429 |
+
|
| 430 |
+
# all-whitespace chunks at the end of a line can be discarded
|
| 431 |
+
# (and we know from the re.split above that if a chunk has
|
| 432 |
+
# *any* whitespace, it is *all* whitespace)
|
| 433 |
+
if chunks[0][0] == ' ':
|
| 434 |
+
del chunks[0]
|
| 435 |
+
|
| 436 |
+
# and store this line in the list-of-all-lines -- as a single
|
| 437 |
+
# string, of course!
|
| 438 |
+
lines.append(''.join(cur_line))
|
| 439 |
+
|
| 440 |
+
return lines
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
def translate_longopt(opt):
|
| 444 |
+
"""Convert a long option name to a valid Python identifier by
|
| 445 |
+
changing "-" to "_".
|
| 446 |
+
"""
|
| 447 |
+
return opt.translate(longopt_xlate)
|
| 448 |
+
|
| 449 |
+
|
| 450 |
+
class OptionDummy:
|
| 451 |
+
"""Dummy class just used as a place to hold command-line option
|
| 452 |
+
values as instance attributes."""
|
| 453 |
+
|
| 454 |
+
def __init__(self, options: Sequence[Any] = []):
|
| 455 |
+
"""Create a new OptionDummy instance. The attributes listed in
|
| 456 |
+
'options' will be initialized to None."""
|
| 457 |
+
for opt in options:
|
| 458 |
+
setattr(self, opt, None)
|
| 459 |
+
|
| 460 |
+
|
| 461 |
+
if __name__ == "__main__":
|
| 462 |
+
text = """\
|
| 463 |
+
Tra-la-la, supercalifragilisticexpialidocious.
|
| 464 |
+
How *do* you spell that odd word, anyways?
|
| 465 |
+
(Someone ask Mary -- she'll know [or she'll
|
| 466 |
+
say, "How should I know?"].)"""
|
| 467 |
+
|
| 468 |
+
for w in (10, 20, 30, 40):
|
| 469 |
+
print(f"width: {w}")
|
| 470 |
+
print("\n".join(wrap_text(text, w)))
|
| 471 |
+
print()
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/file_util.py
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.file_util
|
| 2 |
+
|
| 3 |
+
Utility functions for operating on single files.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
from ._log import log
|
| 9 |
+
from .errors import DistutilsFileError
|
| 10 |
+
|
| 11 |
+
# for generating verbose output in 'copy_file()'
|
| 12 |
+
_copy_action = {None: 'copying', 'hard': 'hard linking', 'sym': 'symbolically linking'}
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def _copy_file_contents(src, dst, buffer_size=16 * 1024): # noqa: C901
|
| 16 |
+
"""Copy the file 'src' to 'dst'; both must be filenames. Any error
|
| 17 |
+
opening either file, reading from 'src', or writing to 'dst', raises
|
| 18 |
+
DistutilsFileError. Data is read/written in chunks of 'buffer_size'
|
| 19 |
+
bytes (default 16k). No attempt is made to handle anything apart from
|
| 20 |
+
regular files.
|
| 21 |
+
"""
|
| 22 |
+
# Stolen from shutil module in the standard library, but with
|
| 23 |
+
# custom error-handling added.
|
| 24 |
+
fsrc = None
|
| 25 |
+
fdst = None
|
| 26 |
+
try:
|
| 27 |
+
try:
|
| 28 |
+
fsrc = open(src, 'rb')
|
| 29 |
+
except OSError as e:
|
| 30 |
+
raise DistutilsFileError(f"could not open '{src}': {e.strerror}")
|
| 31 |
+
|
| 32 |
+
if os.path.exists(dst):
|
| 33 |
+
try:
|
| 34 |
+
os.unlink(dst)
|
| 35 |
+
except OSError as e:
|
| 36 |
+
raise DistutilsFileError(f"could not delete '{dst}': {e.strerror}")
|
| 37 |
+
|
| 38 |
+
try:
|
| 39 |
+
fdst = open(dst, 'wb')
|
| 40 |
+
except OSError as e:
|
| 41 |
+
raise DistutilsFileError(f"could not create '{dst}': {e.strerror}")
|
| 42 |
+
|
| 43 |
+
while True:
|
| 44 |
+
try:
|
| 45 |
+
buf = fsrc.read(buffer_size)
|
| 46 |
+
except OSError as e:
|
| 47 |
+
raise DistutilsFileError(f"could not read from '{src}': {e.strerror}")
|
| 48 |
+
|
| 49 |
+
if not buf:
|
| 50 |
+
break
|
| 51 |
+
|
| 52 |
+
try:
|
| 53 |
+
fdst.write(buf)
|
| 54 |
+
except OSError as e:
|
| 55 |
+
raise DistutilsFileError(f"could not write to '{dst}': {e.strerror}")
|
| 56 |
+
finally:
|
| 57 |
+
if fdst:
|
| 58 |
+
fdst.close()
|
| 59 |
+
if fsrc:
|
| 60 |
+
fsrc.close()
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def copy_file( # noqa: C901
|
| 64 |
+
src,
|
| 65 |
+
dst,
|
| 66 |
+
preserve_mode=True,
|
| 67 |
+
preserve_times=True,
|
| 68 |
+
update=False,
|
| 69 |
+
link=None,
|
| 70 |
+
verbose=True,
|
| 71 |
+
):
|
| 72 |
+
"""Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is
|
| 73 |
+
copied there with the same name; otherwise, it must be a filename. (If
|
| 74 |
+
the file exists, it will be ruthlessly clobbered.) If 'preserve_mode'
|
| 75 |
+
is true (the default), the file's mode (type and permission bits, or
|
| 76 |
+
whatever is analogous on the current platform) is copied. If
|
| 77 |
+
'preserve_times' is true (the default), the last-modified and
|
| 78 |
+
last-access times are copied as well. If 'update' is true, 'src' will
|
| 79 |
+
only be copied if 'dst' does not exist, or if 'dst' does exist but is
|
| 80 |
+
older than 'src'.
|
| 81 |
+
|
| 82 |
+
'link' allows you to make hard links (os.link) or symbolic links
|
| 83 |
+
(os.symlink) instead of copying: set it to "hard" or "sym"; if it is
|
| 84 |
+
None (the default), files are copied. Don't set 'link' on systems that
|
| 85 |
+
don't support it: 'copy_file()' doesn't check if hard or symbolic
|
| 86 |
+
linking is available. If hardlink fails, falls back to
|
| 87 |
+
_copy_file_contents().
|
| 88 |
+
|
| 89 |
+
Under Mac OS, uses the native file copy function in macostools; on
|
| 90 |
+
other systems, uses '_copy_file_contents()' to copy file contents.
|
| 91 |
+
|
| 92 |
+
Return a tuple (dest_name, copied): 'dest_name' is the actual name of
|
| 93 |
+
the output file, and 'copied' is true if the file was copied.
|
| 94 |
+
"""
|
| 95 |
+
# XXX if the destination file already exists, we clobber it if
|
| 96 |
+
# copying, but blow up if linking. Hmmm. And I don't know what
|
| 97 |
+
# macostools.copyfile() does. Should definitely be consistent, and
|
| 98 |
+
# should probably blow up if destination exists and we would be
|
| 99 |
+
# changing it (ie. it's not already a hard/soft link to src OR
|
| 100 |
+
# (not update) and (src newer than dst).
|
| 101 |
+
|
| 102 |
+
from distutils._modified import newer
|
| 103 |
+
from stat import S_IMODE, ST_ATIME, ST_MODE, ST_MTIME
|
| 104 |
+
|
| 105 |
+
if not os.path.isfile(src):
|
| 106 |
+
raise DistutilsFileError(
|
| 107 |
+
f"can't copy '{src}': doesn't exist or not a regular file"
|
| 108 |
+
)
|
| 109 |
+
|
| 110 |
+
if os.path.isdir(dst):
|
| 111 |
+
dir = dst
|
| 112 |
+
dst = os.path.join(dst, os.path.basename(src))
|
| 113 |
+
else:
|
| 114 |
+
dir = os.path.dirname(dst)
|
| 115 |
+
|
| 116 |
+
if update and not newer(src, dst):
|
| 117 |
+
if verbose >= 1:
|
| 118 |
+
log.debug("not copying %s (output up-to-date)", src)
|
| 119 |
+
return (dst, False)
|
| 120 |
+
|
| 121 |
+
try:
|
| 122 |
+
action = _copy_action[link]
|
| 123 |
+
except KeyError:
|
| 124 |
+
raise ValueError(f"invalid value '{link}' for 'link' argument")
|
| 125 |
+
|
| 126 |
+
if verbose >= 1:
|
| 127 |
+
if os.path.basename(dst) == os.path.basename(src):
|
| 128 |
+
log.info("%s %s -> %s", action, src, dir)
|
| 129 |
+
else:
|
| 130 |
+
log.info("%s %s -> %s", action, src, dst)
|
| 131 |
+
|
| 132 |
+
# If linking (hard or symbolic), use the appropriate system call
|
| 133 |
+
# (Unix only, of course, but that's the caller's responsibility)
|
| 134 |
+
if link == 'hard':
|
| 135 |
+
if not (os.path.exists(dst) and os.path.samefile(src, dst)):
|
| 136 |
+
try:
|
| 137 |
+
os.link(src, dst)
|
| 138 |
+
except OSError:
|
| 139 |
+
# If hard linking fails, fall back on copying file
|
| 140 |
+
# (some special filesystems don't support hard linking
|
| 141 |
+
# even under Unix, see issue #8876).
|
| 142 |
+
pass
|
| 143 |
+
else:
|
| 144 |
+
return (dst, True)
|
| 145 |
+
elif link == 'sym':
|
| 146 |
+
if not (os.path.exists(dst) and os.path.samefile(src, dst)):
|
| 147 |
+
os.symlink(src, dst)
|
| 148 |
+
return (dst, True)
|
| 149 |
+
|
| 150 |
+
# Otherwise (non-Mac, not linking), copy the file contents and
|
| 151 |
+
# (optionally) copy the times and mode.
|
| 152 |
+
_copy_file_contents(src, dst)
|
| 153 |
+
if preserve_mode or preserve_times:
|
| 154 |
+
st = os.stat(src)
|
| 155 |
+
|
| 156 |
+
# According to David Ascher <da@ski.org>, utime() should be done
|
| 157 |
+
# before chmod() (at least under NT).
|
| 158 |
+
if preserve_times:
|
| 159 |
+
os.utime(dst, (st[ST_ATIME], st[ST_MTIME]))
|
| 160 |
+
if preserve_mode:
|
| 161 |
+
os.chmod(dst, S_IMODE(st[ST_MODE]))
|
| 162 |
+
|
| 163 |
+
return (dst, True)
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
# XXX I suspect this is Unix-specific -- need porting help!
|
| 167 |
+
def move_file(src, dst, verbose=True): # noqa: C901
|
| 168 |
+
"""Move a file 'src' to 'dst'. If 'dst' is a directory, the file will
|
| 169 |
+
be moved into it with the same name; otherwise, 'src' is just renamed
|
| 170 |
+
to 'dst'. Return the new full name of the file.
|
| 171 |
+
|
| 172 |
+
Handles cross-device moves on Unix using 'copy_file()'. What about
|
| 173 |
+
other systems???
|
| 174 |
+
"""
|
| 175 |
+
import errno
|
| 176 |
+
from os.path import basename, dirname, exists, isdir, isfile
|
| 177 |
+
|
| 178 |
+
if verbose >= 1:
|
| 179 |
+
log.info("moving %s -> %s", src, dst)
|
| 180 |
+
|
| 181 |
+
if not isfile(src):
|
| 182 |
+
raise DistutilsFileError(f"can't move '{src}': not a regular file")
|
| 183 |
+
|
| 184 |
+
if isdir(dst):
|
| 185 |
+
dst = os.path.join(dst, basename(src))
|
| 186 |
+
elif exists(dst):
|
| 187 |
+
raise DistutilsFileError(
|
| 188 |
+
f"can't move '{src}': destination '{dst}' already exists"
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
if not isdir(dirname(dst)):
|
| 192 |
+
raise DistutilsFileError(
|
| 193 |
+
f"can't move '{src}': destination '{dst}' not a valid path"
|
| 194 |
+
)
|
| 195 |
+
|
| 196 |
+
copy_it = False
|
| 197 |
+
try:
|
| 198 |
+
os.rename(src, dst)
|
| 199 |
+
except OSError as e:
|
| 200 |
+
(num, msg) = e.args
|
| 201 |
+
if num == errno.EXDEV:
|
| 202 |
+
copy_it = True
|
| 203 |
+
else:
|
| 204 |
+
raise DistutilsFileError(f"couldn't move '{src}' to '{dst}': {msg}")
|
| 205 |
+
|
| 206 |
+
if copy_it:
|
| 207 |
+
copy_file(src, dst, verbose=verbose)
|
| 208 |
+
try:
|
| 209 |
+
os.unlink(src)
|
| 210 |
+
except OSError as e:
|
| 211 |
+
(num, msg) = e.args
|
| 212 |
+
try:
|
| 213 |
+
os.unlink(dst)
|
| 214 |
+
except OSError:
|
| 215 |
+
pass
|
| 216 |
+
raise DistutilsFileError(
|
| 217 |
+
f"couldn't move '{src}' to '{dst}' by copy/delete: "
|
| 218 |
+
f"delete '{src}' failed: {msg}"
|
| 219 |
+
)
|
| 220 |
+
return dst
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
def write_file(filename, contents):
|
| 224 |
+
"""Create a file with the specified name and write 'contents' (a
|
| 225 |
+
sequence of strings without line terminators) to it.
|
| 226 |
+
"""
|
| 227 |
+
with open(filename, 'w', encoding='utf-8') as f:
|
| 228 |
+
f.writelines(line + '\n' for line in contents)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/filelist.py
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.filelist
|
| 2 |
+
|
| 3 |
+
Provides the FileList class, used for poking about the filesystem
|
| 4 |
+
and building lists of files.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import fnmatch
|
| 10 |
+
import functools
|
| 11 |
+
import os
|
| 12 |
+
import re
|
| 13 |
+
from collections.abc import Iterable
|
| 14 |
+
from typing import Literal, overload
|
| 15 |
+
|
| 16 |
+
from ._log import log
|
| 17 |
+
from .errors import DistutilsInternalError, DistutilsTemplateError
|
| 18 |
+
from .util import convert_path
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class FileList:
|
| 22 |
+
"""A list of files built by on exploring the filesystem and filtered by
|
| 23 |
+
applying various patterns to what we find there.
|
| 24 |
+
|
| 25 |
+
Instance attributes:
|
| 26 |
+
dir
|
| 27 |
+
directory from which files will be taken -- only used if
|
| 28 |
+
'allfiles' not supplied to constructor
|
| 29 |
+
files
|
| 30 |
+
list of filenames currently being built/filtered/manipulated
|
| 31 |
+
allfiles
|
| 32 |
+
complete list of files under consideration (ie. without any
|
| 33 |
+
filtering applied)
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
def __init__(self, warn: object = None, debug_print: object = None) -> None:
|
| 37 |
+
# ignore argument to FileList, but keep them for backwards
|
| 38 |
+
# compatibility
|
| 39 |
+
self.allfiles: Iterable[str] | None = None
|
| 40 |
+
self.files: list[str] = []
|
| 41 |
+
|
| 42 |
+
def set_allfiles(self, allfiles: Iterable[str]) -> None:
|
| 43 |
+
self.allfiles = allfiles
|
| 44 |
+
|
| 45 |
+
def findall(self, dir: str | os.PathLike[str] = os.curdir) -> None:
|
| 46 |
+
self.allfiles = findall(dir)
|
| 47 |
+
|
| 48 |
+
def debug_print(self, msg: object) -> None:
|
| 49 |
+
"""Print 'msg' to stdout if the global DEBUG (taken from the
|
| 50 |
+
DISTUTILS_DEBUG environment variable) flag is true.
|
| 51 |
+
"""
|
| 52 |
+
from distutils.debug import DEBUG
|
| 53 |
+
|
| 54 |
+
if DEBUG:
|
| 55 |
+
print(msg)
|
| 56 |
+
|
| 57 |
+
# Collection methods
|
| 58 |
+
|
| 59 |
+
def append(self, item: str) -> None:
|
| 60 |
+
self.files.append(item)
|
| 61 |
+
|
| 62 |
+
def extend(self, items: Iterable[str]) -> None:
|
| 63 |
+
self.files.extend(items)
|
| 64 |
+
|
| 65 |
+
def sort(self) -> None:
|
| 66 |
+
# Not a strict lexical sort!
|
| 67 |
+
sortable_files = sorted(map(os.path.split, self.files))
|
| 68 |
+
self.files = []
|
| 69 |
+
for sort_tuple in sortable_files:
|
| 70 |
+
self.files.append(os.path.join(*sort_tuple))
|
| 71 |
+
|
| 72 |
+
# Other miscellaneous utility methods
|
| 73 |
+
|
| 74 |
+
def remove_duplicates(self) -> None:
|
| 75 |
+
# Assumes list has been sorted!
|
| 76 |
+
for i in range(len(self.files) - 1, 0, -1):
|
| 77 |
+
if self.files[i] == self.files[i - 1]:
|
| 78 |
+
del self.files[i]
|
| 79 |
+
|
| 80 |
+
# "File template" methods
|
| 81 |
+
|
| 82 |
+
def _parse_template_line(self, line):
|
| 83 |
+
words = line.split()
|
| 84 |
+
action = words[0]
|
| 85 |
+
|
| 86 |
+
patterns = dir = dir_pattern = None
|
| 87 |
+
|
| 88 |
+
if action in ('include', 'exclude', 'global-include', 'global-exclude'):
|
| 89 |
+
if len(words) < 2:
|
| 90 |
+
raise DistutilsTemplateError(
|
| 91 |
+
f"'{action}' expects <pattern1> <pattern2> ..."
|
| 92 |
+
)
|
| 93 |
+
patterns = [convert_path(w) for w in words[1:]]
|
| 94 |
+
elif action in ('recursive-include', 'recursive-exclude'):
|
| 95 |
+
if len(words) < 3:
|
| 96 |
+
raise DistutilsTemplateError(
|
| 97 |
+
f"'{action}' expects <dir> <pattern1> <pattern2> ..."
|
| 98 |
+
)
|
| 99 |
+
dir = convert_path(words[1])
|
| 100 |
+
patterns = [convert_path(w) for w in words[2:]]
|
| 101 |
+
elif action in ('graft', 'prune'):
|
| 102 |
+
if len(words) != 2:
|
| 103 |
+
raise DistutilsTemplateError(
|
| 104 |
+
f"'{action}' expects a single <dir_pattern>"
|
| 105 |
+
)
|
| 106 |
+
dir_pattern = convert_path(words[1])
|
| 107 |
+
else:
|
| 108 |
+
raise DistutilsTemplateError(f"unknown action '{action}'")
|
| 109 |
+
|
| 110 |
+
return (action, patterns, dir, dir_pattern)
|
| 111 |
+
|
| 112 |
+
def process_template_line(self, line: str) -> None: # noqa: C901
|
| 113 |
+
# Parse the line: split it up, make sure the right number of words
|
| 114 |
+
# is there, and return the relevant words. 'action' is always
|
| 115 |
+
# defined: it's the first word of the line. Which of the other
|
| 116 |
+
# three are defined depends on the action; it'll be either
|
| 117 |
+
# patterns, (dir and patterns), or (dir_pattern).
|
| 118 |
+
(action, patterns, dir, dir_pattern) = self._parse_template_line(line)
|
| 119 |
+
|
| 120 |
+
# OK, now we know that the action is valid and we have the
|
| 121 |
+
# right number of words on the line for that action -- so we
|
| 122 |
+
# can proceed with minimal error-checking.
|
| 123 |
+
if action == 'include':
|
| 124 |
+
self.debug_print("include " + ' '.join(patterns))
|
| 125 |
+
for pattern in patterns:
|
| 126 |
+
if not self.include_pattern(pattern, anchor=True):
|
| 127 |
+
log.warning("warning: no files found matching '%s'", pattern)
|
| 128 |
+
|
| 129 |
+
elif action == 'exclude':
|
| 130 |
+
self.debug_print("exclude " + ' '.join(patterns))
|
| 131 |
+
for pattern in patterns:
|
| 132 |
+
if not self.exclude_pattern(pattern, anchor=True):
|
| 133 |
+
log.warning(
|
| 134 |
+
"warning: no previously-included files found matching '%s'",
|
| 135 |
+
pattern,
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
elif action == 'global-include':
|
| 139 |
+
self.debug_print("global-include " + ' '.join(patterns))
|
| 140 |
+
for pattern in patterns:
|
| 141 |
+
if not self.include_pattern(pattern, anchor=False):
|
| 142 |
+
log.warning(
|
| 143 |
+
(
|
| 144 |
+
"warning: no files found matching '%s' "
|
| 145 |
+
"anywhere in distribution"
|
| 146 |
+
),
|
| 147 |
+
pattern,
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
elif action == 'global-exclude':
|
| 151 |
+
self.debug_print("global-exclude " + ' '.join(patterns))
|
| 152 |
+
for pattern in patterns:
|
| 153 |
+
if not self.exclude_pattern(pattern, anchor=False):
|
| 154 |
+
log.warning(
|
| 155 |
+
(
|
| 156 |
+
"warning: no previously-included files matching "
|
| 157 |
+
"'%s' found anywhere in distribution"
|
| 158 |
+
),
|
| 159 |
+
pattern,
|
| 160 |
+
)
|
| 161 |
+
|
| 162 |
+
elif action == 'recursive-include':
|
| 163 |
+
self.debug_print("recursive-include {} {}".format(dir, ' '.join(patterns)))
|
| 164 |
+
for pattern in patterns:
|
| 165 |
+
if not self.include_pattern(pattern, prefix=dir):
|
| 166 |
+
msg = "warning: no files found matching '%s' under directory '%s'"
|
| 167 |
+
log.warning(msg, pattern, dir)
|
| 168 |
+
|
| 169 |
+
elif action == 'recursive-exclude':
|
| 170 |
+
self.debug_print("recursive-exclude {} {}".format(dir, ' '.join(patterns)))
|
| 171 |
+
for pattern in patterns:
|
| 172 |
+
if not self.exclude_pattern(pattern, prefix=dir):
|
| 173 |
+
log.warning(
|
| 174 |
+
(
|
| 175 |
+
"warning: no previously-included files matching "
|
| 176 |
+
"'%s' found under directory '%s'"
|
| 177 |
+
),
|
| 178 |
+
pattern,
|
| 179 |
+
dir,
|
| 180 |
+
)
|
| 181 |
+
|
| 182 |
+
elif action == 'graft':
|
| 183 |
+
self.debug_print("graft " + dir_pattern)
|
| 184 |
+
if not self.include_pattern(None, prefix=dir_pattern):
|
| 185 |
+
log.warning("warning: no directories found matching '%s'", dir_pattern)
|
| 186 |
+
|
| 187 |
+
elif action == 'prune':
|
| 188 |
+
self.debug_print("prune " + dir_pattern)
|
| 189 |
+
if not self.exclude_pattern(None, prefix=dir_pattern):
|
| 190 |
+
log.warning(
|
| 191 |
+
("no previously-included directories found matching '%s'"),
|
| 192 |
+
dir_pattern,
|
| 193 |
+
)
|
| 194 |
+
else:
|
| 195 |
+
raise DistutilsInternalError(
|
| 196 |
+
f"this cannot happen: invalid action '{action}'"
|
| 197 |
+
)
|
| 198 |
+
|
| 199 |
+
# Filtering/selection methods
|
| 200 |
+
@overload
|
| 201 |
+
def include_pattern(
|
| 202 |
+
self,
|
| 203 |
+
pattern: str,
|
| 204 |
+
anchor: bool = True,
|
| 205 |
+
prefix: str | None = None,
|
| 206 |
+
is_regex: Literal[False] = False,
|
| 207 |
+
) -> bool: ...
|
| 208 |
+
@overload
|
| 209 |
+
def include_pattern(
|
| 210 |
+
self,
|
| 211 |
+
pattern: str | re.Pattern[str],
|
| 212 |
+
anchor: bool = True,
|
| 213 |
+
prefix: str | None = None,
|
| 214 |
+
*,
|
| 215 |
+
is_regex: Literal[True],
|
| 216 |
+
) -> bool: ...
|
| 217 |
+
@overload
|
| 218 |
+
def include_pattern(
|
| 219 |
+
self,
|
| 220 |
+
pattern: str | re.Pattern[str],
|
| 221 |
+
anchor: bool,
|
| 222 |
+
prefix: str | None,
|
| 223 |
+
is_regex: Literal[True],
|
| 224 |
+
) -> bool: ...
|
| 225 |
+
def include_pattern(
|
| 226 |
+
self,
|
| 227 |
+
pattern: str | re.Pattern,
|
| 228 |
+
anchor: bool = True,
|
| 229 |
+
prefix: str | None = None,
|
| 230 |
+
is_regex: bool = False,
|
| 231 |
+
) -> bool:
|
| 232 |
+
"""Select strings (presumably filenames) from 'self.files' that
|
| 233 |
+
match 'pattern', a Unix-style wildcard (glob) pattern. Patterns
|
| 234 |
+
are not quite the same as implemented by the 'fnmatch' module: '*'
|
| 235 |
+
and '?' match non-special characters, where "special" is platform-
|
| 236 |
+
dependent: slash on Unix; colon, slash, and backslash on
|
| 237 |
+
DOS/Windows; and colon on Mac OS.
|
| 238 |
+
|
| 239 |
+
If 'anchor' is true (the default), then the pattern match is more
|
| 240 |
+
stringent: "*.py" will match "foo.py" but not "foo/bar.py". If
|
| 241 |
+
'anchor' is false, both of these will match.
|
| 242 |
+
|
| 243 |
+
If 'prefix' is supplied, then only filenames starting with 'prefix'
|
| 244 |
+
(itself a pattern) and ending with 'pattern', with anything in between
|
| 245 |
+
them, will match. 'anchor' is ignored in this case.
|
| 246 |
+
|
| 247 |
+
If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
|
| 248 |
+
'pattern' is assumed to be either a string containing a regex or a
|
| 249 |
+
regex object -- no translation is done, the regex is just compiled
|
| 250 |
+
and used as-is.
|
| 251 |
+
|
| 252 |
+
Selected strings will be added to self.files.
|
| 253 |
+
|
| 254 |
+
Return True if files are found, False otherwise.
|
| 255 |
+
"""
|
| 256 |
+
# XXX docstring lying about what the special chars are?
|
| 257 |
+
files_found = False
|
| 258 |
+
pattern_re = translate_pattern(pattern, anchor, prefix, is_regex)
|
| 259 |
+
self.debug_print(f"include_pattern: applying regex r'{pattern_re.pattern}'")
|
| 260 |
+
|
| 261 |
+
# delayed loading of allfiles list
|
| 262 |
+
if self.allfiles is None:
|
| 263 |
+
self.findall()
|
| 264 |
+
|
| 265 |
+
for name in self.allfiles:
|
| 266 |
+
if pattern_re.search(name):
|
| 267 |
+
self.debug_print(" adding " + name)
|
| 268 |
+
self.files.append(name)
|
| 269 |
+
files_found = True
|
| 270 |
+
return files_found
|
| 271 |
+
|
| 272 |
+
@overload
|
| 273 |
+
def exclude_pattern(
|
| 274 |
+
self,
|
| 275 |
+
pattern: str,
|
| 276 |
+
anchor: bool = True,
|
| 277 |
+
prefix: str | None = None,
|
| 278 |
+
is_regex: Literal[False] = False,
|
| 279 |
+
) -> bool: ...
|
| 280 |
+
@overload
|
| 281 |
+
def exclude_pattern(
|
| 282 |
+
self,
|
| 283 |
+
pattern: str | re.Pattern[str],
|
| 284 |
+
anchor: bool = True,
|
| 285 |
+
prefix: str | None = None,
|
| 286 |
+
*,
|
| 287 |
+
is_regex: Literal[True],
|
| 288 |
+
) -> bool: ...
|
| 289 |
+
@overload
|
| 290 |
+
def exclude_pattern(
|
| 291 |
+
self,
|
| 292 |
+
pattern: str | re.Pattern[str],
|
| 293 |
+
anchor: bool,
|
| 294 |
+
prefix: str | None,
|
| 295 |
+
is_regex: Literal[True],
|
| 296 |
+
) -> bool: ...
|
| 297 |
+
def exclude_pattern(
|
| 298 |
+
self,
|
| 299 |
+
pattern: str | re.Pattern,
|
| 300 |
+
anchor: bool = True,
|
| 301 |
+
prefix: str | None = None,
|
| 302 |
+
is_regex: bool = False,
|
| 303 |
+
) -> bool:
|
| 304 |
+
"""Remove strings (presumably filenames) from 'files' that match
|
| 305 |
+
'pattern'. Other parameters are the same as for
|
| 306 |
+
'include_pattern()', above.
|
| 307 |
+
The list 'self.files' is modified in place.
|
| 308 |
+
Return True if files are found, False otherwise.
|
| 309 |
+
"""
|
| 310 |
+
files_found = False
|
| 311 |
+
pattern_re = translate_pattern(pattern, anchor, prefix, is_regex)
|
| 312 |
+
self.debug_print(f"exclude_pattern: applying regex r'{pattern_re.pattern}'")
|
| 313 |
+
for i in range(len(self.files) - 1, -1, -1):
|
| 314 |
+
if pattern_re.search(self.files[i]):
|
| 315 |
+
self.debug_print(" removing " + self.files[i])
|
| 316 |
+
del self.files[i]
|
| 317 |
+
files_found = True
|
| 318 |
+
return files_found
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
# Utility functions
|
| 322 |
+
|
| 323 |
+
|
| 324 |
+
def _find_all_simple(path):
|
| 325 |
+
"""
|
| 326 |
+
Find all files under 'path'
|
| 327 |
+
"""
|
| 328 |
+
all_unique = _UniqueDirs.filter(os.walk(path, followlinks=True))
|
| 329 |
+
results = (
|
| 330 |
+
os.path.join(base, file) for base, dirs, files in all_unique for file in files
|
| 331 |
+
)
|
| 332 |
+
return filter(os.path.isfile, results)
|
| 333 |
+
|
| 334 |
+
|
| 335 |
+
class _UniqueDirs(set):
|
| 336 |
+
"""
|
| 337 |
+
Exclude previously-seen dirs from walk results,
|
| 338 |
+
avoiding infinite recursion.
|
| 339 |
+
Ref https://bugs.python.org/issue44497.
|
| 340 |
+
"""
|
| 341 |
+
|
| 342 |
+
def __call__(self, walk_item):
|
| 343 |
+
"""
|
| 344 |
+
Given an item from an os.walk result, determine
|
| 345 |
+
if the item represents a unique dir for this instance
|
| 346 |
+
and if not, prevent further traversal.
|
| 347 |
+
"""
|
| 348 |
+
base, dirs, files = walk_item
|
| 349 |
+
stat = os.stat(base)
|
| 350 |
+
candidate = stat.st_dev, stat.st_ino
|
| 351 |
+
found = candidate in self
|
| 352 |
+
if found:
|
| 353 |
+
del dirs[:]
|
| 354 |
+
self.add(candidate)
|
| 355 |
+
return not found
|
| 356 |
+
|
| 357 |
+
@classmethod
|
| 358 |
+
def filter(cls, items):
|
| 359 |
+
return filter(cls(), items)
|
| 360 |
+
|
| 361 |
+
|
| 362 |
+
def findall(dir: str | os.PathLike[str] = os.curdir):
|
| 363 |
+
"""
|
| 364 |
+
Find all files under 'dir' and return the list of full filenames.
|
| 365 |
+
Unless dir is '.', return full filenames with dir prepended.
|
| 366 |
+
"""
|
| 367 |
+
files = _find_all_simple(dir)
|
| 368 |
+
if dir == os.curdir:
|
| 369 |
+
make_rel = functools.partial(os.path.relpath, start=dir)
|
| 370 |
+
files = map(make_rel, files)
|
| 371 |
+
return list(files)
|
| 372 |
+
|
| 373 |
+
|
| 374 |
+
def glob_to_re(pattern):
|
| 375 |
+
"""Translate a shell-like glob pattern to a regular expression; return
|
| 376 |
+
a string containing the regex. Differs from 'fnmatch.translate()' in
|
| 377 |
+
that '*' does not match "special characters" (which are
|
| 378 |
+
platform-specific).
|
| 379 |
+
"""
|
| 380 |
+
pattern_re = fnmatch.translate(pattern)
|
| 381 |
+
|
| 382 |
+
# '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
|
| 383 |
+
# IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
|
| 384 |
+
# and by extension they shouldn't match such "special characters" under
|
| 385 |
+
# any OS. So change all non-escaped dots in the RE to match any
|
| 386 |
+
# character except the special characters (currently: just os.sep).
|
| 387 |
+
sep = os.sep
|
| 388 |
+
if os.sep == '\\':
|
| 389 |
+
# we're using a regex to manipulate a regex, so we need
|
| 390 |
+
# to escape the backslash twice
|
| 391 |
+
sep = r'\\\\'
|
| 392 |
+
escaped = rf'\1[^{sep}]'
|
| 393 |
+
pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', escaped, pattern_re)
|
| 394 |
+
return pattern_re
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
def translate_pattern(pattern, anchor=True, prefix=None, is_regex=False):
|
| 398 |
+
"""Translate a shell-like wildcard pattern to a compiled regular
|
| 399 |
+
expression. Return the compiled regex. If 'is_regex' true,
|
| 400 |
+
then 'pattern' is directly compiled to a regex (if it's a string)
|
| 401 |
+
or just returned as-is (assumes it's a regex object).
|
| 402 |
+
"""
|
| 403 |
+
if is_regex:
|
| 404 |
+
if isinstance(pattern, str):
|
| 405 |
+
return re.compile(pattern)
|
| 406 |
+
else:
|
| 407 |
+
return pattern
|
| 408 |
+
|
| 409 |
+
# ditch start and end characters
|
| 410 |
+
start, _, end = glob_to_re('_').partition('_')
|
| 411 |
+
|
| 412 |
+
if pattern:
|
| 413 |
+
pattern_re = glob_to_re(pattern)
|
| 414 |
+
assert pattern_re.startswith(start) and pattern_re.endswith(end)
|
| 415 |
+
else:
|
| 416 |
+
pattern_re = ''
|
| 417 |
+
|
| 418 |
+
if prefix is not None:
|
| 419 |
+
prefix_re = glob_to_re(prefix)
|
| 420 |
+
assert prefix_re.startswith(start) and prefix_re.endswith(end)
|
| 421 |
+
prefix_re = prefix_re[len(start) : len(prefix_re) - len(end)]
|
| 422 |
+
sep = os.sep
|
| 423 |
+
if os.sep == '\\':
|
| 424 |
+
sep = r'\\'
|
| 425 |
+
pattern_re = pattern_re[len(start) : len(pattern_re) - len(end)]
|
| 426 |
+
pattern_re = rf'{start}\A{prefix_re}{sep}.*{pattern_re}{end}'
|
| 427 |
+
else: # no prefix -- respect anchor flag
|
| 428 |
+
if anchor:
|
| 429 |
+
pattern_re = rf'{start}\A{pattern_re[len(start) :]}'
|
| 430 |
+
|
| 431 |
+
return re.compile(pattern_re)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/log.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
A simple log mechanism styled after PEP 282.
|
| 3 |
+
|
| 4 |
+
Retained for compatibility and should not be used.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import logging
|
| 8 |
+
import warnings
|
| 9 |
+
|
| 10 |
+
from ._log import log as _global_log
|
| 11 |
+
|
| 12 |
+
DEBUG = logging.DEBUG
|
| 13 |
+
INFO = logging.INFO
|
| 14 |
+
WARN = logging.WARN
|
| 15 |
+
ERROR = logging.ERROR
|
| 16 |
+
FATAL = logging.FATAL
|
| 17 |
+
|
| 18 |
+
log = _global_log.log
|
| 19 |
+
debug = _global_log.debug
|
| 20 |
+
info = _global_log.info
|
| 21 |
+
warn = _global_log.warning
|
| 22 |
+
error = _global_log.error
|
| 23 |
+
fatal = _global_log.fatal
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def set_threshold(level):
|
| 27 |
+
orig = _global_log.level
|
| 28 |
+
_global_log.setLevel(level)
|
| 29 |
+
return orig
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def set_verbosity(v):
|
| 33 |
+
if v <= 0:
|
| 34 |
+
set_threshold(logging.WARN)
|
| 35 |
+
elif v == 1:
|
| 36 |
+
set_threshold(logging.INFO)
|
| 37 |
+
elif v >= 2:
|
| 38 |
+
set_threshold(logging.DEBUG)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
class Log(logging.Logger):
|
| 42 |
+
"""distutils.log.Log is deprecated, please use an alternative from `logging`."""
|
| 43 |
+
|
| 44 |
+
def __init__(self, threshold=WARN):
|
| 45 |
+
warnings.warn(Log.__doc__) # avoid DeprecationWarning to ensure warn is shown
|
| 46 |
+
super().__init__(__name__, level=threshold)
|
| 47 |
+
|
| 48 |
+
@property
|
| 49 |
+
def threshold(self):
|
| 50 |
+
return self.level
|
| 51 |
+
|
| 52 |
+
@threshold.setter
|
| 53 |
+
def threshold(self, level):
|
| 54 |
+
self.setLevel(level)
|
| 55 |
+
|
| 56 |
+
warn = logging.Logger.warning
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/spawn.py
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.spawn
|
| 2 |
+
|
| 3 |
+
Provides the 'spawn()' function, a front-end to various platform-
|
| 4 |
+
specific functions for launching another program in a sub-process.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import os
|
| 10 |
+
import platform
|
| 11 |
+
import shutil
|
| 12 |
+
import subprocess
|
| 13 |
+
import sys
|
| 14 |
+
import warnings
|
| 15 |
+
from collections.abc import Mapping, MutableSequence
|
| 16 |
+
from typing import TYPE_CHECKING, TypeVar, overload
|
| 17 |
+
|
| 18 |
+
from ._log import log
|
| 19 |
+
from .debug import DEBUG
|
| 20 |
+
from .errors import DistutilsExecError
|
| 21 |
+
|
| 22 |
+
if TYPE_CHECKING:
|
| 23 |
+
from subprocess import _ENV
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
_MappingT = TypeVar("_MappingT", bound=Mapping)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def _debug(cmd):
|
| 30 |
+
"""
|
| 31 |
+
Render a subprocess command differently depending on DEBUG.
|
| 32 |
+
"""
|
| 33 |
+
return cmd if DEBUG else cmd[0]
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _inject_macos_ver(env: _MappingT | None) -> _MappingT | dict[str, str | int] | None:
|
| 37 |
+
if platform.system() != 'Darwin':
|
| 38 |
+
return env
|
| 39 |
+
|
| 40 |
+
from .util import MACOSX_VERSION_VAR, get_macosx_target_ver
|
| 41 |
+
|
| 42 |
+
target_ver = get_macosx_target_ver()
|
| 43 |
+
update = {MACOSX_VERSION_VAR: target_ver} if target_ver else {}
|
| 44 |
+
return {**_resolve(env), **update}
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
@overload
|
| 48 |
+
def _resolve(env: None) -> os._Environ[str]: ...
|
| 49 |
+
@overload
|
| 50 |
+
def _resolve(env: _MappingT) -> _MappingT: ...
|
| 51 |
+
def _resolve(env: _MappingT | None) -> _MappingT | os._Environ[str]:
|
| 52 |
+
return os.environ if env is None else env
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def spawn(
|
| 56 |
+
cmd: MutableSequence[bytes | str | os.PathLike[str]],
|
| 57 |
+
search_path: bool = True,
|
| 58 |
+
verbose: bool = False,
|
| 59 |
+
env: _ENV | None = None,
|
| 60 |
+
) -> None:
|
| 61 |
+
"""Run another program, specified as a command list 'cmd', in a new process.
|
| 62 |
+
|
| 63 |
+
'cmd' is just the argument list for the new process, ie.
|
| 64 |
+
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
|
| 65 |
+
There is no way to run a program with a name different from that of its
|
| 66 |
+
executable.
|
| 67 |
+
|
| 68 |
+
If 'search_path' is true (the default), the system's executable
|
| 69 |
+
search path will be used to find the program; otherwise, cmd[0]
|
| 70 |
+
must be the exact path to the executable.
|
| 71 |
+
|
| 72 |
+
Raise DistutilsExecError if running the program fails in any way; just
|
| 73 |
+
return on success.
|
| 74 |
+
"""
|
| 75 |
+
log.info(subprocess.list2cmdline(cmd))
|
| 76 |
+
|
| 77 |
+
if search_path:
|
| 78 |
+
executable = shutil.which(cmd[0])
|
| 79 |
+
if executable is not None:
|
| 80 |
+
cmd[0] = executable
|
| 81 |
+
|
| 82 |
+
try:
|
| 83 |
+
subprocess.check_call(cmd, env=_inject_macos_ver(env))
|
| 84 |
+
except OSError as exc:
|
| 85 |
+
raise DistutilsExecError(
|
| 86 |
+
f"command {_debug(cmd)!r} failed: {exc.args[-1]}"
|
| 87 |
+
) from exc
|
| 88 |
+
except subprocess.CalledProcessError as err:
|
| 89 |
+
raise DistutilsExecError(
|
| 90 |
+
f"command {_debug(cmd)!r} failed with exit code {err.returncode}"
|
| 91 |
+
) from err
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def find_executable(executable: str, path: str | None = None) -> str | None:
|
| 95 |
+
"""Tries to find 'executable' in the directories listed in 'path'.
|
| 96 |
+
|
| 97 |
+
A string listing directories separated by 'os.pathsep'; defaults to
|
| 98 |
+
os.environ['PATH']. Returns the complete filename or None if not found.
|
| 99 |
+
"""
|
| 100 |
+
warnings.warn(
|
| 101 |
+
'Use shutil.which instead of find_executable', DeprecationWarning, stacklevel=2
|
| 102 |
+
)
|
| 103 |
+
_, ext = os.path.splitext(executable)
|
| 104 |
+
if (sys.platform == 'win32') and (ext != '.exe'):
|
| 105 |
+
executable = executable + '.exe'
|
| 106 |
+
|
| 107 |
+
if os.path.isfile(executable):
|
| 108 |
+
return executable
|
| 109 |
+
|
| 110 |
+
if path is None:
|
| 111 |
+
path = os.environ.get('PATH', None)
|
| 112 |
+
# bpo-35755: Don't fall through if PATH is the empty string
|
| 113 |
+
if path is None:
|
| 114 |
+
try:
|
| 115 |
+
path = os.confstr("CS_PATH")
|
| 116 |
+
except (AttributeError, ValueError):
|
| 117 |
+
# os.confstr() or CS_PATH is not available
|
| 118 |
+
path = os.defpath
|
| 119 |
+
|
| 120 |
+
# PATH='' doesn't match, whereas PATH=':' looks in the current directory
|
| 121 |
+
if not path:
|
| 122 |
+
return None
|
| 123 |
+
|
| 124 |
+
paths = path.split(os.pathsep)
|
| 125 |
+
for p in paths:
|
| 126 |
+
f = os.path.join(p, executable)
|
| 127 |
+
if os.path.isfile(f):
|
| 128 |
+
# the file exists, we have a shot at spawn working
|
| 129 |
+
return f
|
| 130 |
+
return None
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/sysconfig.py
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Provide access to Python's configuration information. The specific
|
| 2 |
+
configuration variables available depend heavily on the platform and
|
| 3 |
+
configuration. The values may be retrieved using
|
| 4 |
+
get_config_var(name), and the list of variables is available via
|
| 5 |
+
get_config_vars().keys(). Additional convenience functions are also
|
| 6 |
+
available.
|
| 7 |
+
|
| 8 |
+
Written by: Fred L. Drake, Jr.
|
| 9 |
+
Email: <fdrake@acm.org>
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
import functools
|
| 15 |
+
import os
|
| 16 |
+
import pathlib
|
| 17 |
+
import re
|
| 18 |
+
import sys
|
| 19 |
+
import sysconfig
|
| 20 |
+
from typing import TYPE_CHECKING, Literal, overload
|
| 21 |
+
|
| 22 |
+
from jaraco.functools import pass_none
|
| 23 |
+
|
| 24 |
+
from .ccompiler import CCompiler
|
| 25 |
+
from .compat import py39
|
| 26 |
+
from .errors import DistutilsPlatformError
|
| 27 |
+
from .util import is_mingw
|
| 28 |
+
|
| 29 |
+
if TYPE_CHECKING:
|
| 30 |
+
from typing_extensions import deprecated
|
| 31 |
+
else:
|
| 32 |
+
|
| 33 |
+
def deprecated(message):
|
| 34 |
+
return lambda fn: fn
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
IS_PYPY = '__pypy__' in sys.builtin_module_names
|
| 38 |
+
|
| 39 |
+
# These are needed in a couple of spots, so just compute them once.
|
| 40 |
+
PREFIX = os.path.normpath(sys.prefix)
|
| 41 |
+
EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
|
| 42 |
+
BASE_PREFIX = os.path.normpath(sys.base_prefix)
|
| 43 |
+
BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
|
| 44 |
+
|
| 45 |
+
# Path to the base directory of the project. On Windows the binary may
|
| 46 |
+
# live in project/PCbuild/win32 or project/PCbuild/amd64.
|
| 47 |
+
# set for cross builds
|
| 48 |
+
if "_PYTHON_PROJECT_BASE" in os.environ:
|
| 49 |
+
project_base = os.path.abspath(os.environ["_PYTHON_PROJECT_BASE"])
|
| 50 |
+
else:
|
| 51 |
+
if sys.executable:
|
| 52 |
+
project_base = os.path.dirname(os.path.abspath(sys.executable))
|
| 53 |
+
else:
|
| 54 |
+
# sys.executable can be empty if argv[0] has been changed and Python is
|
| 55 |
+
# unable to retrieve the real program name
|
| 56 |
+
project_base = os.getcwd()
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def _is_python_source_dir(d):
|
| 60 |
+
"""
|
| 61 |
+
Return True if the target directory appears to point to an
|
| 62 |
+
un-installed Python.
|
| 63 |
+
"""
|
| 64 |
+
modules = pathlib.Path(d).joinpath('Modules')
|
| 65 |
+
return any(modules.joinpath(fn).is_file() for fn in ('Setup', 'Setup.local'))
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
_sys_home = getattr(sys, '_home', None)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def _is_parent(dir_a, dir_b):
|
| 72 |
+
"""
|
| 73 |
+
Return True if a is a parent of b.
|
| 74 |
+
"""
|
| 75 |
+
return os.path.normcase(dir_a).startswith(os.path.normcase(dir_b))
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
if os.name == 'nt':
|
| 79 |
+
|
| 80 |
+
@pass_none
|
| 81 |
+
def _fix_pcbuild(d):
|
| 82 |
+
# In a venv, sys._home will be inside BASE_PREFIX rather than PREFIX.
|
| 83 |
+
prefixes = PREFIX, BASE_PREFIX
|
| 84 |
+
matched = (
|
| 85 |
+
prefix
|
| 86 |
+
for prefix in prefixes
|
| 87 |
+
if _is_parent(d, os.path.join(prefix, "PCbuild"))
|
| 88 |
+
)
|
| 89 |
+
return next(matched, d)
|
| 90 |
+
|
| 91 |
+
project_base = _fix_pcbuild(project_base)
|
| 92 |
+
_sys_home = _fix_pcbuild(_sys_home)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
def _python_build():
|
| 96 |
+
if _sys_home:
|
| 97 |
+
return _is_python_source_dir(_sys_home)
|
| 98 |
+
return _is_python_source_dir(project_base)
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
python_build = _python_build()
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
# Calculate the build qualifier flags if they are defined. Adding the flags
|
| 105 |
+
# to the include and lib directories only makes sense for an installation, not
|
| 106 |
+
# an in-source build.
|
| 107 |
+
build_flags = ''
|
| 108 |
+
try:
|
| 109 |
+
if not python_build:
|
| 110 |
+
build_flags = sys.abiflags
|
| 111 |
+
except AttributeError:
|
| 112 |
+
# It's not a configure-based build, so the sys module doesn't have
|
| 113 |
+
# this attribute, which is fine.
|
| 114 |
+
pass
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def get_python_version():
|
| 118 |
+
"""Return a string containing the major and minor Python version,
|
| 119 |
+
leaving off the patchlevel. Sample return values could be '1.5'
|
| 120 |
+
or '2.2'.
|
| 121 |
+
"""
|
| 122 |
+
return f'{sys.version_info.major}.{sys.version_info.minor}'
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def get_python_inc(plat_specific: bool = False, prefix: str | None = None) -> str:
|
| 126 |
+
"""Return the directory containing installed Python header files.
|
| 127 |
+
|
| 128 |
+
If 'plat_specific' is false (the default), this is the path to the
|
| 129 |
+
non-platform-specific header files, i.e. Python.h and so on;
|
| 130 |
+
otherwise, this is the path to platform-specific header files
|
| 131 |
+
(namely pyconfig.h).
|
| 132 |
+
|
| 133 |
+
If 'prefix' is supplied, use it instead of sys.base_prefix or
|
| 134 |
+
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
|
| 135 |
+
"""
|
| 136 |
+
default_prefix = BASE_EXEC_PREFIX if plat_specific else BASE_PREFIX
|
| 137 |
+
resolved_prefix = prefix if prefix is not None else default_prefix
|
| 138 |
+
# MinGW imitates posix like layout, but os.name != posix
|
| 139 |
+
os_name = "posix" if is_mingw() else os.name
|
| 140 |
+
try:
|
| 141 |
+
getter = globals()[f'_get_python_inc_{os_name}']
|
| 142 |
+
except KeyError:
|
| 143 |
+
raise DistutilsPlatformError(
|
| 144 |
+
"I don't know where Python installs its C header files "
|
| 145 |
+
f"on platform '{os.name}'"
|
| 146 |
+
)
|
| 147 |
+
return getter(resolved_prefix, prefix, plat_specific)
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
@pass_none
|
| 151 |
+
def _extant(path):
|
| 152 |
+
"""
|
| 153 |
+
Replace path with None if it doesn't exist.
|
| 154 |
+
"""
|
| 155 |
+
return path if os.path.exists(path) else None
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
def _get_python_inc_posix(prefix, spec_prefix, plat_specific):
|
| 159 |
+
return (
|
| 160 |
+
_get_python_inc_posix_python(plat_specific)
|
| 161 |
+
or _extant(_get_python_inc_from_config(plat_specific, spec_prefix))
|
| 162 |
+
or _get_python_inc_posix_prefix(prefix)
|
| 163 |
+
)
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def _get_python_inc_posix_python(plat_specific):
|
| 167 |
+
"""
|
| 168 |
+
Assume the executable is in the build directory. The
|
| 169 |
+
pyconfig.h file should be in the same directory. Since
|
| 170 |
+
the build directory may not be the source directory,
|
| 171 |
+
use "srcdir" from the makefile to find the "Include"
|
| 172 |
+
directory.
|
| 173 |
+
"""
|
| 174 |
+
if not python_build:
|
| 175 |
+
return
|
| 176 |
+
if plat_specific:
|
| 177 |
+
return _sys_home or project_base
|
| 178 |
+
incdir = os.path.join(get_config_var('srcdir'), 'Include')
|
| 179 |
+
return os.path.normpath(incdir)
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def _get_python_inc_from_config(plat_specific, spec_prefix):
|
| 183 |
+
"""
|
| 184 |
+
If no prefix was explicitly specified, provide the include
|
| 185 |
+
directory from the config vars. Useful when
|
| 186 |
+
cross-compiling, since the config vars may come from
|
| 187 |
+
the host
|
| 188 |
+
platform Python installation, while the current Python
|
| 189 |
+
executable is from the build platform installation.
|
| 190 |
+
|
| 191 |
+
>>> monkeypatch = getfixture('monkeypatch')
|
| 192 |
+
>>> gpifc = _get_python_inc_from_config
|
| 193 |
+
>>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower)
|
| 194 |
+
>>> gpifc(False, '/usr/bin/')
|
| 195 |
+
>>> gpifc(False, '')
|
| 196 |
+
>>> gpifc(False, None)
|
| 197 |
+
'includepy'
|
| 198 |
+
>>> gpifc(True, None)
|
| 199 |
+
'confincludepy'
|
| 200 |
+
"""
|
| 201 |
+
if spec_prefix is None:
|
| 202 |
+
return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
def _get_python_inc_posix_prefix(prefix):
|
| 206 |
+
implementation = 'pypy' if IS_PYPY else 'python'
|
| 207 |
+
python_dir = implementation + get_python_version() + build_flags
|
| 208 |
+
return os.path.join(prefix, "include", python_dir)
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
def _get_python_inc_nt(prefix, spec_prefix, plat_specific):
|
| 212 |
+
if python_build:
|
| 213 |
+
# Include both include dirs to ensure we can find pyconfig.h
|
| 214 |
+
return (
|
| 215 |
+
os.path.join(prefix, "include")
|
| 216 |
+
+ os.path.pathsep
|
| 217 |
+
+ os.path.dirname(sysconfig.get_config_h_filename())
|
| 218 |
+
)
|
| 219 |
+
return os.path.join(prefix, "include")
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
# allow this behavior to be monkey-patched. Ref pypa/distutils#2.
|
| 223 |
+
def _posix_lib(standard_lib, libpython, early_prefix, prefix):
|
| 224 |
+
if standard_lib:
|
| 225 |
+
return libpython
|
| 226 |
+
else:
|
| 227 |
+
return os.path.join(libpython, "site-packages")
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
def get_python_lib(
|
| 231 |
+
plat_specific: bool = False, standard_lib: bool = False, prefix: str | None = None
|
| 232 |
+
) -> str:
|
| 233 |
+
"""Return the directory containing the Python library (standard or
|
| 234 |
+
site additions).
|
| 235 |
+
|
| 236 |
+
If 'plat_specific' is true, return the directory containing
|
| 237 |
+
platform-specific modules, i.e. any module from a non-pure-Python
|
| 238 |
+
module distribution; otherwise, return the platform-shared library
|
| 239 |
+
directory. If 'standard_lib' is true, return the directory
|
| 240 |
+
containing standard Python library modules; otherwise, return the
|
| 241 |
+
directory for site-specific modules.
|
| 242 |
+
|
| 243 |
+
If 'prefix' is supplied, use it instead of sys.base_prefix or
|
| 244 |
+
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
|
| 245 |
+
"""
|
| 246 |
+
|
| 247 |
+
early_prefix = prefix
|
| 248 |
+
|
| 249 |
+
if prefix is None:
|
| 250 |
+
if standard_lib:
|
| 251 |
+
prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
|
| 252 |
+
else:
|
| 253 |
+
prefix = plat_specific and EXEC_PREFIX or PREFIX
|
| 254 |
+
|
| 255 |
+
if os.name == "posix" or is_mingw():
|
| 256 |
+
if plat_specific or standard_lib:
|
| 257 |
+
# Platform-specific modules (any module from a non-pure-Python
|
| 258 |
+
# module distribution) or standard Python library modules.
|
| 259 |
+
libdir = getattr(sys, "platlibdir", "lib")
|
| 260 |
+
else:
|
| 261 |
+
# Pure Python
|
| 262 |
+
libdir = "lib"
|
| 263 |
+
implementation = 'pypy' if IS_PYPY else 'python'
|
| 264 |
+
libpython = os.path.join(prefix, libdir, implementation + get_python_version())
|
| 265 |
+
return _posix_lib(standard_lib, libpython, early_prefix, prefix)
|
| 266 |
+
elif os.name == "nt":
|
| 267 |
+
if standard_lib:
|
| 268 |
+
return os.path.join(prefix, "Lib")
|
| 269 |
+
else:
|
| 270 |
+
return os.path.join(prefix, "Lib", "site-packages")
|
| 271 |
+
else:
|
| 272 |
+
raise DistutilsPlatformError(
|
| 273 |
+
f"I don't know where Python installs its library on platform '{os.name}'"
|
| 274 |
+
)
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
@functools.lru_cache
|
| 278 |
+
def _customize_macos():
|
| 279 |
+
"""
|
| 280 |
+
Perform first-time customization of compiler-related
|
| 281 |
+
config vars on macOS. Use after a compiler is known
|
| 282 |
+
to be needed. This customization exists primarily to support Pythons
|
| 283 |
+
from binary installers. The kind and paths to build tools on
|
| 284 |
+
the user system may vary significantly from the system
|
| 285 |
+
that Python itself was built on. Also the user OS
|
| 286 |
+
version and build tools may not support the same set
|
| 287 |
+
of CPU architectures for universal builds.
|
| 288 |
+
"""
|
| 289 |
+
|
| 290 |
+
sys.platform == "darwin" and __import__('_osx_support').customize_compiler(
|
| 291 |
+
get_config_vars()
|
| 292 |
+
)
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
def customize_compiler(compiler: CCompiler) -> None:
|
| 296 |
+
"""Do any platform-specific customization of a CCompiler instance.
|
| 297 |
+
|
| 298 |
+
Mainly needed on Unix, so we can plug in the information that
|
| 299 |
+
varies across Unices and is stored in Python's Makefile.
|
| 300 |
+
"""
|
| 301 |
+
if compiler.compiler_type in ["unix", "cygwin"] or (
|
| 302 |
+
compiler.compiler_type == "mingw32" and is_mingw()
|
| 303 |
+
):
|
| 304 |
+
_customize_macos()
|
| 305 |
+
|
| 306 |
+
(
|
| 307 |
+
cc,
|
| 308 |
+
cxx,
|
| 309 |
+
cflags,
|
| 310 |
+
ccshared,
|
| 311 |
+
ldshared,
|
| 312 |
+
ldcxxshared,
|
| 313 |
+
shlib_suffix,
|
| 314 |
+
ar,
|
| 315 |
+
ar_flags,
|
| 316 |
+
) = get_config_vars(
|
| 317 |
+
'CC',
|
| 318 |
+
'CXX',
|
| 319 |
+
'CFLAGS',
|
| 320 |
+
'CCSHARED',
|
| 321 |
+
'LDSHARED',
|
| 322 |
+
'LDCXXSHARED',
|
| 323 |
+
'SHLIB_SUFFIX',
|
| 324 |
+
'AR',
|
| 325 |
+
'ARFLAGS',
|
| 326 |
+
)
|
| 327 |
+
|
| 328 |
+
cxxflags = cflags
|
| 329 |
+
|
| 330 |
+
if 'CC' in os.environ:
|
| 331 |
+
newcc = os.environ['CC']
|
| 332 |
+
if 'LDSHARED' not in os.environ and ldshared.startswith(cc):
|
| 333 |
+
# If CC is overridden, use that as the default
|
| 334 |
+
# command for LDSHARED as well
|
| 335 |
+
ldshared = newcc + ldshared[len(cc) :]
|
| 336 |
+
cc = newcc
|
| 337 |
+
cxx = os.environ.get('CXX', cxx)
|
| 338 |
+
ldshared = os.environ.get('LDSHARED', ldshared)
|
| 339 |
+
ldcxxshared = os.environ.get('LDCXXSHARED', ldcxxshared)
|
| 340 |
+
cpp = os.environ.get(
|
| 341 |
+
'CPP',
|
| 342 |
+
cc + " -E", # not always
|
| 343 |
+
)
|
| 344 |
+
|
| 345 |
+
ldshared = _add_flags(ldshared, 'LD')
|
| 346 |
+
ldcxxshared = _add_flags(ldcxxshared, 'LD')
|
| 347 |
+
cflags = os.environ.get('CFLAGS', cflags)
|
| 348 |
+
ldshared = _add_flags(ldshared, 'C')
|
| 349 |
+
cxxflags = os.environ.get('CXXFLAGS', cxxflags)
|
| 350 |
+
ldcxxshared = _add_flags(ldcxxshared, 'CXX')
|
| 351 |
+
cpp = _add_flags(cpp, 'CPP')
|
| 352 |
+
cflags = _add_flags(cflags, 'CPP')
|
| 353 |
+
cxxflags = _add_flags(cxxflags, 'CPP')
|
| 354 |
+
ldshared = _add_flags(ldshared, 'CPP')
|
| 355 |
+
ldcxxshared = _add_flags(ldcxxshared, 'CPP')
|
| 356 |
+
|
| 357 |
+
ar = os.environ.get('AR', ar)
|
| 358 |
+
|
| 359 |
+
archiver = ar + ' ' + os.environ.get('ARFLAGS', ar_flags)
|
| 360 |
+
cc_cmd = cc + ' ' + cflags
|
| 361 |
+
cxx_cmd = cxx + ' ' + cxxflags
|
| 362 |
+
|
| 363 |
+
compiler.set_executables(
|
| 364 |
+
preprocessor=cpp,
|
| 365 |
+
compiler=cc_cmd,
|
| 366 |
+
compiler_so=cc_cmd + ' ' + ccshared,
|
| 367 |
+
compiler_cxx=cxx_cmd,
|
| 368 |
+
compiler_so_cxx=cxx_cmd + ' ' + ccshared,
|
| 369 |
+
linker_so=ldshared,
|
| 370 |
+
linker_so_cxx=ldcxxshared,
|
| 371 |
+
linker_exe=cc,
|
| 372 |
+
linker_exe_cxx=cxx,
|
| 373 |
+
archiver=archiver,
|
| 374 |
+
)
|
| 375 |
+
|
| 376 |
+
if 'RANLIB' in os.environ and compiler.executables.get('ranlib', None):
|
| 377 |
+
compiler.set_executables(ranlib=os.environ['RANLIB'])
|
| 378 |
+
|
| 379 |
+
compiler.shared_lib_extension = shlib_suffix
|
| 380 |
+
|
| 381 |
+
|
| 382 |
+
def get_config_h_filename() -> str:
|
| 383 |
+
"""Return full pathname of installed pyconfig.h file."""
|
| 384 |
+
return sysconfig.get_config_h_filename()
|
| 385 |
+
|
| 386 |
+
|
| 387 |
+
def get_makefile_filename() -> str:
|
| 388 |
+
"""Return full pathname of installed Makefile from the Python build."""
|
| 389 |
+
return sysconfig.get_makefile_filename()
|
| 390 |
+
|
| 391 |
+
|
| 392 |
+
def parse_config_h(fp, g=None):
|
| 393 |
+
"""Parse a config.h-style file.
|
| 394 |
+
|
| 395 |
+
A dictionary containing name/value pairs is returned. If an
|
| 396 |
+
optional dictionary is passed in as the second argument, it is
|
| 397 |
+
used instead of a new dictionary.
|
| 398 |
+
"""
|
| 399 |
+
return sysconfig.parse_config_h(fp, vars=g)
|
| 400 |
+
|
| 401 |
+
|
| 402 |
+
# Regexes needed for parsing Makefile (and similar syntaxes,
|
| 403 |
+
# like old-style Setup files).
|
| 404 |
+
_variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
|
| 405 |
+
_findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
|
| 406 |
+
_findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")
|
| 407 |
+
|
| 408 |
+
|
| 409 |
+
def parse_makefile(fn, g=None): # noqa: C901
|
| 410 |
+
"""Parse a Makefile-style file.
|
| 411 |
+
|
| 412 |
+
A dictionary containing name/value pairs is returned. If an
|
| 413 |
+
optional dictionary is passed in as the second argument, it is
|
| 414 |
+
used instead of a new dictionary.
|
| 415 |
+
"""
|
| 416 |
+
from distutils.text_file import TextFile
|
| 417 |
+
|
| 418 |
+
fp = TextFile(
|
| 419 |
+
fn,
|
| 420 |
+
strip_comments=True,
|
| 421 |
+
skip_blanks=True,
|
| 422 |
+
join_lines=True,
|
| 423 |
+
errors="surrogateescape",
|
| 424 |
+
)
|
| 425 |
+
|
| 426 |
+
if g is None:
|
| 427 |
+
g = {}
|
| 428 |
+
done = {}
|
| 429 |
+
notdone = {}
|
| 430 |
+
|
| 431 |
+
while True:
|
| 432 |
+
line = fp.readline()
|
| 433 |
+
if line is None: # eof
|
| 434 |
+
break
|
| 435 |
+
m = _variable_rx.match(line)
|
| 436 |
+
if m:
|
| 437 |
+
n, v = m.group(1, 2)
|
| 438 |
+
v = v.strip()
|
| 439 |
+
# `$$' is a literal `$' in make
|
| 440 |
+
tmpv = v.replace('$$', '')
|
| 441 |
+
|
| 442 |
+
if "$" in tmpv:
|
| 443 |
+
notdone[n] = v
|
| 444 |
+
else:
|
| 445 |
+
try:
|
| 446 |
+
v = int(v)
|
| 447 |
+
except ValueError:
|
| 448 |
+
# insert literal `$'
|
| 449 |
+
done[n] = v.replace('$$', '$')
|
| 450 |
+
else:
|
| 451 |
+
done[n] = v
|
| 452 |
+
|
| 453 |
+
# Variables with a 'PY_' prefix in the makefile. These need to
|
| 454 |
+
# be made available without that prefix through sysconfig.
|
| 455 |
+
# Special care is needed to ensure that variable expansion works, even
|
| 456 |
+
# if the expansion uses the name without a prefix.
|
| 457 |
+
renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
|
| 458 |
+
|
| 459 |
+
# do variable interpolation here
|
| 460 |
+
while notdone:
|
| 461 |
+
for name in list(notdone):
|
| 462 |
+
value = notdone[name]
|
| 463 |
+
m = _findvar1_rx.search(value) or _findvar2_rx.search(value)
|
| 464 |
+
if m:
|
| 465 |
+
n = m.group(1)
|
| 466 |
+
found = True
|
| 467 |
+
if n in done:
|
| 468 |
+
item = str(done[n])
|
| 469 |
+
elif n in notdone:
|
| 470 |
+
# get it on a subsequent round
|
| 471 |
+
found = False
|
| 472 |
+
elif n in os.environ:
|
| 473 |
+
# do it like make: fall back to environment
|
| 474 |
+
item = os.environ[n]
|
| 475 |
+
|
| 476 |
+
elif n in renamed_variables:
|
| 477 |
+
if name.startswith('PY_') and name[3:] in renamed_variables:
|
| 478 |
+
item = ""
|
| 479 |
+
|
| 480 |
+
elif 'PY_' + n in notdone:
|
| 481 |
+
found = False
|
| 482 |
+
|
| 483 |
+
else:
|
| 484 |
+
item = str(done['PY_' + n])
|
| 485 |
+
else:
|
| 486 |
+
done[n] = item = ""
|
| 487 |
+
if found:
|
| 488 |
+
after = value[m.end() :]
|
| 489 |
+
value = value[: m.start()] + item + after
|
| 490 |
+
if "$" in after:
|
| 491 |
+
notdone[name] = value
|
| 492 |
+
else:
|
| 493 |
+
try:
|
| 494 |
+
value = int(value)
|
| 495 |
+
except ValueError:
|
| 496 |
+
done[name] = value.strip()
|
| 497 |
+
else:
|
| 498 |
+
done[name] = value
|
| 499 |
+
del notdone[name]
|
| 500 |
+
|
| 501 |
+
if name.startswith('PY_') and name[3:] in renamed_variables:
|
| 502 |
+
name = name[3:]
|
| 503 |
+
if name not in done:
|
| 504 |
+
done[name] = value
|
| 505 |
+
else:
|
| 506 |
+
# bogus variable reference; just drop it since we can't deal
|
| 507 |
+
del notdone[name]
|
| 508 |
+
|
| 509 |
+
fp.close()
|
| 510 |
+
|
| 511 |
+
# strip spurious spaces
|
| 512 |
+
for k, v in done.items():
|
| 513 |
+
if isinstance(v, str):
|
| 514 |
+
done[k] = v.strip()
|
| 515 |
+
|
| 516 |
+
# save the results in the global dictionary
|
| 517 |
+
g.update(done)
|
| 518 |
+
return g
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
def expand_makefile_vars(s, vars):
|
| 522 |
+
"""Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
|
| 523 |
+
'string' according to 'vars' (a dictionary mapping variable names to
|
| 524 |
+
values). Variables not present in 'vars' are silently expanded to the
|
| 525 |
+
empty string. The variable values in 'vars' should not contain further
|
| 526 |
+
variable expansions; if 'vars' is the output of 'parse_makefile()',
|
| 527 |
+
you're fine. Returns a variable-expanded version of 's'.
|
| 528 |
+
"""
|
| 529 |
+
|
| 530 |
+
# This algorithm does multiple expansion, so if vars['foo'] contains
|
| 531 |
+
# "${bar}", it will expand ${foo} to ${bar}, and then expand
|
| 532 |
+
# ${bar}... and so forth. This is fine as long as 'vars' comes from
|
| 533 |
+
# 'parse_makefile()', which takes care of such expansions eagerly,
|
| 534 |
+
# according to make's variable expansion semantics.
|
| 535 |
+
|
| 536 |
+
while True:
|
| 537 |
+
m = _findvar1_rx.search(s) or _findvar2_rx.search(s)
|
| 538 |
+
if m:
|
| 539 |
+
(beg, end) = m.span()
|
| 540 |
+
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
|
| 541 |
+
else:
|
| 542 |
+
break
|
| 543 |
+
return s
|
| 544 |
+
|
| 545 |
+
|
| 546 |
+
_config_vars = None
|
| 547 |
+
|
| 548 |
+
|
| 549 |
+
@overload
|
| 550 |
+
def get_config_vars() -> dict[str, str | int]: ...
|
| 551 |
+
@overload
|
| 552 |
+
def get_config_vars(arg: str, /, *args: str) -> list[str | int]: ...
|
| 553 |
+
def get_config_vars(*args: str) -> list[str | int] | dict[str, str | int]:
|
| 554 |
+
"""With no arguments, return a dictionary of all configuration
|
| 555 |
+
variables relevant for the current platform. Generally this includes
|
| 556 |
+
everything needed to build extensions and install both pure modules and
|
| 557 |
+
extensions. On Unix, this means every variable defined in Python's
|
| 558 |
+
installed Makefile; on Windows it's a much smaller set.
|
| 559 |
+
|
| 560 |
+
With arguments, return a list of values that result from looking up
|
| 561 |
+
each argument in the configuration variable dictionary.
|
| 562 |
+
"""
|
| 563 |
+
global _config_vars
|
| 564 |
+
if _config_vars is None:
|
| 565 |
+
_config_vars = sysconfig.get_config_vars().copy()
|
| 566 |
+
py39.add_ext_suffix(_config_vars)
|
| 567 |
+
|
| 568 |
+
return [_config_vars.get(name) for name in args] if args else _config_vars
|
| 569 |
+
|
| 570 |
+
|
| 571 |
+
@overload
|
| 572 |
+
@deprecated(
|
| 573 |
+
"SO is deprecated, use EXT_SUFFIX. Support will be removed when this module is synchronized with stdlib Python 3.11"
|
| 574 |
+
)
|
| 575 |
+
def get_config_var(name: Literal["SO"]) -> int | str | None: ...
|
| 576 |
+
@overload
|
| 577 |
+
def get_config_var(name: str) -> int | str | None: ...
|
| 578 |
+
def get_config_var(name: str) -> int | str | None:
|
| 579 |
+
"""Return the value of a single variable using the dictionary
|
| 580 |
+
returned by 'get_config_vars()'. Equivalent to
|
| 581 |
+
get_config_vars().get(name)
|
| 582 |
+
"""
|
| 583 |
+
if name == 'SO':
|
| 584 |
+
import warnings
|
| 585 |
+
|
| 586 |
+
warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
|
| 587 |
+
return get_config_vars().get(name)
|
| 588 |
+
|
| 589 |
+
|
| 590 |
+
@pass_none
|
| 591 |
+
def _add_flags(value: str, type: str) -> str:
|
| 592 |
+
"""
|
| 593 |
+
Add any flags from the environment for the given type.
|
| 594 |
+
|
| 595 |
+
type is the prefix to FLAGS in the environment key (e.g. "C" for "CFLAGS").
|
| 596 |
+
"""
|
| 597 |
+
flags = os.environ.get(f'{type}FLAGS')
|
| 598 |
+
return f'{value} {flags}' if flags else value
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/text_file.py
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
| 3 |
+
provides the TextFile class, which gives an interface to text files
|
| 4 |
+
that (optionally) takes care of stripping comments, ignoring blank
|
| 5 |
+
lines, and joining lines with backslashes."""
|
| 6 |
+
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class TextFile:
|
| 11 |
+
"""Provides a file-like object that takes care of all the things you
|
| 12 |
+
commonly want to do when processing a text file that has some
|
| 13 |
+
line-by-line syntax: strip comments (as long as "#" is your
|
| 14 |
+
comment character), skip blank lines, join adjacent lines by
|
| 15 |
+
escaping the newline (ie. backslash at end of line), strip
|
| 16 |
+
leading and/or trailing whitespace. All of these are optional
|
| 17 |
+
and independently controllable.
|
| 18 |
+
|
| 19 |
+
Provides a 'warn()' method so you can generate warning messages that
|
| 20 |
+
report physical line number, even if the logical line in question
|
| 21 |
+
spans multiple physical lines. Also provides 'unreadline()' for
|
| 22 |
+
implementing line-at-a-time lookahead.
|
| 23 |
+
|
| 24 |
+
Constructor is called as:
|
| 25 |
+
|
| 26 |
+
TextFile (filename=None, file=None, **options)
|
| 27 |
+
|
| 28 |
+
It bombs (RuntimeError) if both 'filename' and 'file' are None;
|
| 29 |
+
'filename' should be a string, and 'file' a file object (or
|
| 30 |
+
something that provides 'readline()' and 'close()' methods). It is
|
| 31 |
+
recommended that you supply at least 'filename', so that TextFile
|
| 32 |
+
can include it in warning messages. If 'file' is not supplied,
|
| 33 |
+
TextFile creates its own using 'io.open()'.
|
| 34 |
+
|
| 35 |
+
The options are all boolean, and affect the value returned by
|
| 36 |
+
'readline()':
|
| 37 |
+
strip_comments [default: true]
|
| 38 |
+
strip from "#" to end-of-line, as well as any whitespace
|
| 39 |
+
leading up to the "#" -- unless it is escaped by a backslash
|
| 40 |
+
lstrip_ws [default: false]
|
| 41 |
+
strip leading whitespace from each line before returning it
|
| 42 |
+
rstrip_ws [default: true]
|
| 43 |
+
strip trailing whitespace (including line terminator!) from
|
| 44 |
+
each line before returning it
|
| 45 |
+
skip_blanks [default: true}
|
| 46 |
+
skip lines that are empty *after* stripping comments and
|
| 47 |
+
whitespace. (If both lstrip_ws and rstrip_ws are false,
|
| 48 |
+
then some lines may consist of solely whitespace: these will
|
| 49 |
+
*not* be skipped, even if 'skip_blanks' is true.)
|
| 50 |
+
join_lines [default: false]
|
| 51 |
+
if a backslash is the last non-newline character on a line
|
| 52 |
+
after stripping comments and whitespace, join the following line
|
| 53 |
+
to it to form one "logical line"; if N consecutive lines end
|
| 54 |
+
with a backslash, then N+1 physical lines will be joined to
|
| 55 |
+
form one logical line.
|
| 56 |
+
collapse_join [default: false]
|
| 57 |
+
strip leading whitespace from lines that are joined to their
|
| 58 |
+
predecessor; only matters if (join_lines and not lstrip_ws)
|
| 59 |
+
errors [default: 'strict']
|
| 60 |
+
error handler used to decode the file content
|
| 61 |
+
|
| 62 |
+
Note that since 'rstrip_ws' can strip the trailing newline, the
|
| 63 |
+
semantics of 'readline()' must differ from those of the builtin file
|
| 64 |
+
object's 'readline()' method! In particular, 'readline()' returns
|
| 65 |
+
None for end-of-file: an empty string might just be a blank line (or
|
| 66 |
+
an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
|
| 67 |
+
not."""
|
| 68 |
+
|
| 69 |
+
default_options = {
|
| 70 |
+
'strip_comments': 1,
|
| 71 |
+
'skip_blanks': 1,
|
| 72 |
+
'lstrip_ws': 0,
|
| 73 |
+
'rstrip_ws': 1,
|
| 74 |
+
'join_lines': 0,
|
| 75 |
+
'collapse_join': 0,
|
| 76 |
+
'errors': 'strict',
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
def __init__(self, filename=None, file=None, **options):
|
| 80 |
+
"""Construct a new TextFile object. At least one of 'filename'
|
| 81 |
+
(a string) and 'file' (a file-like object) must be supplied.
|
| 82 |
+
They keyword argument options are described above and affect
|
| 83 |
+
the values returned by 'readline()'."""
|
| 84 |
+
if filename is None and file is None:
|
| 85 |
+
raise RuntimeError(
|
| 86 |
+
"you must supply either or both of 'filename' and 'file'"
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
# set values for all options -- either from client option hash
|
| 90 |
+
# or fallback to default_options
|
| 91 |
+
for opt in self.default_options.keys():
|
| 92 |
+
if opt in options:
|
| 93 |
+
setattr(self, opt, options[opt])
|
| 94 |
+
else:
|
| 95 |
+
setattr(self, opt, self.default_options[opt])
|
| 96 |
+
|
| 97 |
+
# sanity check client option hash
|
| 98 |
+
for opt in options.keys():
|
| 99 |
+
if opt not in self.default_options:
|
| 100 |
+
raise KeyError(f"invalid TextFile option '{opt}'")
|
| 101 |
+
|
| 102 |
+
if file is None:
|
| 103 |
+
self.open(filename)
|
| 104 |
+
else:
|
| 105 |
+
self.filename = filename
|
| 106 |
+
self.file = file
|
| 107 |
+
self.current_line = 0 # assuming that file is at BOF!
|
| 108 |
+
|
| 109 |
+
# 'linebuf' is a stack of lines that will be emptied before we
|
| 110 |
+
# actually read from the file; it's only populated by an
|
| 111 |
+
# 'unreadline()' operation
|
| 112 |
+
self.linebuf = []
|
| 113 |
+
|
| 114 |
+
def open(self, filename):
|
| 115 |
+
"""Open a new file named 'filename'. This overrides both the
|
| 116 |
+
'filename' and 'file' arguments to the constructor."""
|
| 117 |
+
self.filename = filename
|
| 118 |
+
self.file = open(self.filename, errors=self.errors, encoding='utf-8')
|
| 119 |
+
self.current_line = 0
|
| 120 |
+
|
| 121 |
+
def close(self):
|
| 122 |
+
"""Close the current file and forget everything we know about it
|
| 123 |
+
(filename, current line number)."""
|
| 124 |
+
file = self.file
|
| 125 |
+
self.file = None
|
| 126 |
+
self.filename = None
|
| 127 |
+
self.current_line = None
|
| 128 |
+
file.close()
|
| 129 |
+
|
| 130 |
+
def gen_error(self, msg, line=None):
|
| 131 |
+
outmsg = []
|
| 132 |
+
if line is None:
|
| 133 |
+
line = self.current_line
|
| 134 |
+
outmsg.append(self.filename + ", ")
|
| 135 |
+
if isinstance(line, (list, tuple)):
|
| 136 |
+
outmsg.append("lines {}-{}: ".format(*line))
|
| 137 |
+
else:
|
| 138 |
+
outmsg.append(f"line {int(line)}: ")
|
| 139 |
+
outmsg.append(str(msg))
|
| 140 |
+
return "".join(outmsg)
|
| 141 |
+
|
| 142 |
+
def error(self, msg, line=None):
|
| 143 |
+
raise ValueError("error: " + self.gen_error(msg, line))
|
| 144 |
+
|
| 145 |
+
def warn(self, msg, line=None):
|
| 146 |
+
"""Print (to stderr) a warning message tied to the current logical
|
| 147 |
+
line in the current file. If the current logical line in the
|
| 148 |
+
file spans multiple physical lines, the warning refers to the
|
| 149 |
+
whole range, eg. "lines 3-5". If 'line' supplied, it overrides
|
| 150 |
+
the current line number; it may be a list or tuple to indicate a
|
| 151 |
+
range of physical lines, or an integer for a single physical
|
| 152 |
+
line."""
|
| 153 |
+
sys.stderr.write("warning: " + self.gen_error(msg, line) + "\n")
|
| 154 |
+
|
| 155 |
+
def readline(self): # noqa: C901
|
| 156 |
+
"""Read and return a single logical line from the current file (or
|
| 157 |
+
from an internal buffer if lines have previously been "unread"
|
| 158 |
+
with 'unreadline()'). If the 'join_lines' option is true, this
|
| 159 |
+
may involve reading multiple physical lines concatenated into a
|
| 160 |
+
single string. Updates the current line number, so calling
|
| 161 |
+
'warn()' after 'readline()' emits a warning about the physical
|
| 162 |
+
line(s) just read. Returns None on end-of-file, since the empty
|
| 163 |
+
string can occur if 'rstrip_ws' is true but 'strip_blanks' is
|
| 164 |
+
not."""
|
| 165 |
+
# If any "unread" lines waiting in 'linebuf', return the top
|
| 166 |
+
# one. (We don't actually buffer read-ahead data -- lines only
|
| 167 |
+
# get put in 'linebuf' if the client explicitly does an
|
| 168 |
+
# 'unreadline()'.
|
| 169 |
+
if self.linebuf:
|
| 170 |
+
line = self.linebuf[-1]
|
| 171 |
+
del self.linebuf[-1]
|
| 172 |
+
return line
|
| 173 |
+
|
| 174 |
+
buildup_line = ''
|
| 175 |
+
|
| 176 |
+
while True:
|
| 177 |
+
# read the line, make it None if EOF
|
| 178 |
+
line = self.file.readline()
|
| 179 |
+
if line == '':
|
| 180 |
+
line = None
|
| 181 |
+
|
| 182 |
+
if self.strip_comments and line:
|
| 183 |
+
# Look for the first "#" in the line. If none, never
|
| 184 |
+
# mind. If we find one and it's the first character, or
|
| 185 |
+
# is not preceded by "\", then it starts a comment --
|
| 186 |
+
# strip the comment, strip whitespace before it, and
|
| 187 |
+
# carry on. Otherwise, it's just an escaped "#", so
|
| 188 |
+
# unescape it (and any other escaped "#"'s that might be
|
| 189 |
+
# lurking in there) and otherwise leave the line alone.
|
| 190 |
+
|
| 191 |
+
pos = line.find("#")
|
| 192 |
+
if pos == -1: # no "#" -- no comments
|
| 193 |
+
pass
|
| 194 |
+
|
| 195 |
+
# It's definitely a comment -- either "#" is the first
|
| 196 |
+
# character, or it's elsewhere and unescaped.
|
| 197 |
+
elif pos == 0 or line[pos - 1] != "\\":
|
| 198 |
+
# Have to preserve the trailing newline, because it's
|
| 199 |
+
# the job of a later step (rstrip_ws) to remove it --
|
| 200 |
+
# and if rstrip_ws is false, we'd better preserve it!
|
| 201 |
+
# (NB. this means that if the final line is all comment
|
| 202 |
+
# and has no trailing newline, we will think that it's
|
| 203 |
+
# EOF; I think that's OK.)
|
| 204 |
+
eol = (line[-1] == '\n') and '\n' or ''
|
| 205 |
+
line = line[0:pos] + eol
|
| 206 |
+
|
| 207 |
+
# If all that's left is whitespace, then skip line
|
| 208 |
+
# *now*, before we try to join it to 'buildup_line' --
|
| 209 |
+
# that way constructs like
|
| 210 |
+
# hello \\
|
| 211 |
+
# # comment that should be ignored
|
| 212 |
+
# there
|
| 213 |
+
# result in "hello there".
|
| 214 |
+
if line.strip() == "":
|
| 215 |
+
continue
|
| 216 |
+
else: # it's an escaped "#"
|
| 217 |
+
line = line.replace("\\#", "#")
|
| 218 |
+
|
| 219 |
+
# did previous line end with a backslash? then accumulate
|
| 220 |
+
if self.join_lines and buildup_line:
|
| 221 |
+
# oops: end of file
|
| 222 |
+
if line is None:
|
| 223 |
+
self.warn("continuation line immediately precedes end-of-file")
|
| 224 |
+
return buildup_line
|
| 225 |
+
|
| 226 |
+
if self.collapse_join:
|
| 227 |
+
line = line.lstrip()
|
| 228 |
+
line = buildup_line + line
|
| 229 |
+
|
| 230 |
+
# careful: pay attention to line number when incrementing it
|
| 231 |
+
if isinstance(self.current_line, list):
|
| 232 |
+
self.current_line[1] = self.current_line[1] + 1
|
| 233 |
+
else:
|
| 234 |
+
self.current_line = [self.current_line, self.current_line + 1]
|
| 235 |
+
# just an ordinary line, read it as usual
|
| 236 |
+
else:
|
| 237 |
+
if line is None: # eof
|
| 238 |
+
return None
|
| 239 |
+
|
| 240 |
+
# still have to be careful about incrementing the line number!
|
| 241 |
+
if isinstance(self.current_line, list):
|
| 242 |
+
self.current_line = self.current_line[1] + 1
|
| 243 |
+
else:
|
| 244 |
+
self.current_line = self.current_line + 1
|
| 245 |
+
|
| 246 |
+
# strip whitespace however the client wants (leading and
|
| 247 |
+
# trailing, or one or the other, or neither)
|
| 248 |
+
if self.lstrip_ws and self.rstrip_ws:
|
| 249 |
+
line = line.strip()
|
| 250 |
+
elif self.lstrip_ws:
|
| 251 |
+
line = line.lstrip()
|
| 252 |
+
elif self.rstrip_ws:
|
| 253 |
+
line = line.rstrip()
|
| 254 |
+
|
| 255 |
+
# blank line (whether we rstrip'ed or not)? skip to next line
|
| 256 |
+
# if appropriate
|
| 257 |
+
if line in ('', '\n') and self.skip_blanks:
|
| 258 |
+
continue
|
| 259 |
+
|
| 260 |
+
if self.join_lines:
|
| 261 |
+
if line[-1] == '\\':
|
| 262 |
+
buildup_line = line[:-1]
|
| 263 |
+
continue
|
| 264 |
+
|
| 265 |
+
if line[-2:] == '\\\n':
|
| 266 |
+
buildup_line = line[0:-2] + '\n'
|
| 267 |
+
continue
|
| 268 |
+
|
| 269 |
+
# well, I guess there's some actual content there: return it
|
| 270 |
+
return line
|
| 271 |
+
|
| 272 |
+
def readlines(self):
|
| 273 |
+
"""Read and return the list of all logical lines remaining in the
|
| 274 |
+
current file."""
|
| 275 |
+
lines = []
|
| 276 |
+
while True:
|
| 277 |
+
line = self.readline()
|
| 278 |
+
if line is None:
|
| 279 |
+
return lines
|
| 280 |
+
lines.append(line)
|
| 281 |
+
|
| 282 |
+
def unreadline(self, line):
|
| 283 |
+
"""Push 'line' (a string) onto an internal buffer that will be
|
| 284 |
+
checked by future 'readline()' calls. Handy for implementing
|
| 285 |
+
a parser with line-at-a-time lookahead."""
|
| 286 |
+
self.linebuf.append(line)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/unixccompiler.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import importlib
|
| 2 |
+
|
| 3 |
+
from .compilers.C import unix
|
| 4 |
+
|
| 5 |
+
UnixCCompiler = unix.Compiler
|
| 6 |
+
|
| 7 |
+
# ensure import of unixccompiler implies ccompiler imported
|
| 8 |
+
# (pypa/setuptools#4871)
|
| 9 |
+
importlib.import_module('distutils.ccompiler')
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/util.py
ADDED
|
@@ -0,0 +1,506 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""distutils.util
|
| 2 |
+
|
| 3 |
+
Miscellaneous utility functions -- anything that doesn't fit into
|
| 4 |
+
one of the other *util.py modules.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import functools
|
| 10 |
+
import importlib.util
|
| 11 |
+
import os
|
| 12 |
+
import pathlib
|
| 13 |
+
import re
|
| 14 |
+
import string
|
| 15 |
+
import subprocess
|
| 16 |
+
import sys
|
| 17 |
+
import sysconfig
|
| 18 |
+
import tempfile
|
| 19 |
+
from collections.abc import Callable, Iterable, Mapping
|
| 20 |
+
from typing import TYPE_CHECKING, AnyStr
|
| 21 |
+
|
| 22 |
+
from jaraco.functools import pass_none
|
| 23 |
+
|
| 24 |
+
from ._log import log
|
| 25 |
+
from ._modified import newer
|
| 26 |
+
from .errors import DistutilsByteCompileError, DistutilsPlatformError
|
| 27 |
+
from .spawn import spawn
|
| 28 |
+
|
| 29 |
+
if TYPE_CHECKING:
|
| 30 |
+
from typing_extensions import TypeVarTuple, Unpack
|
| 31 |
+
|
| 32 |
+
_Ts = TypeVarTuple("_Ts")
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def get_host_platform() -> str:
|
| 36 |
+
"""
|
| 37 |
+
Return a string that identifies the current platform. Use this
|
| 38 |
+
function to distinguish platform-specific build directories and
|
| 39 |
+
platform-specific built distributions.
|
| 40 |
+
"""
|
| 41 |
+
|
| 42 |
+
# This function initially exposed platforms as defined in Python 3.9
|
| 43 |
+
# even with older Python versions when distutils was split out.
|
| 44 |
+
# Now it delegates to stdlib sysconfig.
|
| 45 |
+
|
| 46 |
+
return sysconfig.get_platform()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def get_platform() -> str:
|
| 50 |
+
if os.name == 'nt':
|
| 51 |
+
TARGET_TO_PLAT = {
|
| 52 |
+
'x86': 'win32',
|
| 53 |
+
'x64': 'win-amd64',
|
| 54 |
+
'arm': 'win-arm32',
|
| 55 |
+
'arm64': 'win-arm64',
|
| 56 |
+
}
|
| 57 |
+
target = os.environ.get('VSCMD_ARG_TGT_ARCH')
|
| 58 |
+
return TARGET_TO_PLAT.get(target) or get_host_platform()
|
| 59 |
+
return get_host_platform()
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
if sys.platform == 'darwin':
|
| 63 |
+
_syscfg_macosx_ver = None # cache the version pulled from sysconfig
|
| 64 |
+
MACOSX_VERSION_VAR = 'MACOSX_DEPLOYMENT_TARGET'
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def _clear_cached_macosx_ver():
|
| 68 |
+
"""For testing only. Do not call."""
|
| 69 |
+
global _syscfg_macosx_ver
|
| 70 |
+
_syscfg_macosx_ver = None
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def get_macosx_target_ver_from_syscfg():
|
| 74 |
+
"""Get the version of macOS latched in the Python interpreter configuration.
|
| 75 |
+
Returns the version as a string or None if can't obtain one. Cached."""
|
| 76 |
+
global _syscfg_macosx_ver
|
| 77 |
+
if _syscfg_macosx_ver is None:
|
| 78 |
+
from distutils import sysconfig
|
| 79 |
+
|
| 80 |
+
ver = sysconfig.get_config_var(MACOSX_VERSION_VAR) or ''
|
| 81 |
+
if ver:
|
| 82 |
+
_syscfg_macosx_ver = ver
|
| 83 |
+
return _syscfg_macosx_ver
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def get_macosx_target_ver():
|
| 87 |
+
"""Return the version of macOS for which we are building.
|
| 88 |
+
|
| 89 |
+
The target version defaults to the version in sysconfig latched at time
|
| 90 |
+
the Python interpreter was built, unless overridden by an environment
|
| 91 |
+
variable. If neither source has a value, then None is returned"""
|
| 92 |
+
|
| 93 |
+
syscfg_ver = get_macosx_target_ver_from_syscfg()
|
| 94 |
+
env_ver = os.environ.get(MACOSX_VERSION_VAR)
|
| 95 |
+
|
| 96 |
+
if env_ver:
|
| 97 |
+
# Validate overridden version against sysconfig version, if have both.
|
| 98 |
+
# Ensure that the deployment target of the build process is not less
|
| 99 |
+
# than 10.3 if the interpreter was built for 10.3 or later. This
|
| 100 |
+
# ensures extension modules are built with correct compatibility
|
| 101 |
+
# values, specifically LDSHARED which can use
|
| 102 |
+
# '-undefined dynamic_lookup' which only works on >= 10.3.
|
| 103 |
+
if (
|
| 104 |
+
syscfg_ver
|
| 105 |
+
and split_version(syscfg_ver) >= [10, 3]
|
| 106 |
+
and split_version(env_ver) < [10, 3]
|
| 107 |
+
):
|
| 108 |
+
my_msg = (
|
| 109 |
+
'$' + MACOSX_VERSION_VAR + ' mismatch: '
|
| 110 |
+
f'now "{env_ver}" but "{syscfg_ver}" during configure; '
|
| 111 |
+
'must use 10.3 or later'
|
| 112 |
+
)
|
| 113 |
+
raise DistutilsPlatformError(my_msg)
|
| 114 |
+
return env_ver
|
| 115 |
+
return syscfg_ver
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
def split_version(s: str) -> list[int]:
|
| 119 |
+
"""Convert a dot-separated string into a list of numbers for comparisons"""
|
| 120 |
+
return [int(n) for n in s.split('.')]
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
@pass_none
|
| 124 |
+
def convert_path(pathname: str | os.PathLike[str]) -> str:
|
| 125 |
+
r"""
|
| 126 |
+
Allow for pathlib.Path inputs, coax to a native path string.
|
| 127 |
+
|
| 128 |
+
If None is passed, will just pass it through as
|
| 129 |
+
Setuptools relies on this behavior.
|
| 130 |
+
|
| 131 |
+
>>> convert_path(None) is None
|
| 132 |
+
True
|
| 133 |
+
|
| 134 |
+
Removes empty paths.
|
| 135 |
+
|
| 136 |
+
>>> convert_path('foo/./bar').replace('\\', '/')
|
| 137 |
+
'foo/bar'
|
| 138 |
+
"""
|
| 139 |
+
return os.fspath(pathlib.PurePath(pathname))
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
def change_root(
|
| 143 |
+
new_root: AnyStr | os.PathLike[AnyStr], pathname: AnyStr | os.PathLike[AnyStr]
|
| 144 |
+
) -> AnyStr:
|
| 145 |
+
"""Return 'pathname' with 'new_root' prepended. If 'pathname' is
|
| 146 |
+
relative, this is equivalent to "os.path.join(new_root,pathname)".
|
| 147 |
+
Otherwise, it requires making 'pathname' relative and then joining the
|
| 148 |
+
two, which is tricky on DOS/Windows and Mac OS.
|
| 149 |
+
"""
|
| 150 |
+
if os.name == 'posix':
|
| 151 |
+
if not os.path.isabs(pathname):
|
| 152 |
+
return os.path.join(new_root, pathname)
|
| 153 |
+
else:
|
| 154 |
+
return os.path.join(new_root, pathname[1:])
|
| 155 |
+
|
| 156 |
+
elif os.name == 'nt':
|
| 157 |
+
(drive, path) = os.path.splitdrive(pathname)
|
| 158 |
+
if path[0] == os.sep:
|
| 159 |
+
path = path[1:]
|
| 160 |
+
return os.path.join(new_root, path)
|
| 161 |
+
|
| 162 |
+
raise DistutilsPlatformError(f"nothing known about platform '{os.name}'")
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
@functools.lru_cache
|
| 166 |
+
def check_environ() -> None:
|
| 167 |
+
"""Ensure that 'os.environ' has all the environment variables we
|
| 168 |
+
guarantee that users can use in config files, command-line options,
|
| 169 |
+
etc. Currently this includes:
|
| 170 |
+
HOME - user's home directory (Unix only)
|
| 171 |
+
PLAT - description of the current platform, including hardware
|
| 172 |
+
and OS (see 'get_platform()')
|
| 173 |
+
"""
|
| 174 |
+
if os.name == 'posix' and 'HOME' not in os.environ:
|
| 175 |
+
try:
|
| 176 |
+
import pwd
|
| 177 |
+
|
| 178 |
+
os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
|
| 179 |
+
except (ImportError, KeyError):
|
| 180 |
+
# bpo-10496: if the current user identifier doesn't exist in the
|
| 181 |
+
# password database, do nothing
|
| 182 |
+
pass
|
| 183 |
+
|
| 184 |
+
if 'PLAT' not in os.environ:
|
| 185 |
+
os.environ['PLAT'] = get_platform()
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
def subst_vars(s, local_vars: Mapping[str, object]) -> str:
|
| 189 |
+
"""
|
| 190 |
+
Perform variable substitution on 'string'.
|
| 191 |
+
Variables are indicated by format-style braces ("{var}").
|
| 192 |
+
Variable is substituted by the value found in the 'local_vars'
|
| 193 |
+
dictionary or in 'os.environ' if it's not in 'local_vars'.
|
| 194 |
+
'os.environ' is first checked/augmented to guarantee that it contains
|
| 195 |
+
certain values: see 'check_environ()'. Raise ValueError for any
|
| 196 |
+
variables not found in either 'local_vars' or 'os.environ'.
|
| 197 |
+
"""
|
| 198 |
+
check_environ()
|
| 199 |
+
lookup = dict(os.environ)
|
| 200 |
+
lookup.update((name, str(value)) for name, value in local_vars.items())
|
| 201 |
+
try:
|
| 202 |
+
return _subst_compat(s).format_map(lookup)
|
| 203 |
+
except KeyError as var:
|
| 204 |
+
raise ValueError(f"invalid variable {var}")
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
def _subst_compat(s):
|
| 208 |
+
"""
|
| 209 |
+
Replace shell/Perl-style variable substitution with
|
| 210 |
+
format-style. For compatibility.
|
| 211 |
+
"""
|
| 212 |
+
|
| 213 |
+
def _subst(match):
|
| 214 |
+
return f'{{{match.group(1)}}}'
|
| 215 |
+
|
| 216 |
+
repl = re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
|
| 217 |
+
if repl != s:
|
| 218 |
+
import warnings
|
| 219 |
+
|
| 220 |
+
warnings.warn(
|
| 221 |
+
"shell/Perl-style substitutions are deprecated",
|
| 222 |
+
DeprecationWarning,
|
| 223 |
+
)
|
| 224 |
+
return repl
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
def grok_environment_error(exc: object, prefix: str = "error: ") -> str:
|
| 228 |
+
# Function kept for backward compatibility.
|
| 229 |
+
# Used to try clever things with EnvironmentErrors,
|
| 230 |
+
# but nowadays str(exception) produces good messages.
|
| 231 |
+
return prefix + str(exc)
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
# Needed by 'split_quoted()'
|
| 235 |
+
_wordchars_re = _squote_re = _dquote_re = None
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
def _init_regex():
|
| 239 |
+
global _wordchars_re, _squote_re, _dquote_re
|
| 240 |
+
_wordchars_re = re.compile(rf'[^\\\'\"{string.whitespace} ]*')
|
| 241 |
+
_squote_re = re.compile(r"'(?:[^'\\]|\\.)*'")
|
| 242 |
+
_dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"')
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def split_quoted(s: str) -> list[str]:
|
| 246 |
+
"""Split a string up according to Unix shell-like rules for quotes and
|
| 247 |
+
backslashes. In short: words are delimited by spaces, as long as those
|
| 248 |
+
spaces are not escaped by a backslash, or inside a quoted string.
|
| 249 |
+
Single and double quotes are equivalent, and the quote characters can
|
| 250 |
+
be backslash-escaped. The backslash is stripped from any two-character
|
| 251 |
+
escape sequence, leaving only the escaped character. The quote
|
| 252 |
+
characters are stripped from any quoted string. Returns a list of
|
| 253 |
+
words.
|
| 254 |
+
"""
|
| 255 |
+
|
| 256 |
+
# This is a nice algorithm for splitting up a single string, since it
|
| 257 |
+
# doesn't require character-by-character examination. It was a little
|
| 258 |
+
# bit of a brain-bender to get it working right, though...
|
| 259 |
+
if _wordchars_re is None:
|
| 260 |
+
_init_regex()
|
| 261 |
+
|
| 262 |
+
s = s.strip()
|
| 263 |
+
words = []
|
| 264 |
+
pos = 0
|
| 265 |
+
|
| 266 |
+
while s:
|
| 267 |
+
m = _wordchars_re.match(s, pos)
|
| 268 |
+
end = m.end()
|
| 269 |
+
if end == len(s):
|
| 270 |
+
words.append(s[:end])
|
| 271 |
+
break
|
| 272 |
+
|
| 273 |
+
if s[end] in string.whitespace:
|
| 274 |
+
# unescaped, unquoted whitespace: now
|
| 275 |
+
# we definitely have a word delimiter
|
| 276 |
+
words.append(s[:end])
|
| 277 |
+
s = s[end:].lstrip()
|
| 278 |
+
pos = 0
|
| 279 |
+
|
| 280 |
+
elif s[end] == '\\':
|
| 281 |
+
# preserve whatever is being escaped;
|
| 282 |
+
# will become part of the current word
|
| 283 |
+
s = s[:end] + s[end + 1 :]
|
| 284 |
+
pos = end + 1
|
| 285 |
+
|
| 286 |
+
else:
|
| 287 |
+
if s[end] == "'": # slurp singly-quoted string
|
| 288 |
+
m = _squote_re.match(s, end)
|
| 289 |
+
elif s[end] == '"': # slurp doubly-quoted string
|
| 290 |
+
m = _dquote_re.match(s, end)
|
| 291 |
+
else:
|
| 292 |
+
raise RuntimeError(f"this can't happen (bad char '{s[end]}')")
|
| 293 |
+
|
| 294 |
+
if m is None:
|
| 295 |
+
raise ValueError(f"bad string (mismatched {s[end]} quotes?)")
|
| 296 |
+
|
| 297 |
+
(beg, end) = m.span()
|
| 298 |
+
s = s[:beg] + s[beg + 1 : end - 1] + s[end:]
|
| 299 |
+
pos = m.end() - 2
|
| 300 |
+
|
| 301 |
+
if pos >= len(s):
|
| 302 |
+
words.append(s)
|
| 303 |
+
break
|
| 304 |
+
|
| 305 |
+
return words
|
| 306 |
+
|
| 307 |
+
|
| 308 |
+
# split_quoted ()
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
def execute(
|
| 312 |
+
func: Callable[[Unpack[_Ts]], object],
|
| 313 |
+
args: tuple[Unpack[_Ts]],
|
| 314 |
+
msg: object = None,
|
| 315 |
+
verbose: bool = False,
|
| 316 |
+
) -> None:
|
| 317 |
+
"""
|
| 318 |
+
Perform some action that affects the outside world (e.g. by
|
| 319 |
+
writing to the filesystem). Was previously used to deal with
|
| 320 |
+
"dry run" operations, but now runs unconditionally.
|
| 321 |
+
"""
|
| 322 |
+
if msg is None:
|
| 323 |
+
msg = f"{func.__name__}{args!r}"
|
| 324 |
+
if msg[-2:] == ',)': # correct for singleton tuple
|
| 325 |
+
msg = msg[0:-2] + ')'
|
| 326 |
+
|
| 327 |
+
log.info(msg)
|
| 328 |
+
func(*args)
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
def strtobool(val: str) -> bool:
|
| 332 |
+
"""Convert a string representation of truth to true (1) or false (0).
|
| 333 |
+
|
| 334 |
+
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
|
| 335 |
+
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
|
| 336 |
+
'val' is anything else.
|
| 337 |
+
"""
|
| 338 |
+
val = val.lower()
|
| 339 |
+
if val in ('y', 'yes', 't', 'true', 'on', '1'):
|
| 340 |
+
return True
|
| 341 |
+
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
|
| 342 |
+
return False
|
| 343 |
+
else:
|
| 344 |
+
raise ValueError(f"invalid truth value {val!r}")
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
def byte_compile( # noqa: C901
|
| 348 |
+
py_files: Iterable[str],
|
| 349 |
+
optimize: int = 0,
|
| 350 |
+
force: bool = False,
|
| 351 |
+
prefix: str | None = None,
|
| 352 |
+
base_dir: str | None = None,
|
| 353 |
+
verbose: bool = True,
|
| 354 |
+
direct: bool | None = None,
|
| 355 |
+
) -> None:
|
| 356 |
+
"""Byte-compile a collection of Python source files to .pyc
|
| 357 |
+
files in a __pycache__ subdirectory. 'py_files' is a list
|
| 358 |
+
of files to compile; any files that don't end in ".py" are silently
|
| 359 |
+
skipped. 'optimize' must be one of the following:
|
| 360 |
+
0 - don't optimize
|
| 361 |
+
1 - normal optimization (like "python -O")
|
| 362 |
+
2 - extra optimization (like "python -OO")
|
| 363 |
+
If 'force' is true, all files are recompiled regardless of
|
| 364 |
+
timestamps.
|
| 365 |
+
|
| 366 |
+
The source filename encoded in each bytecode file defaults to the
|
| 367 |
+
filenames listed in 'py_files'; you can modify these with 'prefix' and
|
| 368 |
+
'basedir'. 'prefix' is a string that will be stripped off of each
|
| 369 |
+
source filename, and 'base_dir' is a directory name that will be
|
| 370 |
+
prepended (after 'prefix' is stripped). You can supply either or both
|
| 371 |
+
(or neither) of 'prefix' and 'base_dir', as you wish.
|
| 372 |
+
|
| 373 |
+
Byte-compilation is either done directly in this interpreter process
|
| 374 |
+
with the standard py_compile module, or indirectly by writing a
|
| 375 |
+
temporary script and executing it. Normally, you should let
|
| 376 |
+
'byte_compile()' figure out to use direct compilation or not (see
|
| 377 |
+
the source for details). The 'direct' flag is used by the script
|
| 378 |
+
generated in indirect mode; unless you know what you're doing, leave
|
| 379 |
+
it set to None.
|
| 380 |
+
"""
|
| 381 |
+
|
| 382 |
+
# nothing is done if sys.dont_write_bytecode is True
|
| 383 |
+
if sys.dont_write_bytecode:
|
| 384 |
+
raise DistutilsByteCompileError('byte-compiling is disabled.')
|
| 385 |
+
|
| 386 |
+
# First, if the caller didn't force us into direct or indirect mode,
|
| 387 |
+
# figure out which mode we should be in. We take a conservative
|
| 388 |
+
# approach: choose direct mode *only* if the current interpreter is
|
| 389 |
+
# in debug mode and optimize is 0. If we're not in debug mode (-O
|
| 390 |
+
# or -OO), we don't know which level of optimization this
|
| 391 |
+
# interpreter is running with, so we can't do direct
|
| 392 |
+
# byte-compilation and be certain that it's the right thing. Thus,
|
| 393 |
+
# always compile indirectly if the current interpreter is in either
|
| 394 |
+
# optimize mode, or if either optimization level was requested by
|
| 395 |
+
# the caller.
|
| 396 |
+
if direct is None:
|
| 397 |
+
direct = __debug__ and optimize == 0
|
| 398 |
+
|
| 399 |
+
# "Indirect" byte-compilation: write a temporary script and then
|
| 400 |
+
# run it with the appropriate flags.
|
| 401 |
+
if not direct:
|
| 402 |
+
(script_fd, script_name) = tempfile.mkstemp(".py")
|
| 403 |
+
log.info("writing byte-compilation script '%s'", script_name)
|
| 404 |
+
script = os.fdopen(script_fd, "w", encoding='utf-8')
|
| 405 |
+
|
| 406 |
+
with script:
|
| 407 |
+
script.write(
|
| 408 |
+
"""\
|
| 409 |
+
from distutils.util import byte_compile
|
| 410 |
+
files = [
|
| 411 |
+
"""
|
| 412 |
+
)
|
| 413 |
+
|
| 414 |
+
# XXX would be nice to write absolute filenames, just for
|
| 415 |
+
# safety's sake (script should be more robust in the face of
|
| 416 |
+
# chdir'ing before running it). But this requires abspath'ing
|
| 417 |
+
# 'prefix' as well, and that breaks the hack in build_lib's
|
| 418 |
+
# 'byte_compile()' method that carefully tacks on a trailing
|
| 419 |
+
# slash (os.sep really) to make sure the prefix here is "just
|
| 420 |
+
# right". This whole prefix business is rather delicate -- the
|
| 421 |
+
# problem is that it's really a directory, but I'm treating it
|
| 422 |
+
# as a dumb string, so trailing slashes and so forth matter.
|
| 423 |
+
|
| 424 |
+
script.write(",\n".join(map(repr, py_files)) + "]\n")
|
| 425 |
+
script.write(
|
| 426 |
+
f"""
|
| 427 |
+
byte_compile(files, optimize={optimize!r}, force={force!r},
|
| 428 |
+
prefix={prefix!r}, base_dir={base_dir!r},
|
| 429 |
+
verbose={verbose!r},
|
| 430 |
+
direct=True)
|
| 431 |
+
"""
|
| 432 |
+
)
|
| 433 |
+
|
| 434 |
+
cmd = [sys.executable]
|
| 435 |
+
cmd.extend(subprocess._optim_args_from_interpreter_flags())
|
| 436 |
+
cmd.append(script_name)
|
| 437 |
+
spawn(cmd)
|
| 438 |
+
execute(os.remove, (script_name,), f"removing {script_name}")
|
| 439 |
+
|
| 440 |
+
# "Direct" byte-compilation: use the py_compile module to compile
|
| 441 |
+
# right here, right now. Note that the script generated in indirect
|
| 442 |
+
# mode simply calls 'byte_compile()' in direct mode, a weird sort of
|
| 443 |
+
# cross-process recursion. Hey, it works!
|
| 444 |
+
else:
|
| 445 |
+
from py_compile import compile
|
| 446 |
+
|
| 447 |
+
for file in py_files:
|
| 448 |
+
if file[-3:] != ".py":
|
| 449 |
+
# This lets us be lazy and not filter filenames in
|
| 450 |
+
# the "install_lib" command.
|
| 451 |
+
continue
|
| 452 |
+
|
| 453 |
+
# Terminology from the py_compile module:
|
| 454 |
+
# cfile - byte-compiled file
|
| 455 |
+
# dfile - purported source filename (same as 'file' by default)
|
| 456 |
+
if optimize >= 0:
|
| 457 |
+
opt = '' if optimize == 0 else optimize
|
| 458 |
+
cfile = importlib.util.cache_from_source(file, optimization=opt)
|
| 459 |
+
else:
|
| 460 |
+
cfile = importlib.util.cache_from_source(file)
|
| 461 |
+
dfile = file
|
| 462 |
+
if prefix:
|
| 463 |
+
if file[: len(prefix)] != prefix:
|
| 464 |
+
raise ValueError(
|
| 465 |
+
f"invalid prefix: filename {file!r} doesn't start with {prefix!r}"
|
| 466 |
+
)
|
| 467 |
+
dfile = dfile[len(prefix) :]
|
| 468 |
+
if base_dir:
|
| 469 |
+
dfile = os.path.join(base_dir, dfile)
|
| 470 |
+
|
| 471 |
+
cfile_base = os.path.basename(cfile)
|
| 472 |
+
if direct:
|
| 473 |
+
if force or newer(file, cfile):
|
| 474 |
+
log.info("byte-compiling %s to %s", file, cfile_base)
|
| 475 |
+
compile(file, cfile, dfile)
|
| 476 |
+
else:
|
| 477 |
+
log.debug("skipping byte-compilation of %s to %s", file, cfile_base)
|
| 478 |
+
|
| 479 |
+
|
| 480 |
+
def rfc822_escape(header: str) -> str:
|
| 481 |
+
"""Return a version of the string escaped for inclusion in an
|
| 482 |
+
RFC-822 header, by ensuring there are 8 spaces space after each newline.
|
| 483 |
+
"""
|
| 484 |
+
indent = 8 * " "
|
| 485 |
+
lines = header.splitlines(keepends=True)
|
| 486 |
+
|
| 487 |
+
# Emulate the behaviour of `str.split`
|
| 488 |
+
# (the terminal line break in `splitlines` does not result in an extra line):
|
| 489 |
+
ends_in_newline = lines and lines[-1].splitlines()[0] != lines[-1]
|
| 490 |
+
suffix = indent if ends_in_newline else ""
|
| 491 |
+
|
| 492 |
+
return indent.join(lines) + suffix
|
| 493 |
+
|
| 494 |
+
|
| 495 |
+
def is_mingw() -> bool:
|
| 496 |
+
"""Returns True if the current platform is mingw.
|
| 497 |
+
|
| 498 |
+
Python compiled with Mingw-w64 has sys.platform == 'win32' and
|
| 499 |
+
get_platform() starts with 'mingw'.
|
| 500 |
+
"""
|
| 501 |
+
return sys.platform == 'win32' and get_platform().startswith('mingw')
|
| 502 |
+
|
| 503 |
+
|
| 504 |
+
def is_freethreaded():
|
| 505 |
+
"""Return True if the Python interpreter is built with free threading support."""
|
| 506 |
+
return bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/version.py
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#
|
| 2 |
+
# distutils/version.py
|
| 3 |
+
#
|
| 4 |
+
# Implements multiple version numbering conventions for the
|
| 5 |
+
# Python Module Distribution Utilities.
|
| 6 |
+
#
|
| 7 |
+
# $Id$
|
| 8 |
+
#
|
| 9 |
+
|
| 10 |
+
"""Provides classes to represent module version numbers (one class for
|
| 11 |
+
each style of version numbering). There are currently two such classes
|
| 12 |
+
implemented: StrictVersion and LooseVersion.
|
| 13 |
+
|
| 14 |
+
Every version number class implements the following interface:
|
| 15 |
+
* the 'parse' method takes a string and parses it to some internal
|
| 16 |
+
representation; if the string is an invalid version number,
|
| 17 |
+
'parse' raises a ValueError exception
|
| 18 |
+
* the class constructor takes an optional string argument which,
|
| 19 |
+
if supplied, is passed to 'parse'
|
| 20 |
+
* __str__ reconstructs the string that was passed to 'parse' (or
|
| 21 |
+
an equivalent string -- ie. one that will generate an equivalent
|
| 22 |
+
version number instance)
|
| 23 |
+
* __repr__ generates Python code to recreate the version number instance
|
| 24 |
+
* _cmp compares the current instance with either another instance
|
| 25 |
+
of the same class or a string (which will be parsed to an instance
|
| 26 |
+
of the same class, thus must follow the same rules)
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
import contextlib
|
| 30 |
+
import re
|
| 31 |
+
import warnings
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@contextlib.contextmanager
|
| 35 |
+
def suppress_known_deprecation():
|
| 36 |
+
with warnings.catch_warnings(record=True) as ctx:
|
| 37 |
+
warnings.filterwarnings(
|
| 38 |
+
action='default',
|
| 39 |
+
category=DeprecationWarning,
|
| 40 |
+
message="distutils Version classes are deprecated.",
|
| 41 |
+
)
|
| 42 |
+
yield ctx
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
class Version:
|
| 46 |
+
"""Abstract base class for version numbering classes. Just provides
|
| 47 |
+
constructor (__init__) and reproducer (__repr__), because those
|
| 48 |
+
seem to be the same for all version numbering classes; and route
|
| 49 |
+
rich comparisons to _cmp.
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
def __init__(self, vstring=None):
|
| 53 |
+
if vstring:
|
| 54 |
+
self.parse(vstring)
|
| 55 |
+
warnings.warn(
|
| 56 |
+
"distutils Version classes are deprecated. Use packaging.version instead.",
|
| 57 |
+
DeprecationWarning,
|
| 58 |
+
stacklevel=2,
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
def __repr__(self):
|
| 62 |
+
return f"{self.__class__.__name__} ('{self}')"
|
| 63 |
+
|
| 64 |
+
def __eq__(self, other):
|
| 65 |
+
c = self._cmp(other)
|
| 66 |
+
if c is NotImplemented:
|
| 67 |
+
return c
|
| 68 |
+
return c == 0
|
| 69 |
+
|
| 70 |
+
def __lt__(self, other):
|
| 71 |
+
c = self._cmp(other)
|
| 72 |
+
if c is NotImplemented:
|
| 73 |
+
return c
|
| 74 |
+
return c < 0
|
| 75 |
+
|
| 76 |
+
def __le__(self, other):
|
| 77 |
+
c = self._cmp(other)
|
| 78 |
+
if c is NotImplemented:
|
| 79 |
+
return c
|
| 80 |
+
return c <= 0
|
| 81 |
+
|
| 82 |
+
def __gt__(self, other):
|
| 83 |
+
c = self._cmp(other)
|
| 84 |
+
if c is NotImplemented:
|
| 85 |
+
return c
|
| 86 |
+
return c > 0
|
| 87 |
+
|
| 88 |
+
def __ge__(self, other):
|
| 89 |
+
c = self._cmp(other)
|
| 90 |
+
if c is NotImplemented:
|
| 91 |
+
return c
|
| 92 |
+
return c >= 0
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
# Interface for version-number classes -- must be implemented
|
| 96 |
+
# by the following classes (the concrete ones -- Version should
|
| 97 |
+
# be treated as an abstract class).
|
| 98 |
+
# __init__ (string) - create and take same action as 'parse'
|
| 99 |
+
# (string parameter is optional)
|
| 100 |
+
# parse (string) - convert a string representation to whatever
|
| 101 |
+
# internal representation is appropriate for
|
| 102 |
+
# this style of version numbering
|
| 103 |
+
# __str__ (self) - convert back to a string; should be very similar
|
| 104 |
+
# (if not identical to) the string supplied to parse
|
| 105 |
+
# __repr__ (self) - generate Python code to recreate
|
| 106 |
+
# the instance
|
| 107 |
+
# _cmp (self, other) - compare two version numbers ('other' may
|
| 108 |
+
# be an unparsed version string, or another
|
| 109 |
+
# instance of your version class)
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
class StrictVersion(Version):
|
| 113 |
+
"""Version numbering for anal retentives and software idealists.
|
| 114 |
+
Implements the standard interface for version number classes as
|
| 115 |
+
described above. A version number consists of two or three
|
| 116 |
+
dot-separated numeric components, with an optional "pre-release" tag
|
| 117 |
+
on the end. The pre-release tag consists of the letter 'a' or 'b'
|
| 118 |
+
followed by a number. If the numeric components of two version
|
| 119 |
+
numbers are equal, then one with a pre-release tag will always
|
| 120 |
+
be deemed earlier (lesser) than one without.
|
| 121 |
+
|
| 122 |
+
The following are valid version numbers (shown in the order that
|
| 123 |
+
would be obtained by sorting according to the supplied cmp function):
|
| 124 |
+
|
| 125 |
+
0.4 0.4.0 (these two are equivalent)
|
| 126 |
+
0.4.1
|
| 127 |
+
0.5a1
|
| 128 |
+
0.5b3
|
| 129 |
+
0.5
|
| 130 |
+
0.9.6
|
| 131 |
+
1.0
|
| 132 |
+
1.0.4a3
|
| 133 |
+
1.0.4b1
|
| 134 |
+
1.0.4
|
| 135 |
+
|
| 136 |
+
The following are examples of invalid version numbers:
|
| 137 |
+
|
| 138 |
+
1
|
| 139 |
+
2.7.2.2
|
| 140 |
+
1.3.a4
|
| 141 |
+
1.3pl1
|
| 142 |
+
1.3c4
|
| 143 |
+
|
| 144 |
+
The rationale for this version numbering system will be explained
|
| 145 |
+
in the distutils documentation.
|
| 146 |
+
"""
|
| 147 |
+
|
| 148 |
+
version_re = re.compile(
|
| 149 |
+
r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$', re.VERBOSE | re.ASCII
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
def parse(self, vstring):
|
| 153 |
+
match = self.version_re.match(vstring)
|
| 154 |
+
if not match:
|
| 155 |
+
raise ValueError(f"invalid version number '{vstring}'")
|
| 156 |
+
|
| 157 |
+
(major, minor, patch, prerelease, prerelease_num) = match.group(1, 2, 4, 5, 6)
|
| 158 |
+
|
| 159 |
+
if patch:
|
| 160 |
+
self.version = tuple(map(int, [major, minor, patch]))
|
| 161 |
+
else:
|
| 162 |
+
self.version = tuple(map(int, [major, minor])) + (0,)
|
| 163 |
+
|
| 164 |
+
if prerelease:
|
| 165 |
+
self.prerelease = (prerelease[0], int(prerelease_num))
|
| 166 |
+
else:
|
| 167 |
+
self.prerelease = None
|
| 168 |
+
|
| 169 |
+
def __str__(self):
|
| 170 |
+
if self.version[2] == 0:
|
| 171 |
+
vstring = '.'.join(map(str, self.version[0:2]))
|
| 172 |
+
else:
|
| 173 |
+
vstring = '.'.join(map(str, self.version))
|
| 174 |
+
|
| 175 |
+
if self.prerelease:
|
| 176 |
+
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
|
| 177 |
+
|
| 178 |
+
return vstring
|
| 179 |
+
|
| 180 |
+
def _cmp(self, other):
|
| 181 |
+
if isinstance(other, str):
|
| 182 |
+
with suppress_known_deprecation():
|
| 183 |
+
other = StrictVersion(other)
|
| 184 |
+
elif not isinstance(other, StrictVersion):
|
| 185 |
+
return NotImplemented
|
| 186 |
+
|
| 187 |
+
if self.version == other.version:
|
| 188 |
+
# versions match; pre-release drives the comparison
|
| 189 |
+
return self._cmp_prerelease(other)
|
| 190 |
+
|
| 191 |
+
return -1 if self.version < other.version else 1
|
| 192 |
+
|
| 193 |
+
def _cmp_prerelease(self, other):
|
| 194 |
+
"""
|
| 195 |
+
case 1: self has prerelease, other doesn't; other is greater
|
| 196 |
+
case 2: self doesn't have prerelease, other does: self is greater
|
| 197 |
+
case 3: both or neither have prerelease: compare them!
|
| 198 |
+
"""
|
| 199 |
+
if self.prerelease and not other.prerelease:
|
| 200 |
+
return -1
|
| 201 |
+
elif not self.prerelease and other.prerelease:
|
| 202 |
+
return 1
|
| 203 |
+
|
| 204 |
+
if self.prerelease == other.prerelease:
|
| 205 |
+
return 0
|
| 206 |
+
elif self.prerelease < other.prerelease:
|
| 207 |
+
return -1
|
| 208 |
+
else:
|
| 209 |
+
return 1
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
# end class StrictVersion
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
# The rules according to Greg Stein:
|
| 216 |
+
# 1) a version number has 1 or more numbers separated by a period or by
|
| 217 |
+
# sequences of letters. If only periods, then these are compared
|
| 218 |
+
# left-to-right to determine an ordering.
|
| 219 |
+
# 2) sequences of letters are part of the tuple for comparison and are
|
| 220 |
+
# compared lexicographically
|
| 221 |
+
# 3) recognize the numeric components may have leading zeroes
|
| 222 |
+
#
|
| 223 |
+
# The LooseVersion class below implements these rules: a version number
|
| 224 |
+
# string is split up into a tuple of integer and string components, and
|
| 225 |
+
# comparison is a simple tuple comparison. This means that version
|
| 226 |
+
# numbers behave in a predictable and obvious way, but a way that might
|
| 227 |
+
# not necessarily be how people *want* version numbers to behave. There
|
| 228 |
+
# wouldn't be a problem if people could stick to purely numeric version
|
| 229 |
+
# numbers: just split on period and compare the numbers as tuples.
|
| 230 |
+
# However, people insist on putting letters into their version numbers;
|
| 231 |
+
# the most common purpose seems to be:
|
| 232 |
+
# - indicating a "pre-release" version
|
| 233 |
+
# ('alpha', 'beta', 'a', 'b', 'pre', 'p')
|
| 234 |
+
# - indicating a post-release patch ('p', 'pl', 'patch')
|
| 235 |
+
# but of course this can't cover all version number schemes, and there's
|
| 236 |
+
# no way to know what a programmer means without asking him.
|
| 237 |
+
#
|
| 238 |
+
# The problem is what to do with letters (and other non-numeric
|
| 239 |
+
# characters) in a version number. The current implementation does the
|
| 240 |
+
# obvious and predictable thing: keep them as strings and compare
|
| 241 |
+
# lexically within a tuple comparison. This has the desired effect if
|
| 242 |
+
# an appended letter sequence implies something "post-release":
|
| 243 |
+
# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
|
| 244 |
+
#
|
| 245 |
+
# However, if letters in a version number imply a pre-release version,
|
| 246 |
+
# the "obvious" thing isn't correct. Eg. you would expect that
|
| 247 |
+
# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
|
| 248 |
+
# implemented here, this just isn't so.
|
| 249 |
+
#
|
| 250 |
+
# Two possible solutions come to mind. The first is to tie the
|
| 251 |
+
# comparison algorithm to a particular set of semantic rules, as has
|
| 252 |
+
# been done in the StrictVersion class above. This works great as long
|
| 253 |
+
# as everyone can go along with bondage and discipline. Hopefully a
|
| 254 |
+
# (large) subset of Python module programmers will agree that the
|
| 255 |
+
# particular flavour of bondage and discipline provided by StrictVersion
|
| 256 |
+
# provides enough benefit to be worth using, and will submit their
|
| 257 |
+
# version numbering scheme to its domination. The free-thinking
|
| 258 |
+
# anarchists in the lot will never give in, though, and something needs
|
| 259 |
+
# to be done to accommodate them.
|
| 260 |
+
#
|
| 261 |
+
# Perhaps a "moderately strict" version class could be implemented that
|
| 262 |
+
# lets almost anything slide (syntactically), and makes some heuristic
|
| 263 |
+
# assumptions about non-digits in version number strings. This could
|
| 264 |
+
# sink into special-case-hell, though; if I was as talented and
|
| 265 |
+
# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
|
| 266 |
+
# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
|
| 267 |
+
# just as happy dealing with things like "2g6" and "1.13++". I don't
|
| 268 |
+
# think I'm smart enough to do it right though.
|
| 269 |
+
#
|
| 270 |
+
# In any case, I've coded the test suite for this module (see
|
| 271 |
+
# ../test/test_version.py) specifically to fail on things like comparing
|
| 272 |
+
# "1.2a2" and "1.2". That's not because the *code* is doing anything
|
| 273 |
+
# wrong, it's because the simple, obvious design doesn't match my
|
| 274 |
+
# complicated, hairy expectations for real-world version numbers. It
|
| 275 |
+
# would be a snap to fix the test suite to say, "Yep, LooseVersion does
|
| 276 |
+
# the Right Thing" (ie. the code matches the conception). But I'd rather
|
| 277 |
+
# have a conception that matches common notions about version numbers.
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
class LooseVersion(Version):
|
| 281 |
+
"""Version numbering for anarchists and software realists.
|
| 282 |
+
Implements the standard interface for version number classes as
|
| 283 |
+
described above. A version number consists of a series of numbers,
|
| 284 |
+
separated by either periods or strings of letters. When comparing
|
| 285 |
+
version numbers, the numeric components will be compared
|
| 286 |
+
numerically, and the alphabetic components lexically. The following
|
| 287 |
+
are all valid version numbers, in no particular order:
|
| 288 |
+
|
| 289 |
+
1.5.1
|
| 290 |
+
1.5.2b2
|
| 291 |
+
161
|
| 292 |
+
3.10a
|
| 293 |
+
8.02
|
| 294 |
+
3.4j
|
| 295 |
+
1996.07.12
|
| 296 |
+
3.2.pl0
|
| 297 |
+
3.1.1.6
|
| 298 |
+
2g6
|
| 299 |
+
11g
|
| 300 |
+
0.960923
|
| 301 |
+
2.2beta29
|
| 302 |
+
1.13++
|
| 303 |
+
5.5.kw
|
| 304 |
+
2.0b1pl0
|
| 305 |
+
|
| 306 |
+
In fact, there is no such thing as an invalid version number under
|
| 307 |
+
this scheme; the rules for comparison are simple and predictable,
|
| 308 |
+
but may not always give the results you want (for some definition
|
| 309 |
+
of "want").
|
| 310 |
+
"""
|
| 311 |
+
|
| 312 |
+
component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
|
| 313 |
+
|
| 314 |
+
def parse(self, vstring):
|
| 315 |
+
# I've given up on thinking I can reconstruct the version string
|
| 316 |
+
# from the parsed tuple -- so I just store the string here for
|
| 317 |
+
# use by __str__
|
| 318 |
+
self.vstring = vstring
|
| 319 |
+
components = [x for x in self.component_re.split(vstring) if x and x != '.']
|
| 320 |
+
for i, obj in enumerate(components):
|
| 321 |
+
try:
|
| 322 |
+
components[i] = int(obj)
|
| 323 |
+
except ValueError:
|
| 324 |
+
pass
|
| 325 |
+
|
| 326 |
+
self.version = components
|
| 327 |
+
|
| 328 |
+
def __str__(self):
|
| 329 |
+
return self.vstring
|
| 330 |
+
|
| 331 |
+
def __repr__(self):
|
| 332 |
+
return f"LooseVersion ('{self}')"
|
| 333 |
+
|
| 334 |
+
def _cmp(self, other):
|
| 335 |
+
if isinstance(other, str):
|
| 336 |
+
other = LooseVersion(other)
|
| 337 |
+
elif not isinstance(other, LooseVersion):
|
| 338 |
+
return NotImplemented
|
| 339 |
+
|
| 340 |
+
if self.version == other.version:
|
| 341 |
+
return 0
|
| 342 |
+
if self.version < other.version:
|
| 343 |
+
return -1
|
| 344 |
+
if self.version > other.version:
|
| 345 |
+
return 1
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
# end class LooseVersion
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/versionpredicate.py
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Module for parsing and testing package version predicate strings."""
|
| 2 |
+
|
| 3 |
+
import operator
|
| 4 |
+
import re
|
| 5 |
+
|
| 6 |
+
from . import version
|
| 7 |
+
|
| 8 |
+
re_validPackage = re.compile(r"(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)", re.ASCII)
|
| 9 |
+
# (package) (rest)
|
| 10 |
+
|
| 11 |
+
re_paren = re.compile(r"^\s*\((.*)\)\s*$") # (list) inside of parentheses
|
| 12 |
+
re_splitComparison = re.compile(r"^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$")
|
| 13 |
+
# (comp) (version)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def splitUp(pred):
|
| 17 |
+
"""Parse a single version comparison.
|
| 18 |
+
|
| 19 |
+
Return (comparison string, StrictVersion)
|
| 20 |
+
"""
|
| 21 |
+
res = re_splitComparison.match(pred)
|
| 22 |
+
if not res:
|
| 23 |
+
raise ValueError(f"bad package restriction syntax: {pred!r}")
|
| 24 |
+
comp, verStr = res.groups()
|
| 25 |
+
with version.suppress_known_deprecation():
|
| 26 |
+
other = version.StrictVersion(verStr)
|
| 27 |
+
return (comp, other)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
compmap = {
|
| 31 |
+
"<": operator.lt,
|
| 32 |
+
"<=": operator.le,
|
| 33 |
+
"==": operator.eq,
|
| 34 |
+
">": operator.gt,
|
| 35 |
+
">=": operator.ge,
|
| 36 |
+
"!=": operator.ne,
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class VersionPredicate:
|
| 41 |
+
"""Parse and test package version predicates.
|
| 42 |
+
|
| 43 |
+
>>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')
|
| 44 |
+
|
| 45 |
+
The `name` attribute provides the full dotted name that is given::
|
| 46 |
+
|
| 47 |
+
>>> v.name
|
| 48 |
+
'pyepat.abc'
|
| 49 |
+
|
| 50 |
+
The str() of a `VersionPredicate` provides a normalized
|
| 51 |
+
human-readable version of the expression::
|
| 52 |
+
|
| 53 |
+
>>> print(v)
|
| 54 |
+
pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)
|
| 55 |
+
|
| 56 |
+
The `satisfied_by()` method can be used to determine with a given
|
| 57 |
+
version number is included in the set described by the version
|
| 58 |
+
restrictions::
|
| 59 |
+
|
| 60 |
+
>>> v.satisfied_by('1.1')
|
| 61 |
+
True
|
| 62 |
+
>>> v.satisfied_by('1.4')
|
| 63 |
+
True
|
| 64 |
+
>>> v.satisfied_by('1.0')
|
| 65 |
+
False
|
| 66 |
+
>>> v.satisfied_by('4444.4')
|
| 67 |
+
False
|
| 68 |
+
>>> v.satisfied_by('1555.1b3')
|
| 69 |
+
False
|
| 70 |
+
|
| 71 |
+
`VersionPredicate` is flexible in accepting extra whitespace::
|
| 72 |
+
|
| 73 |
+
>>> v = VersionPredicate(' pat( == 0.1 ) ')
|
| 74 |
+
>>> v.name
|
| 75 |
+
'pat'
|
| 76 |
+
>>> v.satisfied_by('0.1')
|
| 77 |
+
True
|
| 78 |
+
>>> v.satisfied_by('0.2')
|
| 79 |
+
False
|
| 80 |
+
|
| 81 |
+
If any version numbers passed in do not conform to the
|
| 82 |
+
restrictions of `StrictVersion`, a `ValueError` is raised::
|
| 83 |
+
|
| 84 |
+
>>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
|
| 85 |
+
Traceback (most recent call last):
|
| 86 |
+
...
|
| 87 |
+
ValueError: invalid version number '1.2zb3'
|
| 88 |
+
|
| 89 |
+
It the module or package name given does not conform to what's
|
| 90 |
+
allowed as a legal module or package name, `ValueError` is
|
| 91 |
+
raised::
|
| 92 |
+
|
| 93 |
+
>>> v = VersionPredicate('foo-bar')
|
| 94 |
+
Traceback (most recent call last):
|
| 95 |
+
...
|
| 96 |
+
ValueError: expected parenthesized list: '-bar'
|
| 97 |
+
|
| 98 |
+
>>> v = VersionPredicate('foo bar (12.21)')
|
| 99 |
+
Traceback (most recent call last):
|
| 100 |
+
...
|
| 101 |
+
ValueError: expected parenthesized list: 'bar (12.21)'
|
| 102 |
+
|
| 103 |
+
"""
|
| 104 |
+
|
| 105 |
+
def __init__(self, versionPredicateStr):
|
| 106 |
+
"""Parse a version predicate string."""
|
| 107 |
+
# Fields:
|
| 108 |
+
# name: package name
|
| 109 |
+
# pred: list of (comparison string, StrictVersion)
|
| 110 |
+
|
| 111 |
+
versionPredicateStr = versionPredicateStr.strip()
|
| 112 |
+
if not versionPredicateStr:
|
| 113 |
+
raise ValueError("empty package restriction")
|
| 114 |
+
match = re_validPackage.match(versionPredicateStr)
|
| 115 |
+
if not match:
|
| 116 |
+
raise ValueError(f"bad package name in {versionPredicateStr!r}")
|
| 117 |
+
self.name, paren = match.groups()
|
| 118 |
+
paren = paren.strip()
|
| 119 |
+
if paren:
|
| 120 |
+
match = re_paren.match(paren)
|
| 121 |
+
if not match:
|
| 122 |
+
raise ValueError(f"expected parenthesized list: {paren!r}")
|
| 123 |
+
str = match.groups()[0]
|
| 124 |
+
self.pred = [splitUp(aPred) for aPred in str.split(",")]
|
| 125 |
+
if not self.pred:
|
| 126 |
+
raise ValueError(f"empty parenthesized list in {versionPredicateStr!r}")
|
| 127 |
+
else:
|
| 128 |
+
self.pred = []
|
| 129 |
+
|
| 130 |
+
def __str__(self):
|
| 131 |
+
if self.pred:
|
| 132 |
+
seq = [cond + " " + str(ver) for cond, ver in self.pred]
|
| 133 |
+
return self.name + " (" + ", ".join(seq) + ")"
|
| 134 |
+
else:
|
| 135 |
+
return self.name
|
| 136 |
+
|
| 137 |
+
def satisfied_by(self, version):
|
| 138 |
+
"""True if version is compatible with all the predicates in self.
|
| 139 |
+
The parameter version must be acceptable to the StrictVersion
|
| 140 |
+
constructor. It may be either a string or StrictVersion.
|
| 141 |
+
"""
|
| 142 |
+
for cond, ver in self.pred:
|
| 143 |
+
if not compmap[cond](version, ver):
|
| 144 |
+
return False
|
| 145 |
+
return True
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
_provision_rx = None
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
def split_provision(value):
|
| 152 |
+
"""Return the name and optional version number of a provision.
|
| 153 |
+
|
| 154 |
+
The version number, if given, will be returned as a `StrictVersion`
|
| 155 |
+
instance, otherwise it will be `None`.
|
| 156 |
+
|
| 157 |
+
>>> split_provision('mypkg')
|
| 158 |
+
('mypkg', None)
|
| 159 |
+
>>> split_provision(' mypkg( 1.2 ) ')
|
| 160 |
+
('mypkg', StrictVersion ('1.2'))
|
| 161 |
+
"""
|
| 162 |
+
global _provision_rx
|
| 163 |
+
if _provision_rx is None:
|
| 164 |
+
_provision_rx = re.compile(
|
| 165 |
+
r"([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$", re.ASCII
|
| 166 |
+
)
|
| 167 |
+
value = value.strip()
|
| 168 |
+
m = _provision_rx.match(value)
|
| 169 |
+
if not m:
|
| 170 |
+
raise ValueError(f"illegal provides specification: {value!r}")
|
| 171 |
+
ver = m.group(2) or None
|
| 172 |
+
if ver:
|
| 173 |
+
with version.suppress_known_deprecation():
|
| 174 |
+
ver = version.StrictVersion(ver)
|
| 175 |
+
return m.group(1), ver
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_distutils/zosccompiler.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .compilers.C import zos
|
| 2 |
+
|
| 3 |
+
zOSCCompiler = zos.Compiler
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_entry_points.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import functools
|
| 2 |
+
import itertools
|
| 3 |
+
import operator
|
| 4 |
+
|
| 5 |
+
from jaraco.functools import pass_none
|
| 6 |
+
from jaraco.text import yield_lines
|
| 7 |
+
from more_itertools import consume
|
| 8 |
+
|
| 9 |
+
from ._importlib import metadata
|
| 10 |
+
from ._itertools import ensure_unique
|
| 11 |
+
from .errors import OptionError
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def ensure_valid(ep):
|
| 15 |
+
"""
|
| 16 |
+
Exercise one of the dynamic properties to trigger
|
| 17 |
+
the pattern match.
|
| 18 |
+
|
| 19 |
+
This function is deprecated in favor of importlib_metadata 8.7 and
|
| 20 |
+
Python 3.14 importlib.metadata, which validates entry points on
|
| 21 |
+
construction.
|
| 22 |
+
"""
|
| 23 |
+
try:
|
| 24 |
+
ep.extras
|
| 25 |
+
except (AttributeError, AssertionError) as ex:
|
| 26 |
+
# Why both? See https://github.com/python/importlib_metadata/issues/488
|
| 27 |
+
msg = (
|
| 28 |
+
f"Problems to parse {ep}.\nPlease ensure entry-point follows the spec: "
|
| 29 |
+
"https://packaging.python.org/en/latest/specifications/entry-points/"
|
| 30 |
+
)
|
| 31 |
+
raise OptionError(msg) from ex
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def load_group(value, group):
|
| 35 |
+
"""
|
| 36 |
+
Given a value of an entry point or series of entry points,
|
| 37 |
+
return each as an EntryPoint.
|
| 38 |
+
"""
|
| 39 |
+
# normalize to a single sequence of lines
|
| 40 |
+
lines = yield_lines(value)
|
| 41 |
+
text = f'[{group}]\n' + '\n'.join(lines)
|
| 42 |
+
return metadata.EntryPoints._from_text(text)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def by_group_and_name(ep):
|
| 46 |
+
return ep.group, ep.name
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def validate(eps: metadata.EntryPoints):
|
| 50 |
+
"""
|
| 51 |
+
Ensure entry points are unique by group and name and validate each.
|
| 52 |
+
"""
|
| 53 |
+
consume(map(ensure_valid, ensure_unique(eps, key=by_group_and_name)))
|
| 54 |
+
return eps
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
@functools.singledispatch
|
| 58 |
+
def load(eps):
|
| 59 |
+
"""
|
| 60 |
+
Given a Distribution.entry_points, produce EntryPoints.
|
| 61 |
+
"""
|
| 62 |
+
groups = itertools.chain.from_iterable(
|
| 63 |
+
load_group(value, group) for group, value in eps.items()
|
| 64 |
+
)
|
| 65 |
+
return validate(metadata.EntryPoints(groups))
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
@load.register(str)
|
| 69 |
+
def _(eps):
|
| 70 |
+
r"""
|
| 71 |
+
>>> ep, = load('[console_scripts]\nfoo=bar')
|
| 72 |
+
>>> ep.group
|
| 73 |
+
'console_scripts'
|
| 74 |
+
>>> ep.name
|
| 75 |
+
'foo'
|
| 76 |
+
>>> ep.value
|
| 77 |
+
'bar'
|
| 78 |
+
"""
|
| 79 |
+
return validate(metadata.EntryPoints(metadata.EntryPoints._from_text(eps)))
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
load.register(type(None), lambda x: x)
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
@pass_none
|
| 86 |
+
def render(eps: metadata.EntryPoints):
|
| 87 |
+
by_group = operator.attrgetter('group')
|
| 88 |
+
groups = itertools.groupby(sorted(eps, key=by_group), by_group)
|
| 89 |
+
|
| 90 |
+
return '\n'.join(f'[{group}]\n{render_items(items)}\n' for group, items in groups)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def render_items(eps):
|
| 94 |
+
return '\n'.join(f'{ep.name} = {ep.value}' for ep in sorted(eps))
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_imp.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Re-implementation of find_module and get_frozen_object
|
| 3 |
+
from the deprecated imp module.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import importlib.machinery
|
| 7 |
+
import importlib.util
|
| 8 |
+
import os
|
| 9 |
+
import tokenize
|
| 10 |
+
from importlib.util import module_from_spec
|
| 11 |
+
|
| 12 |
+
PY_SOURCE = 1
|
| 13 |
+
PY_COMPILED = 2
|
| 14 |
+
C_EXTENSION = 3
|
| 15 |
+
C_BUILTIN = 6
|
| 16 |
+
PY_FROZEN = 7
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def find_spec(module, paths):
|
| 20 |
+
finder = (
|
| 21 |
+
importlib.machinery.PathFinder().find_spec
|
| 22 |
+
if isinstance(paths, list)
|
| 23 |
+
else importlib.util.find_spec
|
| 24 |
+
)
|
| 25 |
+
return finder(module, paths)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def find_module(module, paths=None):
|
| 29 |
+
"""Just like 'imp.find_module()', but with package support"""
|
| 30 |
+
spec = find_spec(module, paths)
|
| 31 |
+
if spec is None:
|
| 32 |
+
raise ImportError(f"Can't find {module}")
|
| 33 |
+
if not spec.has_location and hasattr(spec, 'submodule_search_locations'):
|
| 34 |
+
spec = importlib.util.spec_from_loader('__init__.py', spec.loader)
|
| 35 |
+
|
| 36 |
+
kind = -1
|
| 37 |
+
file = None
|
| 38 |
+
static = isinstance(spec.loader, type)
|
| 39 |
+
if (
|
| 40 |
+
spec.origin == 'frozen'
|
| 41 |
+
or static
|
| 42 |
+
and issubclass(spec.loader, importlib.machinery.FrozenImporter)
|
| 43 |
+
):
|
| 44 |
+
kind = PY_FROZEN
|
| 45 |
+
path = None # imp compabilty
|
| 46 |
+
suffix = mode = '' # imp compatibility
|
| 47 |
+
elif (
|
| 48 |
+
spec.origin == 'built-in'
|
| 49 |
+
or static
|
| 50 |
+
and issubclass(spec.loader, importlib.machinery.BuiltinImporter)
|
| 51 |
+
):
|
| 52 |
+
kind = C_BUILTIN
|
| 53 |
+
path = None # imp compabilty
|
| 54 |
+
suffix = mode = '' # imp compatibility
|
| 55 |
+
elif spec.has_location:
|
| 56 |
+
path = spec.origin
|
| 57 |
+
suffix = os.path.splitext(path)[1]
|
| 58 |
+
mode = 'r' if suffix in importlib.machinery.SOURCE_SUFFIXES else 'rb'
|
| 59 |
+
|
| 60 |
+
if suffix in importlib.machinery.SOURCE_SUFFIXES:
|
| 61 |
+
kind = PY_SOURCE
|
| 62 |
+
file = tokenize.open(path)
|
| 63 |
+
elif suffix in importlib.machinery.BYTECODE_SUFFIXES:
|
| 64 |
+
kind = PY_COMPILED
|
| 65 |
+
file = open(path, 'rb')
|
| 66 |
+
elif suffix in importlib.machinery.EXTENSION_SUFFIXES:
|
| 67 |
+
kind = C_EXTENSION
|
| 68 |
+
|
| 69 |
+
else:
|
| 70 |
+
path = None
|
| 71 |
+
suffix = mode = ''
|
| 72 |
+
|
| 73 |
+
return file, path, (suffix, mode, kind)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def get_frozen_object(module, paths=None):
|
| 77 |
+
spec = find_spec(module, paths)
|
| 78 |
+
if not spec:
|
| 79 |
+
raise ImportError(f"Can't find {module}")
|
| 80 |
+
return spec.loader.get_code(module)
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def get_module(module, paths, info):
|
| 84 |
+
spec = find_spec(module, paths)
|
| 85 |
+
if not spec:
|
| 86 |
+
raise ImportError(f"Can't find {module}")
|
| 87 |
+
return module_from_spec(spec)
|
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0/site-packages/setuptools/_importlib.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
|
| 3 |
+
if sys.version_info < (3, 10):
|
| 4 |
+
import importlib_metadata as metadata # pragma: no cover
|
| 5 |
+
else:
|
| 6 |
+
import importlib.metadata as metadata # noqa: F401
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
import importlib.resources as resources # noqa: F401
|