Upload folder using huggingface_hub (part 16)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +9 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/INSTALLER +1 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/METADATA +141 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/RECORD +872 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/WHEEL +5 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/entry_points.txt +51 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/licenses/LICENSE +17 -0
- .venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/top_level.txt +3 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_bdist_dumb.py +78 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_bdist_rpm.py +127 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build.py +49 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_clib.py +134 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_ext.py +628 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_py.py +196 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_scripts.py +96 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_check.py +194 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_clean.py +45 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_cmd.py +107 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_config_cmd.py +87 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_core.py +130 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_dir_util.py +139 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_dist.py +552 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_extension.py +117 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_file_util.py +95 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_filelist.py +336 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install.py +245 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_data.py +74 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_headers.py +33 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_lib.py +110 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_scripts.py +52 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_log.py +12 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_modified.py +126 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_sdist.py +470 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_spawn.py +141 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_sysconfig.py +319 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_text_file.py +127 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_util.py +243 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_version.py +80 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_versionpredicate.py +0 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/tests/unix_compat.py +17 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/text_file.py +286 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.py +9 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/util.py +518 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/version.py +348 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/versionpredicate.py +175 -0
- .venv/lib/python3.12/site-packages/setuptools/_distutils/zosccompiler.py +3 -0
- .venv/lib/python3.12/site-packages/setuptools/_entry_points.py +90 -0
- .venv/lib/python3.12/site-packages/setuptools/_imp.py +87 -0
- .venv/lib/python3.12/site-packages/setuptools/_importlib.py +9 -0
- .venv/lib/python3.12/site-packages/setuptools/_itertools.py +23 -0
.gitattributes
CHANGED
|
@@ -399,3 +399,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 399 |
.venv/lib/python3.12/site-packages/scipy.libs/libquadmath-2284e583.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
|
| 400 |
.venv/lib/python3.12/site-packages/scipy.libs/libquadmath-96973f99-934c22de.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
|
| 401 |
.venv/lib/python3.12/site-packages/scipy.libs/libscipy_openblas-5f890258.so filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
.venv/lib/python3.12/site-packages/scipy.libs/libquadmath-2284e583.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
|
| 400 |
.venv/lib/python3.12/site-packages/scipy.libs/libquadmath-96973f99-934c22de.so.0.0.0 filter=lfs diff=lfs merge=lfs -text
|
| 401 |
.venv/lib/python3.12/site-packages/scipy.libs/libscipy_openblas-5f890258.so filter=lfs diff=lfs merge=lfs -text
|
| 402 |
+
.venv/lib/python3.12/site-packages/setuptools/_vendor/__pycache__/typing_extensions.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 403 |
+
.venv/lib/python3.12/site-packages/setuptools/_vendor/backports/tarfile/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 404 |
+
.venv/lib/python3.12/site-packages/setuptools/_vendor/inflect/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 405 |
+
.venv/lib/python3.12/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 406 |
+
.venv/lib/python3.12/site-packages/setuptools/command/__pycache__/easy_install.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 407 |
+
.venv/lib/python3.12/site-packages/setuptools/config/_validate_pyproject/__pycache__/fastjsonschema_validations.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 408 |
+
.venv/lib/python3.12/site-packages/supervision/annotators/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 409 |
+
.venv/lib/python3.12/site-packages/supervision/detection/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
| 410 |
+
.venv/lib/python3.12/site-packages/sympy/assumptions/tests/__pycache__/test_query.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pip
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: setuptools
|
| 3 |
+
Version: 78.1.0
|
| 4 |
+
Summary: Easily download, build, install, upgrade, and uninstall Python packages
|
| 5 |
+
Author-email: Python Packaging Authority <distutils-sig@python.org>
|
| 6 |
+
Project-URL: Source, https://github.com/pypa/setuptools
|
| 7 |
+
Project-URL: Documentation, https://setuptools.pypa.io/
|
| 8 |
+
Project-URL: Changelog, https://setuptools.pypa.io/en/stable/history.html
|
| 9 |
+
Keywords: CPAN PyPI distutils eggs package management
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Intended Audience :: Developers
|
| 12 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 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: platformdirs>=4.2.2; extra == "core"
|
| 67 |
+
Requires-Dist: jaraco.functools>=4; extra == "core"
|
| 68 |
+
Requires-Dist: more_itertools; extra == "core"
|
| 69 |
+
Provides-Extra: check
|
| 70 |
+
Requires-Dist: pytest-checkdocs>=2.4; extra == "check"
|
| 71 |
+
Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
|
| 72 |
+
Requires-Dist: ruff>=0.8.0; sys_platform != "cygwin" and extra == "check"
|
| 73 |
+
Provides-Extra: cover
|
| 74 |
+
Requires-Dist: pytest-cov; extra == "cover"
|
| 75 |
+
Provides-Extra: enabler
|
| 76 |
+
Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
|
| 77 |
+
Provides-Extra: type
|
| 78 |
+
Requires-Dist: pytest-mypy; extra == "type"
|
| 79 |
+
Requires-Dist: mypy==1.14.*; extra == "type"
|
| 80 |
+
Requires-Dist: importlib_metadata>=7.0.2; python_version < "3.10" and extra == "type"
|
| 81 |
+
Requires-Dist: jaraco.develop>=7.21; sys_platform != "cygwin" and extra == "type"
|
| 82 |
+
Dynamic: license-file
|
| 83 |
+
|
| 84 |
+
.. |pypi-version| image:: https://img.shields.io/pypi/v/setuptools.svg
|
| 85 |
+
:target: https://pypi.org/project/setuptools
|
| 86 |
+
|
| 87 |
+
.. |py-version| image:: https://img.shields.io/pypi/pyversions/setuptools.svg
|
| 88 |
+
|
| 89 |
+
.. |test-badge| image:: https://github.com/pypa/setuptools/actions/workflows/main.yml/badge.svg
|
| 90 |
+
:target: https://github.com/pypa/setuptools/actions?query=workflow%3A%22tests%22
|
| 91 |
+
:alt: tests
|
| 92 |
+
|
| 93 |
+
.. |ruff-badge| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
|
| 94 |
+
:target: https://github.com/astral-sh/ruff
|
| 95 |
+
:alt: Ruff
|
| 96 |
+
|
| 97 |
+
.. |docs-badge| image:: https://img.shields.io/readthedocs/setuptools/latest.svg
|
| 98 |
+
:target: https://setuptools.pypa.io
|
| 99 |
+
|
| 100 |
+
.. |skeleton-badge| image:: https://img.shields.io/badge/skeleton-2025-informational
|
| 101 |
+
:target: https://blog.jaraco.com/skeleton
|
| 102 |
+
|
| 103 |
+
.. |codecov-badge| image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white
|
| 104 |
+
:target: https://codecov.io/gh/pypa/setuptools
|
| 105 |
+
|
| 106 |
+
.. |tidelift-badge| image:: https://tidelift.com/badges/github/pypa/setuptools?style=flat
|
| 107 |
+
:target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme
|
| 108 |
+
|
| 109 |
+
.. |discord-badge| image:: https://img.shields.io/discord/803025117553754132
|
| 110 |
+
:target: https://discord.com/channels/803025117553754132/815945031150993468
|
| 111 |
+
:alt: Discord
|
| 112 |
+
|
| 113 |
+
|pypi-version| |py-version| |test-badge| |ruff-badge| |docs-badge| |skeleton-badge| |codecov-badge| |discord-badge|
|
| 114 |
+
|
| 115 |
+
See the `Quickstart <https://setuptools.pypa.io/en/latest/userguide/quickstart.html>`_
|
| 116 |
+
and the `User's Guide <https://setuptools.pypa.io/en/latest/userguide/>`_ for
|
| 117 |
+
instructions on how to use Setuptools.
|
| 118 |
+
|
| 119 |
+
Questions and comments should be directed to `GitHub Discussions
|
| 120 |
+
<https://github.com/pypa/setuptools/discussions>`_.
|
| 121 |
+
Bug reports and especially tested patches may be
|
| 122 |
+
submitted directly to the `bug tracker
|
| 123 |
+
<https://github.com/pypa/setuptools/issues>`_.
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
Code of Conduct
|
| 127 |
+
===============
|
| 128 |
+
|
| 129 |
+
Everyone interacting in the setuptools project's codebases, issue trackers,
|
| 130 |
+
chat rooms, and fora is expected to follow the
|
| 131 |
+
`PSF Code of Conduct <https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md>`_.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
For Enterprise
|
| 135 |
+
==============
|
| 136 |
+
|
| 137 |
+
Available as part of the Tidelift Subscription.
|
| 138 |
+
|
| 139 |
+
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.
|
| 140 |
+
|
| 141 |
+
`Learn more <https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=referral&utm_campaign=github>`_.
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,872 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_distutils_hack/__init__.py,sha256=34HmvLo07j45Uvd2VR-2aRQ7lJD91sTK6zJgn5fphbQ,6755
|
| 2 |
+
_distutils_hack/__pycache__/__init__.cpython-312.pyc,,
|
| 3 |
+
_distutils_hack/__pycache__/override.cpython-312.pyc,,
|
| 4 |
+
_distutils_hack/override.py,sha256=Eu_s-NF6VIZ4Cqd0tbbA5wtWky2IZPNd8et6GLt1mzo,44
|
| 5 |
+
distutils-precedence.pth,sha256=JjjOniUA5XKl4N5_rtZmHrVp0baW_LoHsN0iPaX10iQ,151
|
| 6 |
+
pkg_resources/__init__.py,sha256=-rh7XOnTxdGuC-_9FAyu5D6s8BL1UsBehxUtj7a-IVo,126203
|
| 7 |
+
pkg_resources/__pycache__/__init__.cpython-312.pyc,,
|
| 8 |
+
pkg_resources/api_tests.txt,sha256=XEdvy4igHHrq2qNHNMHnlfO6XSQKNqOyLHbl6QcpfAI,12595
|
| 9 |
+
pkg_resources/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 10 |
+
pkg_resources/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 11 |
+
pkg_resources/tests/__pycache__/__init__.cpython-312.pyc,,
|
| 12 |
+
pkg_resources/tests/__pycache__/test_find_distributions.cpython-312.pyc,,
|
| 13 |
+
pkg_resources/tests/__pycache__/test_integration_zope_interface.cpython-312.pyc,,
|
| 14 |
+
pkg_resources/tests/__pycache__/test_markers.cpython-312.pyc,,
|
| 15 |
+
pkg_resources/tests/__pycache__/test_pkg_resources.cpython-312.pyc,,
|
| 16 |
+
pkg_resources/tests/__pycache__/test_resources.cpython-312.pyc,,
|
| 17 |
+
pkg_resources/tests/__pycache__/test_working_set.cpython-312.pyc,,
|
| 18 |
+
pkg_resources/tests/data/my-test-package-source/__pycache__/setup.cpython-312.pyc,,
|
| 19 |
+
pkg_resources/tests/data/my-test-package-source/setup.cfg,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 20 |
+
pkg_resources/tests/data/my-test-package-source/setup.py,sha256=1VobhAZbMb7M9mfhb_NE8PwDsvukoWLs9aUAS0pYhe8,105
|
| 21 |
+
pkg_resources/tests/data/my-test-package-zip/my-test-package.zip,sha256=AYRcQ39GVePPnMT8TknP1gdDHyJnXhthESmpAjnzSCI,1809
|
| 22 |
+
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/PKG-INFO,sha256=JvWv9Io2PAuYwEEw2fBW4Qc5YvdbkscpKX1kmLzsoHk,187
|
| 23 |
+
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/SOURCES.txt,sha256=4ClkH8eTovZrdVrJFsVuxdbMEF--lBVSuKonDAPE5Jc,208
|
| 24 |
+
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/dependency_links.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
| 25 |
+
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
| 26 |
+
pkg_resources/tests/data/my-test-package_unpacked-egg/my_test_package-1.0-py3.7.egg/EGG-INFO/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
| 27 |
+
pkg_resources/tests/data/my-test-package_zipped-egg/my_test_package-1.0-py3.7.egg,sha256=ZTlMGxjRGiKDNkiA2c75jbQH2TWIteP00irF9gvczbo,843
|
| 28 |
+
pkg_resources/tests/test_find_distributions.py,sha256=U91cov5L1COAIWLNq3Xy4plU7_MnOE1WtXMu6iV2waM,1972
|
| 29 |
+
pkg_resources/tests/test_integration_zope_interface.py,sha256=nzVoK557KZQN0V3DIQ1sVeaCOgt4Kpl-CODAWsO7pmc,1652
|
| 30 |
+
pkg_resources/tests/test_markers.py,sha256=0orKg7UMDf7fnuNQvRMOc-EF9EAP_JTQnk4mtGgbW50,241
|
| 31 |
+
pkg_resources/tests/test_pkg_resources.py,sha256=5Mt4bJQhLCL8j8cC46Uv32Np2Xc1TTxLGawIfET55Fk,17111
|
| 32 |
+
pkg_resources/tests/test_resources.py,sha256=K0LqMAUGpRQ9pUb9K0vyI7GesvtlQvTH074m-E2VQlo,31252
|
| 33 |
+
pkg_resources/tests/test_working_set.py,sha256=lRtGJWIixSwSMSbjHgRxeJEQiLMRXcz3xzJL2qL7eXY,8602
|
| 34 |
+
setuptools-78.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 35 |
+
setuptools-78.1.0.dist-info/METADATA,sha256=RESmtUmo67AuFzn0N1r3dWyEH5bwwxB3oYMnPHRivRA,6599
|
| 36 |
+
setuptools-78.1.0.dist-info/RECORD,,
|
| 37 |
+
setuptools-78.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
| 38 |
+
setuptools-78.1.0.dist-info/entry_points.txt,sha256=zkgthpf_Fa9NVE9p6FKT3Xk9DR1faAcRU4coggsV7jA,2449
|
| 39 |
+
setuptools-78.1.0.dist-info/licenses/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 40 |
+
setuptools-78.1.0.dist-info/top_level.txt,sha256=d9yL39v_W7qmKDDSH6sT4bE0j_Ls1M3P161OGgdsm4g,41
|
| 41 |
+
setuptools/__init__.py,sha256=AQsMeRFWz9CQ9aBtcSkbB4Dn8t2w86-GPriklpoAjew,10406
|
| 42 |
+
setuptools/__pycache__/__init__.cpython-312.pyc,,
|
| 43 |
+
setuptools/__pycache__/_core_metadata.cpython-312.pyc,,
|
| 44 |
+
setuptools/__pycache__/_entry_points.cpython-312.pyc,,
|
| 45 |
+
setuptools/__pycache__/_imp.cpython-312.pyc,,
|
| 46 |
+
setuptools/__pycache__/_importlib.cpython-312.pyc,,
|
| 47 |
+
setuptools/__pycache__/_itertools.cpython-312.pyc,,
|
| 48 |
+
setuptools/__pycache__/_normalization.cpython-312.pyc,,
|
| 49 |
+
setuptools/__pycache__/_path.cpython-312.pyc,,
|
| 50 |
+
setuptools/__pycache__/_reqs.cpython-312.pyc,,
|
| 51 |
+
setuptools/__pycache__/_shutil.cpython-312.pyc,,
|
| 52 |
+
setuptools/__pycache__/_static.cpython-312.pyc,,
|
| 53 |
+
setuptools/__pycache__/archive_util.cpython-312.pyc,,
|
| 54 |
+
setuptools/__pycache__/build_meta.cpython-312.pyc,,
|
| 55 |
+
setuptools/__pycache__/depends.cpython-312.pyc,,
|
| 56 |
+
setuptools/__pycache__/discovery.cpython-312.pyc,,
|
| 57 |
+
setuptools/__pycache__/dist.cpython-312.pyc,,
|
| 58 |
+
setuptools/__pycache__/errors.cpython-312.pyc,,
|
| 59 |
+
setuptools/__pycache__/extension.cpython-312.pyc,,
|
| 60 |
+
setuptools/__pycache__/glob.cpython-312.pyc,,
|
| 61 |
+
setuptools/__pycache__/installer.cpython-312.pyc,,
|
| 62 |
+
setuptools/__pycache__/launch.cpython-312.pyc,,
|
| 63 |
+
setuptools/__pycache__/logging.cpython-312.pyc,,
|
| 64 |
+
setuptools/__pycache__/modified.cpython-312.pyc,,
|
| 65 |
+
setuptools/__pycache__/monkey.cpython-312.pyc,,
|
| 66 |
+
setuptools/__pycache__/msvc.cpython-312.pyc,,
|
| 67 |
+
setuptools/__pycache__/namespaces.cpython-312.pyc,,
|
| 68 |
+
setuptools/__pycache__/package_index.cpython-312.pyc,,
|
| 69 |
+
setuptools/__pycache__/sandbox.cpython-312.pyc,,
|
| 70 |
+
setuptools/__pycache__/unicode_utils.cpython-312.pyc,,
|
| 71 |
+
setuptools/__pycache__/version.cpython-312.pyc,,
|
| 72 |
+
setuptools/__pycache__/warnings.cpython-312.pyc,,
|
| 73 |
+
setuptools/__pycache__/wheel.cpython-312.pyc,,
|
| 74 |
+
setuptools/__pycache__/windows_support.cpython-312.pyc,,
|
| 75 |
+
setuptools/_core_metadata.py,sha256=T7Tjp-WSoN881adev3R1wzXCPnkDHqbC2MgylN1yjS8,11978
|
| 76 |
+
setuptools/_distutils/__init__.py,sha256=xGYuhWwLG07J0Q49BVnEjPy6wyDcd6veJMDJX7ljlyM,359
|
| 77 |
+
setuptools/_distutils/__pycache__/__init__.cpython-312.pyc,,
|
| 78 |
+
setuptools/_distutils/__pycache__/_log.cpython-312.pyc,,
|
| 79 |
+
setuptools/_distutils/__pycache__/_macos_compat.cpython-312.pyc,,
|
| 80 |
+
setuptools/_distutils/__pycache__/_modified.cpython-312.pyc,,
|
| 81 |
+
setuptools/_distutils/__pycache__/_msvccompiler.cpython-312.pyc,,
|
| 82 |
+
setuptools/_distutils/__pycache__/archive_util.cpython-312.pyc,,
|
| 83 |
+
setuptools/_distutils/__pycache__/ccompiler.cpython-312.pyc,,
|
| 84 |
+
setuptools/_distutils/__pycache__/cmd.cpython-312.pyc,,
|
| 85 |
+
setuptools/_distutils/__pycache__/core.cpython-312.pyc,,
|
| 86 |
+
setuptools/_distutils/__pycache__/cygwinccompiler.cpython-312.pyc,,
|
| 87 |
+
setuptools/_distutils/__pycache__/debug.cpython-312.pyc,,
|
| 88 |
+
setuptools/_distutils/__pycache__/dep_util.cpython-312.pyc,,
|
| 89 |
+
setuptools/_distutils/__pycache__/dir_util.cpython-312.pyc,,
|
| 90 |
+
setuptools/_distutils/__pycache__/dist.cpython-312.pyc,,
|
| 91 |
+
setuptools/_distutils/__pycache__/errors.cpython-312.pyc,,
|
| 92 |
+
setuptools/_distutils/__pycache__/extension.cpython-312.pyc,,
|
| 93 |
+
setuptools/_distutils/__pycache__/fancy_getopt.cpython-312.pyc,,
|
| 94 |
+
setuptools/_distutils/__pycache__/file_util.cpython-312.pyc,,
|
| 95 |
+
setuptools/_distutils/__pycache__/filelist.cpython-312.pyc,,
|
| 96 |
+
setuptools/_distutils/__pycache__/log.cpython-312.pyc,,
|
| 97 |
+
setuptools/_distutils/__pycache__/spawn.cpython-312.pyc,,
|
| 98 |
+
setuptools/_distutils/__pycache__/sysconfig.cpython-312.pyc,,
|
| 99 |
+
setuptools/_distutils/__pycache__/text_file.cpython-312.pyc,,
|
| 100 |
+
setuptools/_distutils/__pycache__/unixccompiler.cpython-312.pyc,,
|
| 101 |
+
setuptools/_distutils/__pycache__/util.cpython-312.pyc,,
|
| 102 |
+
setuptools/_distutils/__pycache__/version.cpython-312.pyc,,
|
| 103 |
+
setuptools/_distutils/__pycache__/versionpredicate.cpython-312.pyc,,
|
| 104 |
+
setuptools/_distutils/__pycache__/zosccompiler.cpython-312.pyc,,
|
| 105 |
+
setuptools/_distutils/_log.py,sha256=i-lNTTcXS8TmWITJ6DODGvtW5z5tMattJQ76h8rZxQU,42
|
| 106 |
+
setuptools/_distutils/_macos_compat.py,sha256=JzUGhF4E5yIITHbUaPobZEWjGHdrrcNV63z86S4RjBc,239
|
| 107 |
+
setuptools/_distutils/_modified.py,sha256=RF1n1CexyDYV3lvGbeXS0s-XCJVboDOIUbA8wEQqYTY,3211
|
| 108 |
+
setuptools/_distutils/_msvccompiler.py,sha256=9PSfSHxvJnHnQL6Sqz4Xcz7iaBIT62p6BheQzGsSlwo,335
|
| 109 |
+
setuptools/_distutils/archive_util.py,sha256=Qw2z-Pt-NV8lNUQrzjs3XDGWCWHMPnqHLyt8TiD2XEA,8884
|
| 110 |
+
setuptools/_distutils/ccompiler.py,sha256=FKVjqzGJ7c-FtouNjhLiaMPm5LKMZHHAruXf8LU216c,524
|
| 111 |
+
setuptools/_distutils/cmd.py,sha256=hXtaRaH7QBnfNOIqEvCt47iwZzD9MVvBdhhdQctHsxM,22186
|
| 112 |
+
setuptools/_distutils/command/__init__.py,sha256=GfFAzbBqk1qxSH4BdaKioKS4hRRnD44BAmwEN85C4u8,386
|
| 113 |
+
setuptools/_distutils/command/__pycache__/__init__.cpython-312.pyc,,
|
| 114 |
+
setuptools/_distutils/command/__pycache__/_framework_compat.cpython-312.pyc,,
|
| 115 |
+
setuptools/_distutils/command/__pycache__/bdist.cpython-312.pyc,,
|
| 116 |
+
setuptools/_distutils/command/__pycache__/bdist_dumb.cpython-312.pyc,,
|
| 117 |
+
setuptools/_distutils/command/__pycache__/bdist_rpm.cpython-312.pyc,,
|
| 118 |
+
setuptools/_distutils/command/__pycache__/build.cpython-312.pyc,,
|
| 119 |
+
setuptools/_distutils/command/__pycache__/build_clib.cpython-312.pyc,,
|
| 120 |
+
setuptools/_distutils/command/__pycache__/build_ext.cpython-312.pyc,,
|
| 121 |
+
setuptools/_distutils/command/__pycache__/build_py.cpython-312.pyc,,
|
| 122 |
+
setuptools/_distutils/command/__pycache__/build_scripts.cpython-312.pyc,,
|
| 123 |
+
setuptools/_distutils/command/__pycache__/check.cpython-312.pyc,,
|
| 124 |
+
setuptools/_distutils/command/__pycache__/clean.cpython-312.pyc,,
|
| 125 |
+
setuptools/_distutils/command/__pycache__/config.cpython-312.pyc,,
|
| 126 |
+
setuptools/_distutils/command/__pycache__/install.cpython-312.pyc,,
|
| 127 |
+
setuptools/_distutils/command/__pycache__/install_data.cpython-312.pyc,,
|
| 128 |
+
setuptools/_distutils/command/__pycache__/install_egg_info.cpython-312.pyc,,
|
| 129 |
+
setuptools/_distutils/command/__pycache__/install_headers.cpython-312.pyc,,
|
| 130 |
+
setuptools/_distutils/command/__pycache__/install_lib.cpython-312.pyc,,
|
| 131 |
+
setuptools/_distutils/command/__pycache__/install_scripts.cpython-312.pyc,,
|
| 132 |
+
setuptools/_distutils/command/__pycache__/sdist.cpython-312.pyc,,
|
| 133 |
+
setuptools/_distutils/command/_framework_compat.py,sha256=0iZdSJYzGRWCCvzRDKE-R0-_yaAYvFMd1ylXb2eYXug,1609
|
| 134 |
+
setuptools/_distutils/command/bdist.py,sha256=jWtk61R7fWNUUNxJV0thTZzU5n80L3Ay1waSiP9kiLA,5854
|
| 135 |
+
setuptools/_distutils/command/bdist_dumb.py,sha256=Hx1jAqoZNxYIy4N5TLzUp6J5fi8Ls18py7UlLNFhO2E,4631
|
| 136 |
+
setuptools/_distutils/command/bdist_rpm.py,sha256=nxcXXv5a7B-1ntWu4DbGmCtES4EBINrJaBQcRNAYCJI,21785
|
| 137 |
+
setuptools/_distutils/command/build.py,sha256=SpHlagf0iNaKVyIhxDfhPFZ8X1-LAWOCQACy-yt2K0w,5923
|
| 138 |
+
setuptools/_distutils/command/build_clib.py,sha256=aMqZcUfCbOAu_xr-A9iW-Q9YZHzpDGLRTezOgMQJmSQ,7777
|
| 139 |
+
setuptools/_distutils/command/build_ext.py,sha256=zrrsu9HXnzV6bXYbJuZCK4SwVZMjKnl4pG1o3bNcxtc,32710
|
| 140 |
+
setuptools/_distutils/command/build_py.py,sha256=Vfq-INemoMbg6f003BTy_Ufp8bjOZhmFIhpKMcfXLgs,16696
|
| 141 |
+
setuptools/_distutils/command/build_scripts.py,sha256=tUpEzwTsnrP8qrNory3ldPB240QDCFkMp-pdYPs2wTk,5118
|
| 142 |
+
setuptools/_distutils/command/check.py,sha256=yoNe2MPY4JcTM7rwoIQdfZ75q5Ri058I2coi-Gq9CjM,4946
|
| 143 |
+
setuptools/_distutils/command/clean.py,sha256=dQAacOabwBXU9JoZ-1GFusq3eFltDaeXJFSYncqGbvE,2644
|
| 144 |
+
setuptools/_distutils/command/config.py,sha256=BuUdPu91Vo9w44xzD1RQfiyXfSfVcNpeX3aeoKcGAOw,12818
|
| 145 |
+
setuptools/_distutils/command/install.py,sha256=-JenB-mua4hc2RI_-W8F9PnP_J-OaFO7E0PJGKxLo1o,30072
|
| 146 |
+
setuptools/_distutils/command/install_data.py,sha256=GzBlUWWKubTYJlP-L0auUriq9cL-5RKOcoyHTttKj0Q,2875
|
| 147 |
+
setuptools/_distutils/command/install_egg_info.py,sha256=ffiLoU1ivQJ8q2_WL7ZygZbUcOsgdFLKL7otEIJWWkI,2868
|
| 148 |
+
setuptools/_distutils/command/install_headers.py,sha256=5ciKCj8c3XKsYNKdkdMvnypaUCKcoWCDeeZij3fD-Z4,1272
|
| 149 |
+
setuptools/_distutils/command/install_lib.py,sha256=2s9-m5-b1qKm51F28lB5L39Z6vv_GHMlv9dNBSupok0,8588
|
| 150 |
+
setuptools/_distutils/command/install_scripts.py,sha256=M0pPdiaqB7TGmqTMujpGGeiL0Iq_CTeGjMFtrmDmwzM,2002
|
| 151 |
+
setuptools/_distutils/command/sdist.py,sha256=cRIF6Ht1hJ6ayOOFVycMFBUNxjo94e_rFYPx4Hi8Ahc,19151
|
| 152 |
+
setuptools/_distutils/compat/__init__.py,sha256=J20aXGjJ86Rg41xFLIWlcWCgZ9edMdJ9vvdNEQ87vPQ,522
|
| 153 |
+
setuptools/_distutils/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 154 |
+
setuptools/_distutils/compat/__pycache__/numpy.cpython-312.pyc,,
|
| 155 |
+
setuptools/_distutils/compat/__pycache__/py39.cpython-312.pyc,,
|
| 156 |
+
setuptools/_distutils/compat/numpy.py,sha256=UFgneZw9w97g4c-yGoAIOyLxUOWQ-fPRIhhfMs7_Ouc,167
|
| 157 |
+
setuptools/_distutils/compat/py39.py,sha256=hOsD6lwZLqZoMnacNJ3P6nUA-LJQhEpVtYTzVH0o96M,1964
|
| 158 |
+
setuptools/_distutils/compilers/C/__pycache__/base.cpython-312.pyc,,
|
| 159 |
+
setuptools/_distutils/compilers/C/__pycache__/cygwin.cpython-312.pyc,,
|
| 160 |
+
setuptools/_distutils/compilers/C/__pycache__/errors.cpython-312.pyc,,
|
| 161 |
+
setuptools/_distutils/compilers/C/__pycache__/msvc.cpython-312.pyc,,
|
| 162 |
+
setuptools/_distutils/compilers/C/__pycache__/unix.cpython-312.pyc,,
|
| 163 |
+
setuptools/_distutils/compilers/C/__pycache__/zos.cpython-312.pyc,,
|
| 164 |
+
setuptools/_distutils/compilers/C/base.py,sha256=XR1rBCStCquqm7QOYXD41-LfvsFcPpGxrwxeXzJyn_w,54876
|
| 165 |
+
setuptools/_distutils/compilers/C/cygwin.py,sha256=DUlwQSb55aj7OdcmcddrmCmVEjEaxIiJ5hHUO3GBPNs,11844
|
| 166 |
+
setuptools/_distutils/compilers/C/errors.py,sha256=sKOVzJajMUmNdfywo9UM_QQGsKFcclDhtI5TlCiXMLc,573
|
| 167 |
+
setuptools/_distutils/compilers/C/msvc.py,sha256=elzG8v9jN5QytLMwLCdUdSuZ3eZ3R98VUvnm9Y2PBCA,21404
|
| 168 |
+
setuptools/_distutils/compilers/C/tests/__pycache__/test_base.cpython-312.pyc,,
|
| 169 |
+
setuptools/_distutils/compilers/C/tests/__pycache__/test_cygwin.cpython-312.pyc,,
|
| 170 |
+
setuptools/_distutils/compilers/C/tests/__pycache__/test_mingw.cpython-312.pyc,,
|
| 171 |
+
setuptools/_distutils/compilers/C/tests/__pycache__/test_msvc.cpython-312.pyc,,
|
| 172 |
+
setuptools/_distutils/compilers/C/tests/__pycache__/test_unix.cpython-312.pyc,,
|
| 173 |
+
setuptools/_distutils/compilers/C/tests/test_base.py,sha256=rdhHc56bhXtm5NnN9BSHwr6c69UqzMItZQzlw2AsdMc,2706
|
| 174 |
+
setuptools/_distutils/compilers/C/tests/test_cygwin.py,sha256=UgV2VgUXj3VulcbDc0UBWfEyJDx42tgSwS4LzHix3mY,2701
|
| 175 |
+
setuptools/_distutils/compilers/C/tests/test_mingw.py,sha256=hCmwyywISpRoyOySbFHBL4TprWRV0mUWDKmOLO8XBXE,1900
|
| 176 |
+
setuptools/_distutils/compilers/C/tests/test_msvc.py,sha256=DlGjmZ1mBSMXIgmlu80BKc7V-EJOZuYucwJwFh5dn28,4151
|
| 177 |
+
setuptools/_distutils/compilers/C/tests/test_unix.py,sha256=ErbYWio7ejY2ZqQmPk4AwOu1HFW4-_-aZdUvGa1W2Fw,11834
|
| 178 |
+
setuptools/_distutils/compilers/C/unix.py,sha256=l7CxY4rDJAECJo-vcv6io0SBmmPJ9JmN5mSmZcin2VU,16502
|
| 179 |
+
setuptools/_distutils/compilers/C/zos.py,sha256=vnNeWLRZkdIkdZ-YyBnL8idTUfcCOn0tLMW5OBJ0ScU,6586
|
| 180 |
+
setuptools/_distutils/core.py,sha256=GEHKaFC48T3o-_SmH4864GvKyx1IgbVC6ISIPVlx7a4,9364
|
| 181 |
+
setuptools/_distutils/cygwinccompiler.py,sha256=mG_cU8SVZ4amD_VtF5vH6BXP0-kghGsDPbDSXrQ963c,594
|
| 182 |
+
setuptools/_distutils/debug.py,sha256=N6MrTAqK6l9SVk6tWweR108PM8Ol7qNlfyV-nHcLhsY,139
|
| 183 |
+
setuptools/_distutils/dep_util.py,sha256=xN75p6ZpHhMiHEc-rpL2XilJQynHnDNiafHteaZ4tjU,349
|
| 184 |
+
setuptools/_distutils/dir_util.py,sha256=DXPUlfVVGsg9B-Jgg4At_j9T7vM60OgwNXkQHqTo7-I,7236
|
| 185 |
+
setuptools/_distutils/dist.py,sha256=gW598UE0WMkzXQQ31Nr-8L7MPw0oIOz5OSSRzYZlwrM,55794
|
| 186 |
+
setuptools/_distutils/errors.py,sha256=PPE2oDRh5y9Q1beKK9rhdvDaCzQhi4HCXs4KcqfqgZY,3092
|
| 187 |
+
setuptools/_distutils/extension.py,sha256=Foyu4gULcPqm1_U9zrYYHxNk4NqglXv1rbsOk_QrSds,11155
|
| 188 |
+
setuptools/_distutils/fancy_getopt.py,sha256=PjdO-bWCW0imV_UN-MGEw9R2GP2OiE8pHjITgmTAY3Q,17895
|
| 189 |
+
setuptools/_distutils/file_util.py,sha256=YFQL_pD3hLuER9II_H6-hDC_YIGEookdd4wedLuiTW0,7978
|
| 190 |
+
setuptools/_distutils/filelist.py,sha256=MBeSRJmPcKmDv8ooZgSU4BiQPZ0Khwv8l_jhD50XycI,15337
|
| 191 |
+
setuptools/_distutils/log.py,sha256=VyBs5j7z4-K6XTEEBThUc9HyMpoPLGtQpERqbz5ylww,1200
|
| 192 |
+
setuptools/_distutils/spawn.py,sha256=zseCh9sEifyp0I5Vg719JNIASlROJ2ehXqQnHlpt89Q,4086
|
| 193 |
+
setuptools/_distutils/sysconfig.py,sha256=KeI8OHbMuEzHJ8Q0cBez9KZny8iRy6Z6Y0AkMz1jlsU,19728
|
| 194 |
+
setuptools/_distutils/tests/__init__.py,sha256=j-IoPZEtQv3EOPuqNTwalr6GLyRjzCC-OOaNvZzmHsI,1485
|
| 195 |
+
setuptools/_distutils/tests/__pycache__/__init__.cpython-312.pyc,,
|
| 196 |
+
setuptools/_distutils/tests/__pycache__/support.cpython-312.pyc,,
|
| 197 |
+
setuptools/_distutils/tests/__pycache__/test_archive_util.cpython-312.pyc,,
|
| 198 |
+
setuptools/_distutils/tests/__pycache__/test_bdist.cpython-312.pyc,,
|
| 199 |
+
setuptools/_distutils/tests/__pycache__/test_bdist_dumb.cpython-312.pyc,,
|
| 200 |
+
setuptools/_distutils/tests/__pycache__/test_bdist_rpm.cpython-312.pyc,,
|
| 201 |
+
setuptools/_distutils/tests/__pycache__/test_build.cpython-312.pyc,,
|
| 202 |
+
setuptools/_distutils/tests/__pycache__/test_build_clib.cpython-312.pyc,,
|
| 203 |
+
setuptools/_distutils/tests/__pycache__/test_build_ext.cpython-312.pyc,,
|
| 204 |
+
setuptools/_distutils/tests/__pycache__/test_build_py.cpython-312.pyc,,
|
| 205 |
+
setuptools/_distutils/tests/__pycache__/test_build_scripts.cpython-312.pyc,,
|
| 206 |
+
setuptools/_distutils/tests/__pycache__/test_check.cpython-312.pyc,,
|
| 207 |
+
setuptools/_distutils/tests/__pycache__/test_clean.cpython-312.pyc,,
|
| 208 |
+
setuptools/_distutils/tests/__pycache__/test_cmd.cpython-312.pyc,,
|
| 209 |
+
setuptools/_distutils/tests/__pycache__/test_config_cmd.cpython-312.pyc,,
|
| 210 |
+
setuptools/_distutils/tests/__pycache__/test_core.cpython-312.pyc,,
|
| 211 |
+
setuptools/_distutils/tests/__pycache__/test_dir_util.cpython-312.pyc,,
|
| 212 |
+
setuptools/_distutils/tests/__pycache__/test_dist.cpython-312.pyc,,
|
| 213 |
+
setuptools/_distutils/tests/__pycache__/test_extension.cpython-312.pyc,,
|
| 214 |
+
setuptools/_distutils/tests/__pycache__/test_file_util.cpython-312.pyc,,
|
| 215 |
+
setuptools/_distutils/tests/__pycache__/test_filelist.cpython-312.pyc,,
|
| 216 |
+
setuptools/_distutils/tests/__pycache__/test_install.cpython-312.pyc,,
|
| 217 |
+
setuptools/_distutils/tests/__pycache__/test_install_data.cpython-312.pyc,,
|
| 218 |
+
setuptools/_distutils/tests/__pycache__/test_install_headers.cpython-312.pyc,,
|
| 219 |
+
setuptools/_distutils/tests/__pycache__/test_install_lib.cpython-312.pyc,,
|
| 220 |
+
setuptools/_distutils/tests/__pycache__/test_install_scripts.cpython-312.pyc,,
|
| 221 |
+
setuptools/_distutils/tests/__pycache__/test_log.cpython-312.pyc,,
|
| 222 |
+
setuptools/_distutils/tests/__pycache__/test_modified.cpython-312.pyc,,
|
| 223 |
+
setuptools/_distutils/tests/__pycache__/test_sdist.cpython-312.pyc,,
|
| 224 |
+
setuptools/_distutils/tests/__pycache__/test_spawn.cpython-312.pyc,,
|
| 225 |
+
setuptools/_distutils/tests/__pycache__/test_sysconfig.cpython-312.pyc,,
|
| 226 |
+
setuptools/_distutils/tests/__pycache__/test_text_file.cpython-312.pyc,,
|
| 227 |
+
setuptools/_distutils/tests/__pycache__/test_util.cpython-312.pyc,,
|
| 228 |
+
setuptools/_distutils/tests/__pycache__/test_version.cpython-312.pyc,,
|
| 229 |
+
setuptools/_distutils/tests/__pycache__/test_versionpredicate.cpython-312.pyc,,
|
| 230 |
+
setuptools/_distutils/tests/__pycache__/unix_compat.cpython-312.pyc,,
|
| 231 |
+
setuptools/_distutils/tests/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 232 |
+
setuptools/_distutils/tests/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 233 |
+
setuptools/_distutils/tests/compat/__pycache__/py39.cpython-312.pyc,,
|
| 234 |
+
setuptools/_distutils/tests/compat/py39.py,sha256=t0GBTM-30jX-9zCfkwlNBFtzzabemx6065mJ0d9_VRw,1026
|
| 235 |
+
setuptools/_distutils/tests/support.py,sha256=tjsYsyxvpTK4NrkCseh2ujvDIGV0Mf_b5SI5fP2T0yM,4099
|
| 236 |
+
setuptools/_distutils/tests/test_archive_util.py,sha256=jozimSwPBF-JoJfN_vDaiVGZp66BNcWZGh34FlW57DQ,11787
|
| 237 |
+
setuptools/_distutils/tests/test_bdist.py,sha256=xNHxUsLlHsZQRwkzLb_iSD24s-9Mk-NX2ffBWwOyPyc,1396
|
| 238 |
+
setuptools/_distutils/tests/test_bdist_dumb.py,sha256=QF05MHNhPOdZyh88Xpw8KsO64s7pRFkl8KL-RoV4XK0,2247
|
| 239 |
+
setuptools/_distutils/tests/test_bdist_rpm.py,sha256=Hdm-pwWgyaoGdGbEcGZa8cRhGU45y8gHK8umOanTjik,3932
|
| 240 |
+
setuptools/_distutils/tests/test_build.py,sha256=JJY5XpOZco25ZY0pstxl-iI8mHsWP0ujf5o8aOtuZYY,1742
|
| 241 |
+
setuptools/_distutils/tests/test_build_clib.py,sha256=Mo1ZFb4C1VXBYOGvnallwN7YCnTtr24akLDO8Zi4CsY,4331
|
| 242 |
+
setuptools/_distutils/tests/test_build_ext.py,sha256=QFO9qYVhWWdJu17HXc4x9RMnLZlhk0lAHi9HVppbuX4,22545
|
| 243 |
+
setuptools/_distutils/tests/test_build_py.py,sha256=NsfmRrojOHBXNMqWR_mp5g4PLTgjhD7iZFUffGZFIdw,6882
|
| 244 |
+
setuptools/_distutils/tests/test_build_scripts.py,sha256=cD-FRy-oX55sXRX5Ez5xQCaeHrWajyKc4Xuwv2fe48w,2880
|
| 245 |
+
setuptools/_distutils/tests/test_check.py,sha256=hHSV07qf7YoSxGsTbbsUQ9tssZz5RRNdbrY1s2SwaFI,6226
|
| 246 |
+
setuptools/_distutils/tests/test_clean.py,sha256=hPH6jfIpGFUrvWbF1txkiNVSNaAxt2wq5XjV499zO4E,1240
|
| 247 |
+
setuptools/_distutils/tests/test_cmd.py,sha256=bgRB79mitoOKR1OiyZHnCogvGxt3pWkxeTqIC04lQWQ,3254
|
| 248 |
+
setuptools/_distutils/tests/test_config_cmd.py,sha256=Zs6WX0IfxDvmuC19XzuVNnYCnTr9Y-hl73TAmDSBN4Y,2664
|
| 249 |
+
setuptools/_distutils/tests/test_core.py,sha256=L7XKVAxa-MGoAZeANopnuK9fRKneYhkSQpgw8XQvcF8,3829
|
| 250 |
+
setuptools/_distutils/tests/test_dir_util.py,sha256=E84lC-k4riVUwURyWaQ0Jqx2ui2-io-0RuJa3M7qkJs,4500
|
| 251 |
+
setuptools/_distutils/tests/test_dist.py,sha256=a6wlc5fQJd5qQ6HOndzcupNhjTxvj6-_JLtpuYvaP1M,18793
|
| 252 |
+
setuptools/_distutils/tests/test_extension.py,sha256=-YejLgZCuycFrOBd64pVH0JvwMc9NwhzHvQxvvjXHqk,3670
|
| 253 |
+
setuptools/_distutils/tests/test_file_util.py,sha256=livjnl3FkilQlrB2rFdFQq9nvjEVZHynNya0bfzv_b4,3522
|
| 254 |
+
setuptools/_distutils/tests/test_filelist.py,sha256=rJwkqCUfkGDgWlD22TozsT8ycbupMHB8DXqThzwT1T4,10766
|
| 255 |
+
setuptools/_distutils/tests/test_install.py,sha256=TfCB0ykhIxydIC2Q4SuTAZzSHvteMHgrBL9whoSgK9Q,8618
|
| 256 |
+
setuptools/_distutils/tests/test_install_data.py,sha256=vKq3K97k0hBAnOg38nmwEdf7cEDVr9rTVyCeJolgb4A,2464
|
| 257 |
+
setuptools/_distutils/tests/test_install_headers.py,sha256=PVAYpo_tYl980Qf64DPOmmSvyefIHdU06f7VsJeZykE,936
|
| 258 |
+
setuptools/_distutils/tests/test_install_lib.py,sha256=qri6Rl-maNTQrNDV8DbeXNl0hjsfRIKiI4rfZLrmWBI,3612
|
| 259 |
+
setuptools/_distutils/tests/test_install_scripts.py,sha256=KE3v0cDkFW-90IOID-OmZZGM2mhy-ZkEuuW7UXS2SHw,1600
|
| 260 |
+
setuptools/_distutils/tests/test_log.py,sha256=isFtOufloCyEdZaQOV7cVUr46GwtdVMj43mGBB5XH7k,323
|
| 261 |
+
setuptools/_distutils/tests/test_modified.py,sha256=h1--bOWmtJo1bpVV6uRhdnS9br71CBiNDM1MDwSGpug,4221
|
| 262 |
+
setuptools/_distutils/tests/test_sdist.py,sha256=cfzUhlCA418-1vH9ta3IBs26c_jUBbkJoFOK5GnAyNk,15062
|
| 263 |
+
setuptools/_distutils/tests/test_spawn.py,sha256=eS8w9D7bTxyFLSyRahJWeuh8Kc1F8RWWiY_dSG5B5Bc,4803
|
| 264 |
+
setuptools/_distutils/tests/test_sysconfig.py,sha256=lxM8LsUi1TomjDV4HoYK8u5nUoBkeNL60Uq8PY1DcwU,11986
|
| 265 |
+
setuptools/_distutils/tests/test_text_file.py,sha256=WQWSB5AfdBDZaMA8BFgipJPnsJb_2SKMfL90fSkRVtw,3460
|
| 266 |
+
setuptools/_distutils/tests/test_util.py,sha256=H9zlZ4z4Vh4TfjNYDBsxP7wguQLpxCfJYyOcm1yZU3c,7988
|
| 267 |
+
setuptools/_distutils/tests/test_version.py,sha256=ahfg_mP8wRy1sgwY-_Px5hrjgf6_upTIpnCgpR4yWRk,2750
|
| 268 |
+
setuptools/_distutils/tests/test_versionpredicate.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 269 |
+
setuptools/_distutils/tests/unix_compat.py,sha256=z-op6C2iVdX1aq5BIBR7cqOxijKE97alNwJqHNdLpoI,386
|
| 270 |
+
setuptools/_distutils/text_file.py,sha256=z4dkOJBr9Bo2LG0TNqm8sD63LEEaKSSP0J0bWBrFG3c,12101
|
| 271 |
+
setuptools/_distutils/unixccompiler.py,sha256=1bXJWH4fiu_A2WfriHzf88xjllQTXnnjUkZdRKs9cWU,212
|
| 272 |
+
setuptools/_distutils/util.py,sha256=Njfnqk60zMdkiAjRnGcTWX3t49-obHapOlbNvyIl02I,18094
|
| 273 |
+
setuptools/_distutils/version.py,sha256=vImT5-ECXkQ21oKL0XYFiTqK6NyM09cpzBNoA_34CQU,12619
|
| 274 |
+
setuptools/_distutils/versionpredicate.py,sha256=qBWQ6wTj12ODytoTmIydefIY2jb4uY1sdbgbuLn-IJM,5205
|
| 275 |
+
setuptools/_distutils/zosccompiler.py,sha256=svdiXZ2kdcwKrJKfhUhib03y8gz7aGZKukXH3I7YkBc,58
|
| 276 |
+
setuptools/_entry_points.py,sha256=Y3QUE9JKFW_YyquDnpffNWSs6f3jKEt1e-dnx--9-Kw,2310
|
| 277 |
+
setuptools/_imp.py,sha256=YY1EjZEN-0zYci1cxO10B_adAEOr7i8eK8JoCc9Ierc,2435
|
| 278 |
+
setuptools/_importlib.py,sha256=aKIjcK0HKXNz2D-XTrxaixGn_juTkONwmu3dcheMOF0,223
|
| 279 |
+
setuptools/_itertools.py,sha256=jWRfsIrpC7myooz3hDURj9GtvpswZeKXg2HakmEhNjo,657
|
| 280 |
+
setuptools/_normalization.py,sha256=kAmGfrwjF5djydEfLLyKgjkXCbL_0_ZxUPO-DlLlmIY,5824
|
| 281 |
+
setuptools/_path.py,sha256=cPv41v03HD7uEYqCIo-E_cGRfpPVr4lywBCiK-HSrCg,2685
|
| 282 |
+
setuptools/_reqs.py,sha256=QI3C9uOBSNRccu208qPnixHx51nxCry7_nPTIJaSYxM,1438
|
| 283 |
+
setuptools/_shutil.py,sha256=cAOllcoyMTXs5JLoybQi29yI5gABk82hepJyOBv2bMw,1496
|
| 284 |
+
setuptools/_static.py,sha256=GTR79gESF1_JaK4trLkpDrEuCeEtPlwQW0MRv7VNQX4,4855
|
| 285 |
+
setuptools/_vendor/__pycache__/typing_extensions.cpython-312.pyc,,
|
| 286 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 287 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE,sha256=reeNBJgtaZctREqOFKlPh6IzTdOFXMgDSOqOJAqg3y0,7634
|
| 288 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA,sha256=OADZuR3O6iBlpu1ieTgzYul6w4uOVrk0P0BO5TGGAJk,15006
|
| 289 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/RECORD,sha256=giu6ZrQVJvpUcYa4AiH4XaUNZSvuVJPb_l0UCFES8MM,1308
|
| 290 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
| 291 |
+
setuptools/_vendor/autocommand-2.2.2.dist-info/top_level.txt,sha256=AzfhgKKS8EdAwWUTSF8mgeVQbXOY9kokHB6kSqwwqu0,12
|
| 292 |
+
setuptools/_vendor/autocommand/__init__.py,sha256=zko5Rnvolvb-UXjCx_2ArPTGBWwUK5QY4LIQIKYR7As,1037
|
| 293 |
+
setuptools/_vendor/autocommand/__pycache__/__init__.cpython-312.pyc,,
|
| 294 |
+
setuptools/_vendor/autocommand/__pycache__/autoasync.cpython-312.pyc,,
|
| 295 |
+
setuptools/_vendor/autocommand/__pycache__/autocommand.cpython-312.pyc,,
|
| 296 |
+
setuptools/_vendor/autocommand/__pycache__/automain.cpython-312.pyc,,
|
| 297 |
+
setuptools/_vendor/autocommand/__pycache__/autoparse.cpython-312.pyc,,
|
| 298 |
+
setuptools/_vendor/autocommand/__pycache__/errors.cpython-312.pyc,,
|
| 299 |
+
setuptools/_vendor/autocommand/autoasync.py,sha256=AMdyrxNS4pqWJfP_xuoOcImOHWD-qT7x06wmKN1Vp-U,5680
|
| 300 |
+
setuptools/_vendor/autocommand/autocommand.py,sha256=hmkEmQ72HtL55gnURVjDOnsfYlGd5lLXbvT4KG496Qw,2505
|
| 301 |
+
setuptools/_vendor/autocommand/automain.py,sha256=A2b8i754Mxc_DjU9WFr6vqYDWlhz0cn8miu8d8EsxV8,2076
|
| 302 |
+
setuptools/_vendor/autocommand/autoparse.py,sha256=WVWmZJPcbzUKXP40raQw_0HD8qPJ2V9VG1eFFmmnFxw,11642
|
| 303 |
+
setuptools/_vendor/autocommand/errors.py,sha256=7aa3roh9Herd6nIKpQHNWEslWE8oq7GiHYVUuRqORnA,886
|
| 304 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 305 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 306 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA,sha256=ghXFTq132dxaEIolxr3HK1mZqm9iyUmaRANZQSr6WlE,2020
|
| 307 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/RECORD,sha256=JYofHISeEXUGmlWl1s41ev3QTjTNXeJwk-Ss7HqdLOE,1360
|
| 308 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 309 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 310 |
+
setuptools/_vendor/backports.tarfile-1.2.0.dist-info/top_level.txt,sha256=cGjaLMOoBR1FK0ApojtzWVmViTtJ7JGIK_HwXiEsvtU,10
|
| 311 |
+
setuptools/_vendor/backports/__init__.py,sha256=iOEMwnlORWezdO8-2vxBIPSR37D7JGjluZ8f55vzxls,81
|
| 312 |
+
setuptools/_vendor/backports/__pycache__/__init__.cpython-312.pyc,,
|
| 313 |
+
setuptools/_vendor/backports/tarfile/__init__.py,sha256=Pwf2qUIfB0SolJPCKcx3vz3UEu_aids4g4sAfxy94qg,108491
|
| 314 |
+
setuptools/_vendor/backports/tarfile/__main__.py,sha256=Yw2oGT1afrz2eBskzdPYL8ReB_3liApmhFkN2EbDmc4,59
|
| 315 |
+
setuptools/_vendor/backports/tarfile/__pycache__/__init__.cpython-312.pyc,,
|
| 316 |
+
setuptools/_vendor/backports/tarfile/__pycache__/__main__.cpython-312.pyc,,
|
| 317 |
+
setuptools/_vendor/backports/tarfile/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 318 |
+
setuptools/_vendor/backports/tarfile/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 319 |
+
setuptools/_vendor/backports/tarfile/compat/__pycache__/py38.cpython-312.pyc,,
|
| 320 |
+
setuptools/_vendor/backports/tarfile/compat/py38.py,sha256=iYkyt_gvWjLzGUTJD9TuTfMMjOk-ersXZmRlvQYN2qE,568
|
| 321 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 322 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
| 323 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/METADATA,sha256=anuQ7_7h4J1bSEzfcjIBakPi2cyVQ7y7jklLHsBeH1k,4648
|
| 324 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/RECORD,sha256=DY08buueu-hsrH1ghhVSQzwynanqUSSLYdAr4uXmQDA,2518
|
| 325 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 326 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
| 327 |
+
setuptools/_vendor/importlib_metadata-8.0.0.dist-info/top_level.txt,sha256=CO3fD9yylANiXkrMo4qHLV_mqXL2sC5JFKgt1yWAT-A,19
|
| 328 |
+
setuptools/_vendor/importlib_metadata/__init__.py,sha256=tZNB-23h8Bixi9uCrQqj9Yf0aeC--Josdy3IZRIQeB0,33798
|
| 329 |
+
setuptools/_vendor/importlib_metadata/__pycache__/__init__.cpython-312.pyc,,
|
| 330 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_adapters.cpython-312.pyc,,
|
| 331 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_collections.cpython-312.pyc,,
|
| 332 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_compat.cpython-312.pyc,,
|
| 333 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_functools.cpython-312.pyc,,
|
| 334 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_itertools.cpython-312.pyc,,
|
| 335 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_meta.cpython-312.pyc,,
|
| 336 |
+
setuptools/_vendor/importlib_metadata/__pycache__/_text.cpython-312.pyc,,
|
| 337 |
+
setuptools/_vendor/importlib_metadata/__pycache__/diagnose.cpython-312.pyc,,
|
| 338 |
+
setuptools/_vendor/importlib_metadata/_adapters.py,sha256=rIhWTwBvYA1bV7i-5FfVX38qEXDTXFeS5cb5xJtP3ks,2317
|
| 339 |
+
setuptools/_vendor/importlib_metadata/_collections.py,sha256=CJ0OTCHIjWA0ZIVS4voORAsn2R4R2cQBEtPsZEJpASY,743
|
| 340 |
+
setuptools/_vendor/importlib_metadata/_compat.py,sha256=73QKrN9KNoaZzhbX5yPCCZa-FaALwXe8TPlDR72JgBU,1314
|
| 341 |
+
setuptools/_vendor/importlib_metadata/_functools.py,sha256=PsY2-4rrKX4RVeRC1oGp1lB1pmC9eKN88_f-bD9uOoA,2895
|
| 342 |
+
setuptools/_vendor/importlib_metadata/_itertools.py,sha256=cvr_2v8BRbxcIl5x5ldfqdHjhI8Yi8s8yk50G_nm6jQ,2068
|
| 343 |
+
setuptools/_vendor/importlib_metadata/_meta.py,sha256=nxZ7C8GVlcBFAKWyVOn_dn7ot_twBcbm1NmvjIetBHI,1801
|
| 344 |
+
setuptools/_vendor/importlib_metadata/_text.py,sha256=HCsFksZpJLeTP3NEk_ngrAeXVRRtTrtyh9eOABoRP4A,2166
|
| 345 |
+
setuptools/_vendor/importlib_metadata/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 346 |
+
setuptools/_vendor/importlib_metadata/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 347 |
+
setuptools/_vendor/importlib_metadata/compat/__pycache__/py311.cpython-312.pyc,,
|
| 348 |
+
setuptools/_vendor/importlib_metadata/compat/__pycache__/py39.cpython-312.pyc,,
|
| 349 |
+
setuptools/_vendor/importlib_metadata/compat/py311.py,sha256=uqm-K-uohyj1042TH4a9Er_I5o7667DvulcD-gC_fSA,608
|
| 350 |
+
setuptools/_vendor/importlib_metadata/compat/py39.py,sha256=cPkMv6-0ilK-0Jw_Tkn0xYbOKJZc4WJKQHow0c2T44w,1102
|
| 351 |
+
setuptools/_vendor/importlib_metadata/diagnose.py,sha256=nkSRMiowlmkhLYhKhvCg9glmt_11Cox-EmLzEbqYTa8,379
|
| 352 |
+
setuptools/_vendor/importlib_metadata/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 353 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 354 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 355 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/METADATA,sha256=ZgMNY0WAZRs-U8wZiV2SMfjSKqBrMngXyDMs_CAwMwg,21079
|
| 356 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/RECORD,sha256=XXg0rBuiYSxoAQUP3lenuYsPNqz4jDwtTzdv2JEbMJE,943
|
| 357 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
| 358 |
+
setuptools/_vendor/inflect-7.3.1.dist-info/top_level.txt,sha256=m52ujdp10CqT6jh1XQxZT6kEntcnv-7Tl7UiGNTzWZA,8
|
| 359 |
+
setuptools/_vendor/inflect/__init__.py,sha256=Jxy1HJXZiZ85kHeLAhkmvz6EMTdFqBe-duvt34R6IOc,103796
|
| 360 |
+
setuptools/_vendor/inflect/__pycache__/__init__.cpython-312.pyc,,
|
| 361 |
+
setuptools/_vendor/inflect/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 362 |
+
setuptools/_vendor/inflect/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 363 |
+
setuptools/_vendor/inflect/compat/__pycache__/py38.cpython-312.pyc,,
|
| 364 |
+
setuptools/_vendor/inflect/compat/py38.py,sha256=oObVfVnWX9_OpnOuEJn1mFbJxVhwyR5epbiTNXDDaso,160
|
| 365 |
+
setuptools/_vendor/inflect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 366 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 367 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 368 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/METADATA,sha256=IMUaliNsA5X1Ox9MXUWOagch5R4Wwb_3M7erp29dBtg,3933
|
| 369 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/RECORD,sha256=HptivXDkpfom6VlMu4CGD_7KPev-6Hc9rvp3TNJZygY,873
|
| 370 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 371 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
| 372 |
+
setuptools/_vendor/jaraco.collections-5.1.0.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
|
| 373 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 374 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 375 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/METADATA,sha256=xDtguJej0tN9iEXCUvxEJh2a7xceIRVBEakBLSr__tY,4020
|
| 376 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/RECORD,sha256=VRl7iKeEQyl7stgnp1uq50CzOJYlHYcoNdS0x17C9X4,641
|
| 377 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 378 |
+
setuptools/_vendor/jaraco.context-5.3.0.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
|
| 379 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 380 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 381 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/METADATA,sha256=i4aUaQDX-jjdEQK5wevhegyx8JyLfin2HyvaSk3FHso,2891
|
| 382 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/RECORD,sha256=YyqnwE98S8wBwCevW5vHb-iVj0oYEDW5V6O9MBS6JIs,843
|
| 383 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 384 |
+
setuptools/_vendor/jaraco.functools-4.0.1.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
|
| 385 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 386 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 387 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/METADATA,sha256=AzWdm6ViMfDOPoQMfLWn2zgBQSGJScyqeN29TcuWXVI,3658
|
| 388 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/RECORD,sha256=gW2UV0HcokYJk4jKPu10_AZnrLqjb3C1WbJJTDl5sfY,1500
|
| 389 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 390 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 391 |
+
setuptools/_vendor/jaraco.text-3.12.1.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
|
| 392 |
+
setuptools/_vendor/jaraco/__pycache__/context.cpython-312.pyc,,
|
| 393 |
+
setuptools/_vendor/jaraco/collections/__init__.py,sha256=Pc1-SqjWm81ad1P0-GttpkwO_LWlnaY6gUq8gcKh2v0,26640
|
| 394 |
+
setuptools/_vendor/jaraco/collections/__pycache__/__init__.cpython-312.pyc,,
|
| 395 |
+
setuptools/_vendor/jaraco/collections/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 396 |
+
setuptools/_vendor/jaraco/context.py,sha256=REoLIxDkO5MfEYowt_WoupNCRoxBS5v7YX2PbW8lIcs,9552
|
| 397 |
+
setuptools/_vendor/jaraco/functools/__init__.py,sha256=hEAJaS2uSZRuF_JY4CxCHIYh79ZpxaPp9OiHyr9EJ1w,16642
|
| 398 |
+
setuptools/_vendor/jaraco/functools/__init__.pyi,sha256=gk3dsgHzo5F_U74HzAvpNivFAPCkPJ1b2-yCd62dfnw,3878
|
| 399 |
+
setuptools/_vendor/jaraco/functools/__pycache__/__init__.cpython-312.pyc,,
|
| 400 |
+
setuptools/_vendor/jaraco/functools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 401 |
+
setuptools/_vendor/jaraco/text/Lorem ipsum.txt,sha256=N_7c_79zxOufBY9HZ3yzMgOkNv-TkOTTio4BydrSjgs,1335
|
| 402 |
+
setuptools/_vendor/jaraco/text/__init__.py,sha256=Y2YUqXR_orUoDaY4SkPRe6ZZhb5HUHB_Ah9RCNsVyho,16250
|
| 403 |
+
setuptools/_vendor/jaraco/text/__pycache__/__init__.cpython-312.pyc,,
|
| 404 |
+
setuptools/_vendor/jaraco/text/__pycache__/layouts.cpython-312.pyc,,
|
| 405 |
+
setuptools/_vendor/jaraco/text/__pycache__/show-newlines.cpython-312.pyc,,
|
| 406 |
+
setuptools/_vendor/jaraco/text/__pycache__/strip-prefix.cpython-312.pyc,,
|
| 407 |
+
setuptools/_vendor/jaraco/text/__pycache__/to-dvorak.cpython-312.pyc,,
|
| 408 |
+
setuptools/_vendor/jaraco/text/__pycache__/to-qwerty.cpython-312.pyc,,
|
| 409 |
+
setuptools/_vendor/jaraco/text/layouts.py,sha256=HTC8aSTLZ7uXipyOXapRMC158juecjK6RVwitfmZ9_w,643
|
| 410 |
+
setuptools/_vendor/jaraco/text/show-newlines.py,sha256=WGQa65e8lyhb92LUOLqVn6KaCtoeVgVws6WtSRmLk6w,904
|
| 411 |
+
setuptools/_vendor/jaraco/text/strip-prefix.py,sha256=NfVXV8JVNo6nqcuYASfMV7_y4Eo8zMQqlCOGvAnRIVw,412
|
| 412 |
+
setuptools/_vendor/jaraco/text/to-dvorak.py,sha256=1SNcbSsvISpXXg-LnybIHHY-RUFOQr36zcHkY1pWFqw,119
|
| 413 |
+
setuptools/_vendor/jaraco/text/to-qwerty.py,sha256=s4UMQUnPwFn_dB5uZC27BurHOQcYondBfzIpVL5pEzw,119
|
| 414 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 415 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/LICENSE,sha256=CfHIyelBrz5YTVlkHqm4fYPAyw_QB-te85Gn4mQ8GkY,1053
|
| 416 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/METADATA,sha256=BFO90O-fLNiVQMpj7oIS5ztzgJUUQZ3TA32P5HH3N-A,36293
|
| 417 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/RECORD,sha256=d8jnPgGNwP1-ntbICwWkQEVF9kH7CFIgzkKzaLWao9M,1259
|
| 418 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 419 |
+
setuptools/_vendor/more_itertools-10.3.0.dist-info/WHEEL,sha256=rSgq_JpHF9fHR1lx53qwg_1-2LypZE_qmcuXbVUq948,81
|
| 420 |
+
setuptools/_vendor/more_itertools/__init__.py,sha256=dtAbGjTDmn_ghiU5YXfhyDy0phAlXVdt5klZA5fUa-Q,149
|
| 421 |
+
setuptools/_vendor/more_itertools/__init__.pyi,sha256=5B3eTzON1BBuOLob1vCflyEb2lSd6usXQQ-Cv-hXkeA,43
|
| 422 |
+
setuptools/_vendor/more_itertools/__pycache__/__init__.cpython-312.pyc,,
|
| 423 |
+
setuptools/_vendor/more_itertools/__pycache__/more.cpython-312.pyc,,
|
| 424 |
+
setuptools/_vendor/more_itertools/__pycache__/recipes.cpython-312.pyc,,
|
| 425 |
+
setuptools/_vendor/more_itertools/more.py,sha256=1E5kzFncRKTDw0cYv1yRXMgDdunstLQd1QStcnL6U90,148370
|
| 426 |
+
setuptools/_vendor/more_itertools/more.pyi,sha256=iXXeqt48Nxe8VGmIWpkVXuKpR2FYNuu2DU8nQLWCCu0,21484
|
| 427 |
+
setuptools/_vendor/more_itertools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 428 |
+
setuptools/_vendor/more_itertools/recipes.py,sha256=WedhhfhGVgr6zii8fIbGJVmRTw0ZKRiLKnYBDGJv4nY,28591
|
| 429 |
+
setuptools/_vendor/more_itertools/recipes.pyi,sha256=T_mdGpcFdfrP3JSWbwzYP9JyNV-Go-7RPfpxfftAWlA,4617
|
| 430 |
+
setuptools/_vendor/packaging-24.2.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
|
| 431 |
+
setuptools/_vendor/packaging-24.2.dist-info/LICENSE,sha256=ytHvW9NA1z4HS6YU0m996spceUDD2MNIUuZcSQlobEg,197
|
| 432 |
+
setuptools/_vendor/packaging-24.2.dist-info/LICENSE.APACHE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
| 433 |
+
setuptools/_vendor/packaging-24.2.dist-info/LICENSE.BSD,sha256=tw5-m3QvHMb5SLNMFqo5_-zpQZY2S8iP8NIYDwAo-sU,1344
|
| 434 |
+
setuptools/_vendor/packaging-24.2.dist-info/METADATA,sha256=ohH86s6k5mIfQxY2TS0LcSfADeOFa4BiCC-bxZV-pNs,3204
|
| 435 |
+
setuptools/_vendor/packaging-24.2.dist-info/RECORD,sha256=Y4DrXM0KY0ArfzhbAEa1LYFPwW3WEgEeL4iCqXe-A-M,2009
|
| 436 |
+
setuptools/_vendor/packaging-24.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 437 |
+
setuptools/_vendor/packaging-24.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
| 438 |
+
setuptools/_vendor/packaging/__init__.py,sha256=dk4Ta_vmdVJxYHDcfyhvQNw8V3PgSBomKNXqg-D2JDY,494
|
| 439 |
+
setuptools/_vendor/packaging/__pycache__/__init__.cpython-312.pyc,,
|
| 440 |
+
setuptools/_vendor/packaging/__pycache__/_elffile.cpython-312.pyc,,
|
| 441 |
+
setuptools/_vendor/packaging/__pycache__/_manylinux.cpython-312.pyc,,
|
| 442 |
+
setuptools/_vendor/packaging/__pycache__/_musllinux.cpython-312.pyc,,
|
| 443 |
+
setuptools/_vendor/packaging/__pycache__/_parser.cpython-312.pyc,,
|
| 444 |
+
setuptools/_vendor/packaging/__pycache__/_structures.cpython-312.pyc,,
|
| 445 |
+
setuptools/_vendor/packaging/__pycache__/_tokenizer.cpython-312.pyc,,
|
| 446 |
+
setuptools/_vendor/packaging/__pycache__/markers.cpython-312.pyc,,
|
| 447 |
+
setuptools/_vendor/packaging/__pycache__/metadata.cpython-312.pyc,,
|
| 448 |
+
setuptools/_vendor/packaging/__pycache__/requirements.cpython-312.pyc,,
|
| 449 |
+
setuptools/_vendor/packaging/__pycache__/specifiers.cpython-312.pyc,,
|
| 450 |
+
setuptools/_vendor/packaging/__pycache__/tags.cpython-312.pyc,,
|
| 451 |
+
setuptools/_vendor/packaging/__pycache__/utils.cpython-312.pyc,,
|
| 452 |
+
setuptools/_vendor/packaging/__pycache__/version.cpython-312.pyc,,
|
| 453 |
+
setuptools/_vendor/packaging/_elffile.py,sha256=cflAQAkE25tzhYmq_aCi72QfbT_tn891tPzfpbeHOwE,3306
|
| 454 |
+
setuptools/_vendor/packaging/_manylinux.py,sha256=vl5OCoz4kx80H5rwXKeXWjl9WNISGmr4ZgTpTP9lU9c,9612
|
| 455 |
+
setuptools/_vendor/packaging/_musllinux.py,sha256=p9ZqNYiOItGee8KcZFeHF_YcdhVwGHdK6r-8lgixvGQ,2694
|
| 456 |
+
setuptools/_vendor/packaging/_parser.py,sha256=s_TvTvDNK0NrM2QB3VKThdWFM4Nc0P6JnkObkl3MjpM,10236
|
| 457 |
+
setuptools/_vendor/packaging/_structures.py,sha256=q3eVNmbWJGG_S0Dit_S3Ao8qQqz_5PYTXFAKBZe5yr4,1431
|
| 458 |
+
setuptools/_vendor/packaging/_tokenizer.py,sha256=J6v5H7Jzvb-g81xp_2QACKwO7LxHQA6ikryMU7zXwN8,5273
|
| 459 |
+
setuptools/_vendor/packaging/licenses/__init__.py,sha256=1x5M1nEYjcgwEbLt0dXwz2ukjr18DiCzC0sraQqJ-Ww,5715
|
| 460 |
+
setuptools/_vendor/packaging/licenses/__pycache__/__init__.cpython-312.pyc,,
|
| 461 |
+
setuptools/_vendor/packaging/licenses/__pycache__/_spdx.cpython-312.pyc,,
|
| 462 |
+
setuptools/_vendor/packaging/licenses/_spdx.py,sha256=oAm1ztPFwlsmCKe7lAAsv_OIOfS1cWDu9bNBkeu-2ns,48398
|
| 463 |
+
setuptools/_vendor/packaging/markers.py,sha256=c89TNzB7ZdGYhkovm6PYmqGyHxXlYVaLW591PHUNKD8,10561
|
| 464 |
+
setuptools/_vendor/packaging/metadata.py,sha256=YJibM7GYe4re8-0a3OlXmGS-XDgTEoO4tlBt2q25Bng,34762
|
| 465 |
+
setuptools/_vendor/packaging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 466 |
+
setuptools/_vendor/packaging/requirements.py,sha256=gYyRSAdbrIyKDY66ugIDUQjRMvxkH2ALioTmX3tnL6o,2947
|
| 467 |
+
setuptools/_vendor/packaging/specifiers.py,sha256=GG1wPNMcL0fMJO68vF53wKMdwnfehDcaI-r9NpTfilA,40074
|
| 468 |
+
setuptools/_vendor/packaging/tags.py,sha256=CFqrJzAzc2XNGexerH__T-Y5Iwq7WbsYXsiLERLWxY0,21014
|
| 469 |
+
setuptools/_vendor/packaging/utils.py,sha256=0F3Hh9OFuRgrhTgGZUl5K22Fv1YP2tZl1z_2gO6kJiA,5050
|
| 470 |
+
setuptools/_vendor/packaging/version.py,sha256=olfyuk_DPbflNkJ4wBWetXQ17c74x3DB501degUv7DY,16676
|
| 471 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 472 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/METADATA,sha256=zmsie01G1MtXR0wgIv5XpVeTO7idr0WWvfmxKsKWuGk,11429
|
| 473 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/RECORD,sha256=TCEddtQu1A78Os_Mhm2JEqcYr7yit-UYSUQjZtbpn-g,1642
|
| 474 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 475 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
| 476 |
+
setuptools/_vendor/platformdirs-4.2.2.dist-info/licenses/LICENSE,sha256=KeD9YukphQ6G6yjD_czwzv30-pSHkBHP-z0NS-1tTbY,1089
|
| 477 |
+
setuptools/_vendor/platformdirs/__init__.py,sha256=EMGE8qeHRR9CzDFr8kL3tA8hdZZniYjXBVZd0UGTWK0,22225
|
| 478 |
+
setuptools/_vendor/platformdirs/__main__.py,sha256=HnsUQHpiBaiTxwcmwVw-nFaPdVNZtQIdi1eWDtI-MzI,1493
|
| 479 |
+
setuptools/_vendor/platformdirs/__pycache__/__init__.cpython-312.pyc,,
|
| 480 |
+
setuptools/_vendor/platformdirs/__pycache__/__main__.cpython-312.pyc,,
|
| 481 |
+
setuptools/_vendor/platformdirs/__pycache__/android.cpython-312.pyc,,
|
| 482 |
+
setuptools/_vendor/platformdirs/__pycache__/api.cpython-312.pyc,,
|
| 483 |
+
setuptools/_vendor/platformdirs/__pycache__/macos.cpython-312.pyc,,
|
| 484 |
+
setuptools/_vendor/platformdirs/__pycache__/unix.cpython-312.pyc,,
|
| 485 |
+
setuptools/_vendor/platformdirs/__pycache__/version.cpython-312.pyc,,
|
| 486 |
+
setuptools/_vendor/platformdirs/__pycache__/windows.cpython-312.pyc,,
|
| 487 |
+
setuptools/_vendor/platformdirs/android.py,sha256=xZXY9Jd46WOsxT2U6-5HsNtDZ-IQqxcEUrBLl3hYk4o,9016
|
| 488 |
+
setuptools/_vendor/platformdirs/api.py,sha256=QBYdUac2eC521ek_y53uD1Dcq-lJX8IgSRVd4InC6uc,8996
|
| 489 |
+
setuptools/_vendor/platformdirs/macos.py,sha256=wftsbsvq6nZ0WORXSiCrZNkRHz_WKuktl0a6mC7MFkI,5580
|
| 490 |
+
setuptools/_vendor/platformdirs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 491 |
+
setuptools/_vendor/platformdirs/unix.py,sha256=Cci9Wqt35dAMsg6HT9nRGHSBW5obb0pR3AE1JJnsCXg,10643
|
| 492 |
+
setuptools/_vendor/platformdirs/version.py,sha256=r7F76tZRjgQKzrpx_I0_ZMQOMU-PS7eGnHD7zEK3KB0,411
|
| 493 |
+
setuptools/_vendor/platformdirs/windows.py,sha256=IFpiohUBwxPtCzlyKwNtxyW4Jk8haa6W8o59mfrDXVo,10125
|
| 494 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 495 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
|
| 496 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/METADATA,sha256=zPDceKmPwJGLWtZykrHixL7WVXWmJGzZ1jyRT5lCoPI,8875
|
| 497 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/RECORD,sha256=DLn5pFGh42WsVLTIhmLh2gy1SnLRalJY-wq_-dPhwCI,999
|
| 498 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 499 |
+
setuptools/_vendor/tomli-2.0.1.dist-info/WHEEL,sha256=jPMR_Dzkc4X4icQtmz81lnNY_kAsfog7ry7qoRvYLXw,81
|
| 500 |
+
setuptools/_vendor/tomli/__init__.py,sha256=JhUwV66DB1g4Hvt1UQCVMdfCu-IgAV8FXmvDU9onxd4,396
|
| 501 |
+
setuptools/_vendor/tomli/__pycache__/__init__.cpython-312.pyc,,
|
| 502 |
+
setuptools/_vendor/tomli/__pycache__/_parser.cpython-312.pyc,,
|
| 503 |
+
setuptools/_vendor/tomli/__pycache__/_re.cpython-312.pyc,,
|
| 504 |
+
setuptools/_vendor/tomli/__pycache__/_types.cpython-312.pyc,,
|
| 505 |
+
setuptools/_vendor/tomli/_parser.py,sha256=g9-ENaALS-B8dokYpCuzUFalWlog7T-SIYMjLZSWrtM,22633
|
| 506 |
+
setuptools/_vendor/tomli/_re.py,sha256=dbjg5ChZT23Ka9z9DHOXfdtSpPwUfdgMXnj8NOoly-w,2943
|
| 507 |
+
setuptools/_vendor/tomli/_types.py,sha256=-GTG2VUqkpxwMqzmVO4F7ybKddIbAnuAHXfmWQcTi3Q,254
|
| 508 |
+
setuptools/_vendor/tomli/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
| 509 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 510 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/LICENSE,sha256=YWP3mH37ONa8MgzitwsvArhivEESZRbVUu8c1DJH51g,1130
|
| 511 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/METADATA,sha256=z2dcHAp0TwhYCFU5Deh8x31nazElgujUz9tbuP0pjSE,3717
|
| 512 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/RECORD,sha256=SKUZWVgkeDUidUKM7s1473fXmsna55bjmi6vJUAoJVI,2402
|
| 513 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 514 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/entry_points.txt,sha256=qp7NQ1aLtiSgMQqo6gWlfGpy0IIXzoMJmeQTLpzqFZQ,48
|
| 515 |
+
setuptools/_vendor/typeguard-4.3.0.dist-info/top_level.txt,sha256=4z28AhuDodwRS_c1J_l8H51t5QuwfTseskYzlxp6grs,10
|
| 516 |
+
setuptools/_vendor/typeguard/__init__.py,sha256=Onh4w38elPCjtlcU3JY9k3h70NjsxXIkAflmQn-Z0FY,2071
|
| 517 |
+
setuptools/_vendor/typeguard/__pycache__/__init__.cpython-312.pyc,,
|
| 518 |
+
setuptools/_vendor/typeguard/__pycache__/_checkers.cpython-312.pyc,,
|
| 519 |
+
setuptools/_vendor/typeguard/__pycache__/_config.cpython-312.pyc,,
|
| 520 |
+
setuptools/_vendor/typeguard/__pycache__/_decorators.cpython-312.pyc,,
|
| 521 |
+
setuptools/_vendor/typeguard/__pycache__/_exceptions.cpython-312.pyc,,
|
| 522 |
+
setuptools/_vendor/typeguard/__pycache__/_functions.cpython-312.pyc,,
|
| 523 |
+
setuptools/_vendor/typeguard/__pycache__/_importhook.cpython-312.pyc,,
|
| 524 |
+
setuptools/_vendor/typeguard/__pycache__/_memo.cpython-312.pyc,,
|
| 525 |
+
setuptools/_vendor/typeguard/__pycache__/_pytest_plugin.cpython-312.pyc,,
|
| 526 |
+
setuptools/_vendor/typeguard/__pycache__/_suppression.cpython-312.pyc,,
|
| 527 |
+
setuptools/_vendor/typeguard/__pycache__/_transformer.cpython-312.pyc,,
|
| 528 |
+
setuptools/_vendor/typeguard/__pycache__/_union_transformer.cpython-312.pyc,,
|
| 529 |
+
setuptools/_vendor/typeguard/__pycache__/_utils.cpython-312.pyc,,
|
| 530 |
+
setuptools/_vendor/typeguard/_checkers.py,sha256=JRrgKicdOEfIBoNEtegYCEIlhpad-a1u1Em7GCj0WCI,31360
|
| 531 |
+
setuptools/_vendor/typeguard/_config.py,sha256=nIz8QwDa-oFO3L9O8_6srzlmd99pSby2wOM4Wb7F_B0,2846
|
| 532 |
+
setuptools/_vendor/typeguard/_decorators.py,sha256=v6dsIeWvPhExGLP_wXF-RmDUyjZf_Ak28g7gBJ_v0-0,9033
|
| 533 |
+
setuptools/_vendor/typeguard/_exceptions.py,sha256=ZIPeiV-FBd5Emw2EaWd2Fvlsrwi4ocwT2fVGBIAtHcQ,1121
|
| 534 |
+
setuptools/_vendor/typeguard/_functions.py,sha256=ibgSAKa5ptIm1eR9ARG0BSozAFJPFNASZqhPVyQeqig,10393
|
| 535 |
+
setuptools/_vendor/typeguard/_importhook.py,sha256=ugjCDvFcdWMU7UugqlJG91IpVNpEIxtRr-99s0h1k7M,6389
|
| 536 |
+
setuptools/_vendor/typeguard/_memo.py,sha256=1juQV_vxnD2JYKbSrebiQuj4oKHz6n67v9pYA-CCISg,1303
|
| 537 |
+
setuptools/_vendor/typeguard/_pytest_plugin.py,sha256=-fcSqkv54rIfIF8pDavY5YQPkj4OX8GMt_lL7CQSD4I,4416
|
| 538 |
+
setuptools/_vendor/typeguard/_suppression.py,sha256=VQfzxcwIbu3if0f7VBkKM7hkYOA7tNFw9a7jMBsmMg4,2266
|
| 539 |
+
setuptools/_vendor/typeguard/_transformer.py,sha256=9Ha7_QhdwoUni_6hvdY-hZbuEergowHrNL2vzHIakFY,44937
|
| 540 |
+
setuptools/_vendor/typeguard/_union_transformer.py,sha256=v_42r7-6HuRX2SoFwnyJ-E5PlxXpVeUJPJR1-HU9qSo,1354
|
| 541 |
+
setuptools/_vendor/typeguard/_utils.py,sha256=5HhO1rPn5f1M6ymkVAEv7Xmlz1cX-j0OnTMlyHqqrR8,5270
|
| 542 |
+
setuptools/_vendor/typeguard/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 543 |
+
setuptools/_vendor/typing_extensions-4.12.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 544 |
+
setuptools/_vendor/typing_extensions-4.12.2.dist-info/LICENSE,sha256=Oy-B_iHRgcSZxZolbI4ZaEVdZonSaaqFNzv7avQdo78,13936
|
| 545 |
+
setuptools/_vendor/typing_extensions-4.12.2.dist-info/METADATA,sha256=BeUQIa8cnYbrjWx-N8TOznM9UGW5Gm2DicVpDtRA8W0,3018
|
| 546 |
+
setuptools/_vendor/typing_extensions-4.12.2.dist-info/RECORD,sha256=dxAALYGXHmMqpqL8M9xddKr118quIgQKZdPjFQOwXuk,571
|
| 547 |
+
setuptools/_vendor/typing_extensions-4.12.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
| 548 |
+
setuptools/_vendor/typing_extensions.py,sha256=gwekpyG9DVG3lxWKX4ni8u7nk3We5slG98mA9F3DJQw,134451
|
| 549 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 550 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/LICENSE.txt,sha256=MMI2GGeRCPPo6h0qZYx8pBe9_IkcmO8aifpP8MmChlQ,1107
|
| 551 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/METADATA,sha256=mKz84H7m7jsxJyzeIcTVORiTb0NPMV39KvOIYhGgmjA,2313
|
| 552 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/RECORD,sha256=1jnxrHyZPDcVvULyfGFhiba4Z5L9_RsXr9dxcNbhaYQ,4900
|
| 553 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 554 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
| 555 |
+
setuptools/_vendor/wheel-0.45.1.dist-info/entry_points.txt,sha256=rTY1BbkPHhkGMm4Q3F0pIzJBzW2kMxoG1oriffvGdA0,104
|
| 556 |
+
setuptools/_vendor/wheel/__init__.py,sha256=mrxMnvdXACur_LWegbUfh5g5ysWZrd63UJn890wvGNk,59
|
| 557 |
+
setuptools/_vendor/wheel/__main__.py,sha256=NkMUnuTCGcOkgY0IBLgBCVC_BGGcWORx2K8jYGS12UE,455
|
| 558 |
+
setuptools/_vendor/wheel/__pycache__/__init__.cpython-312.pyc,,
|
| 559 |
+
setuptools/_vendor/wheel/__pycache__/__main__.cpython-312.pyc,,
|
| 560 |
+
setuptools/_vendor/wheel/__pycache__/_bdist_wheel.cpython-312.pyc,,
|
| 561 |
+
setuptools/_vendor/wheel/__pycache__/_setuptools_logging.cpython-312.pyc,,
|
| 562 |
+
setuptools/_vendor/wheel/__pycache__/bdist_wheel.cpython-312.pyc,,
|
| 563 |
+
setuptools/_vendor/wheel/__pycache__/macosx_libfile.cpython-312.pyc,,
|
| 564 |
+
setuptools/_vendor/wheel/__pycache__/metadata.cpython-312.pyc,,
|
| 565 |
+
setuptools/_vendor/wheel/__pycache__/util.cpython-312.pyc,,
|
| 566 |
+
setuptools/_vendor/wheel/__pycache__/wheelfile.cpython-312.pyc,,
|
| 567 |
+
setuptools/_vendor/wheel/_bdist_wheel.py,sha256=UghCQjSH_pVfcZh6oRjzSw_TQhcf3anSx1OkiLSL82M,21694
|
| 568 |
+
setuptools/_vendor/wheel/_setuptools_logging.py,sha256=-5KC-lne0ilOUWIDfOkqapUWGMFZhuKYDIavIZiB5kM,781
|
| 569 |
+
setuptools/_vendor/wheel/bdist_wheel.py,sha256=tpf9WufiSO1RuEMg5oPhIfSG8DMziCZ_4muCKF69Cqo,1107
|
| 570 |
+
setuptools/_vendor/wheel/cli/__init__.py,sha256=Npq6_jKi03dhIcRnmbuFhwviVJxwO0tYEnEhWMv9cJo,4402
|
| 571 |
+
setuptools/_vendor/wheel/cli/__pycache__/__init__.cpython-312.pyc,,
|
| 572 |
+
setuptools/_vendor/wheel/cli/__pycache__/convert.cpython-312.pyc,,
|
| 573 |
+
setuptools/_vendor/wheel/cli/__pycache__/pack.cpython-312.pyc,,
|
| 574 |
+
setuptools/_vendor/wheel/cli/__pycache__/tags.cpython-312.pyc,,
|
| 575 |
+
setuptools/_vendor/wheel/cli/__pycache__/unpack.cpython-312.pyc,,
|
| 576 |
+
setuptools/_vendor/wheel/cli/convert.py,sha256=Bi0ntEXb9nTllCxWeTRQ4j-nPs3szWSEKipG_GgnMkQ,12634
|
| 577 |
+
setuptools/_vendor/wheel/cli/pack.py,sha256=CAFcHdBVulvsHYJlndKVO7KMI9JqBTZz5ii0PKxxCOs,3103
|
| 578 |
+
setuptools/_vendor/wheel/cli/tags.py,sha256=lHw-LaWrkS5Jy_qWcw-6pSjeNM6yAjDnqKI3E5JTTCU,4760
|
| 579 |
+
setuptools/_vendor/wheel/cli/unpack.py,sha256=Y_J7ynxPSoFFTT7H0fMgbBlVErwyDGcObgme5MBuz58,1021
|
| 580 |
+
setuptools/_vendor/wheel/macosx_libfile.py,sha256=k1x7CE3LPtOVGqj6NXQ1nTGYVPaeRrhVzUG_KPq3zDs,16572
|
| 581 |
+
setuptools/_vendor/wheel/metadata.py,sha256=JC4p7jlQZu2bUTAQ2fevkqLjg_X6gnNyRhLn6OUO1tc,6171
|
| 582 |
+
setuptools/_vendor/wheel/util.py,sha256=aL7aibHwYUgfc8WlolL5tXdkV4DatbJxZHb1kwHFJAU,423
|
| 583 |
+
setuptools/_vendor/wheel/vendored/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 584 |
+
setuptools/_vendor/wheel/vendored/__pycache__/__init__.cpython-312.pyc,,
|
| 585 |
+
setuptools/_vendor/wheel/vendored/packaging/LICENSE,sha256=ytHvW9NA1z4HS6YU0m996spceUDD2MNIUuZcSQlobEg,197
|
| 586 |
+
setuptools/_vendor/wheel/vendored/packaging/LICENSE.APACHE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
| 587 |
+
setuptools/_vendor/wheel/vendored/packaging/LICENSE.BSD,sha256=tw5-m3QvHMb5SLNMFqo5_-zpQZY2S8iP8NIYDwAo-sU,1344
|
| 588 |
+
setuptools/_vendor/wheel/vendored/packaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 589 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/__init__.cpython-312.pyc,,
|
| 590 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_elffile.cpython-312.pyc,,
|
| 591 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_manylinux.cpython-312.pyc,,
|
| 592 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_musllinux.cpython-312.pyc,,
|
| 593 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_parser.cpython-312.pyc,,
|
| 594 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_structures.cpython-312.pyc,,
|
| 595 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-312.pyc,,
|
| 596 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/markers.cpython-312.pyc,,
|
| 597 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/requirements.cpython-312.pyc,,
|
| 598 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/specifiers.cpython-312.pyc,,
|
| 599 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/tags.cpython-312.pyc,,
|
| 600 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/utils.cpython-312.pyc,,
|
| 601 |
+
setuptools/_vendor/wheel/vendored/packaging/__pycache__/version.cpython-312.pyc,,
|
| 602 |
+
setuptools/_vendor/wheel/vendored/packaging/_elffile.py,sha256=hbmK8OD6Z7fY6hwinHEUcD1by7czkGiNYu7ShnFEk2k,3266
|
| 603 |
+
setuptools/_vendor/wheel/vendored/packaging/_manylinux.py,sha256=P7sdR5_7XBY09LVYYPhHmydMJIIwPXWsh4olk74Uuj4,9588
|
| 604 |
+
setuptools/_vendor/wheel/vendored/packaging/_musllinux.py,sha256=z1s8To2hQ0vpn_d-O2i5qxGwEK8WmGlLt3d_26V7NeY,2674
|
| 605 |
+
setuptools/_vendor/wheel/vendored/packaging/_parser.py,sha256=4tT4emSl2qTaU7VTQE1Xa9o1jMPCsBezsYBxyNMUN-s,10347
|
| 606 |
+
setuptools/_vendor/wheel/vendored/packaging/_structures.py,sha256=q3eVNmbWJGG_S0Dit_S3Ao8qQqz_5PYTXFAKBZe5yr4,1431
|
| 607 |
+
setuptools/_vendor/wheel/vendored/packaging/_tokenizer.py,sha256=alCtbwXhOFAmFGZ6BQ-wCTSFoRAJ2z-ysIf7__MTJ_k,5292
|
| 608 |
+
setuptools/_vendor/wheel/vendored/packaging/markers.py,sha256=_TSPI1BhJYO7Bp9AzTmHQxIqHEVXaTjmDh9G-w8qzPA,8232
|
| 609 |
+
setuptools/_vendor/wheel/vendored/packaging/requirements.py,sha256=dgoBeVprPu2YE6Q8nGfwOPTjATHbRa_ZGLyXhFEln6Q,2933
|
| 610 |
+
setuptools/_vendor/wheel/vendored/packaging/specifiers.py,sha256=IWSt0SrLSP72heWhAC8UL0eGvas7XIQHjqiViVfmPKE,39778
|
| 611 |
+
setuptools/_vendor/wheel/vendored/packaging/tags.py,sha256=fedHXiOHkBxNZTXotXv8uXPmMFU9ae-TKBujgYHigcA,18950
|
| 612 |
+
setuptools/_vendor/wheel/vendored/packaging/utils.py,sha256=XgdmP3yx9-wQEFjO7OvMj9RjEf5JlR5HFFR69v7SQ9E,5268
|
| 613 |
+
setuptools/_vendor/wheel/vendored/packaging/version.py,sha256=PFJaYZDxBgyxkfYhH3SQw4qfE9ICCWrTmitvq14y3bs,16234
|
| 614 |
+
setuptools/_vendor/wheel/vendored/vendor.txt,sha256=Z2ENjB1i5prfez8CdM1Sdr3c6Zxv2rRRolMpLmBncAE,16
|
| 615 |
+
setuptools/_vendor/wheel/wheelfile.py,sha256=USCttNlJwafxt51YYFFKG7jnxz8dfhbyqAZL6jMTA9s,8411
|
| 616 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 617 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
|
| 618 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/METADATA,sha256=UIrk_kMIHGSwsKKChYizqMw0MMZpPRZ2ZiVpQAsN_bE,3575
|
| 619 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/RECORD,sha256=8xby4D_ZrefrvAsVRwaEjiu4_VaLkJNRCfDY484rm_4,1039
|
| 620 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 621 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
| 622 |
+
setuptools/_vendor/zipp-3.19.2.dist-info/top_level.txt,sha256=iAbdoSHfaGqBfVb2XuR9JqSQHCoOsOtG6y9C_LSpqFw,5
|
| 623 |
+
setuptools/_vendor/zipp/__init__.py,sha256=QuI1g00G4fRAcGt-HqbV0oWIkmSgedCGGYsHHYzNa8A,13412
|
| 624 |
+
setuptools/_vendor/zipp/__pycache__/__init__.cpython-312.pyc,,
|
| 625 |
+
setuptools/_vendor/zipp/__pycache__/glob.cpython-312.pyc,,
|
| 626 |
+
setuptools/_vendor/zipp/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 627 |
+
setuptools/_vendor/zipp/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 628 |
+
setuptools/_vendor/zipp/compat/__pycache__/py310.cpython-312.pyc,,
|
| 629 |
+
setuptools/_vendor/zipp/compat/py310.py,sha256=eZpkW0zRtunkhEh8jjX3gCGe22emoKCBJw72Zt4RkhA,219
|
| 630 |
+
setuptools/_vendor/zipp/glob.py,sha256=etWpnfEoRyfUvrUsi6sTiGmErvPwe6HzY6pT8jg_lUI,3082
|
| 631 |
+
setuptools/archive_util.py,sha256=Tl_64hSTtc4y8x7xa98rFVUbG24oArpjzLAYGYP2_sI,7356
|
| 632 |
+
setuptools/build_meta.py,sha256=rry-LowqvWFsxG6Qm5QWetHJGeETzRdiQ5-bs4bOkjo,20446
|
| 633 |
+
setuptools/cli-32.exe,sha256=MqzBvFQxFsviz_EMuGd3LfLyVP8mNMhwrvC0bEtpb9s,11776
|
| 634 |
+
setuptools/cli-64.exe,sha256=u7PeVwdinmpgoMI4zUd7KPB_AGaYL9qVP6b87DkHOko,14336
|
| 635 |
+
setuptools/cli-arm64.exe,sha256=uafQjaiA36yLz1SOuksG-1m28JsX0zFIoPZhgyiSbGE,13824
|
| 636 |
+
setuptools/cli.exe,sha256=MqzBvFQxFsviz_EMuGd3LfLyVP8mNMhwrvC0bEtpb9s,11776
|
| 637 |
+
setuptools/command/__init__.py,sha256=wdSrlNR0P6nCz9_oFtCAiAkeFJMsZa1jPcpXT53f0SM,803
|
| 638 |
+
setuptools/command/__pycache__/__init__.cpython-312.pyc,,
|
| 639 |
+
setuptools/command/__pycache__/_requirestxt.cpython-312.pyc,,
|
| 640 |
+
setuptools/command/__pycache__/alias.cpython-312.pyc,,
|
| 641 |
+
setuptools/command/__pycache__/bdist_egg.cpython-312.pyc,,
|
| 642 |
+
setuptools/command/__pycache__/bdist_rpm.cpython-312.pyc,,
|
| 643 |
+
setuptools/command/__pycache__/bdist_wheel.cpython-312.pyc,,
|
| 644 |
+
setuptools/command/__pycache__/build.cpython-312.pyc,,
|
| 645 |
+
setuptools/command/__pycache__/build_clib.cpython-312.pyc,,
|
| 646 |
+
setuptools/command/__pycache__/build_ext.cpython-312.pyc,,
|
| 647 |
+
setuptools/command/__pycache__/build_py.cpython-312.pyc,,
|
| 648 |
+
setuptools/command/__pycache__/develop.cpython-312.pyc,,
|
| 649 |
+
setuptools/command/__pycache__/dist_info.cpython-312.pyc,,
|
| 650 |
+
setuptools/command/__pycache__/easy_install.cpython-312.pyc,,
|
| 651 |
+
setuptools/command/__pycache__/editable_wheel.cpython-312.pyc,,
|
| 652 |
+
setuptools/command/__pycache__/egg_info.cpython-312.pyc,,
|
| 653 |
+
setuptools/command/__pycache__/install.cpython-312.pyc,,
|
| 654 |
+
setuptools/command/__pycache__/install_egg_info.cpython-312.pyc,,
|
| 655 |
+
setuptools/command/__pycache__/install_lib.cpython-312.pyc,,
|
| 656 |
+
setuptools/command/__pycache__/install_scripts.cpython-312.pyc,,
|
| 657 |
+
setuptools/command/__pycache__/rotate.cpython-312.pyc,,
|
| 658 |
+
setuptools/command/__pycache__/saveopts.cpython-312.pyc,,
|
| 659 |
+
setuptools/command/__pycache__/sdist.cpython-312.pyc,,
|
| 660 |
+
setuptools/command/__pycache__/setopt.cpython-312.pyc,,
|
| 661 |
+
setuptools/command/__pycache__/test.cpython-312.pyc,,
|
| 662 |
+
setuptools/command/_requirestxt.py,sha256=ItYMTJGh_i5TlQstX_nFopqEhkC4PJFadBL2Zd3V670,4228
|
| 663 |
+
setuptools/command/alias.py,sha256=rDdrMt32DS6qf3K7tjZZyHD_dMKrm77AXcAtx-nBQ0I,2380
|
| 664 |
+
setuptools/command/bdist_egg.py,sha256=3eDucQ4fdeYMsLO9PhBfY1JkcMLhZXgnAI_9FdFNsEE,16972
|
| 665 |
+
setuptools/command/bdist_rpm.py,sha256=LyqI49w48SKk0FmuHsE9MLzX1SuXjL7YMNbZMFZqFII,1435
|
| 666 |
+
setuptools/command/bdist_wheel.py,sha256=_LfGHB7CV_uyncqlOTSETEi2gjVCoPKuAXcyRFoq7Cs,22246
|
| 667 |
+
setuptools/command/build.py,sha256=eI7STMERGGZEpzk1tvJN8p9IOjAAXMcGLzljv2mwI3M,6052
|
| 668 |
+
setuptools/command/build_clib.py,sha256=AbgpPIF_3qL8fZr3JIebI-WHTMTBiMfrFkVQz8K40G4,4528
|
| 669 |
+
setuptools/command/build_ext.py,sha256=bUH4M0NizaJJrv10wK-ZD3uY0TxCSZlYQDhiwwzHslM,18377
|
| 670 |
+
setuptools/command/build_py.py,sha256=DCbjvB18kkL-xUK5rvlzm0C6twTeOxNhyvJDxxa7fII,15539
|
| 671 |
+
setuptools/command/develop.py,sha256=zX22119sI1G1gfJ1gNCE4hkg2zbLKx0uUwvNmC5bIu8,6886
|
| 672 |
+
setuptools/command/dist_info.py,sha256=HU752iLLmmYMHbsDBgz2ubRjkgJobugOp8H71LzzDys,3450
|
| 673 |
+
setuptools/command/easy_install.py,sha256=0Z4kFlE78Ae2AfHXYTxZFUa2t3qlNqXCtQu4J1Nx8iA,87870
|
| 674 |
+
setuptools/command/editable_wheel.py,sha256=3bBipRZA3E4poQ8LEWhMYEjHjCzqU_pIdO86C3t7oNY,35624
|
| 675 |
+
setuptools/command/egg_info.py,sha256=WWUozR3DZCrWsTQhHXOygMiEUcrjLWphET0-Zsocsm4,25982
|
| 676 |
+
setuptools/command/install.py,sha256=MmTGb8m1R8fJ0cc5FTWCF6uq-s1ZJmvpYm-N_CtqEaI,7046
|
| 677 |
+
setuptools/command/install_egg_info.py,sha256=3I9IPCH7D59Sh-6aVYz-h6wwyxq-wkxrKwKg3nDdJqs,2075
|
| 678 |
+
setuptools/command/install_lib.py,sha256=9n1_U83eHcERL_a_rv_LhHCkhXlLdqyZ4SdBow-9qcE,4319
|
| 679 |
+
setuptools/command/install_scripts.py,sha256=tVOCj3e8OTIrkoL_bGbT5pOksdxZfQblH_bdI4DtVV4,2637
|
| 680 |
+
setuptools/command/launcher manifest.xml,sha256=xlLbjWrB01tKC0-hlVkOKkiSPbzMml2eOPtJ_ucCnbE,628
|
| 681 |
+
setuptools/command/rotate.py,sha256=XNd_BEEOWAJHW1FcLTMUWWl4QB6zAuk7b8VWQg3FHos,2187
|
| 682 |
+
setuptools/command/saveopts.py,sha256=Np0PVb7SD7oTbu9Z9sosS7D-CkkIkU7x4glu5Es1tjA,692
|
| 683 |
+
setuptools/command/sdist.py,sha256=JaQm2-ebXI2kvyrBjJKP8yNLPa5eMbMeis88CXBMYlk,7374
|
| 684 |
+
setuptools/command/setopt.py,sha256=xZF2RCc4ABvE9eHHAzF50-fkQg3au8fcRUVVGd58k3U,5100
|
| 685 |
+
setuptools/command/test.py,sha256=k7xcq7D7bEehgxarbw-dW3AtmGZORqz8HjKR6FGJ3jk,1343
|
| 686 |
+
setuptools/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 687 |
+
setuptools/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 688 |
+
setuptools/compat/__pycache__/py310.cpython-312.pyc,,
|
| 689 |
+
setuptools/compat/__pycache__/py311.cpython-312.pyc,,
|
| 690 |
+
setuptools/compat/__pycache__/py312.cpython-312.pyc,,
|
| 691 |
+
setuptools/compat/__pycache__/py39.cpython-312.pyc,,
|
| 692 |
+
setuptools/compat/py310.py,sha256=8sqwWczIcrkzeAbhaim4pKVd4tXZdcqmebgdvzji0rc,141
|
| 693 |
+
setuptools/compat/py311.py,sha256=e6tJAFwZEP82hmMBl10HYeSypelo_Ti2wTjKZVKLwOE,790
|
| 694 |
+
setuptools/compat/py312.py,sha256=vYKVtdrdOTsO_R90dJkEXsFwfMJFuIFJflhIgHrjJ-Y,366
|
| 695 |
+
setuptools/compat/py39.py,sha256=BJMtnkfcqyTfccqjYQxfoRtU2nTnWaEESBVkshTiXqY,493
|
| 696 |
+
setuptools/config/NOTICE,sha256=Ld3wiBgpejuJ1D2V_2WdjahXQRCMkTbfo6TYVsBiO9g,493
|
| 697 |
+
setuptools/config/__init__.py,sha256=aiPnL9BJn1O6MfmuNXyn8W2Lp8u9qizRVqwPiOdPIjY,1499
|
| 698 |
+
setuptools/config/__pycache__/__init__.cpython-312.pyc,,
|
| 699 |
+
setuptools/config/__pycache__/_apply_pyprojecttoml.cpython-312.pyc,,
|
| 700 |
+
setuptools/config/__pycache__/expand.cpython-312.pyc,,
|
| 701 |
+
setuptools/config/__pycache__/pyprojecttoml.cpython-312.pyc,,
|
| 702 |
+
setuptools/config/__pycache__/setupcfg.cpython-312.pyc,,
|
| 703 |
+
setuptools/config/_apply_pyprojecttoml.py,sha256=SUyTw7A2btZ1lBuWKN5o42-Diyv95eGTiYJ3rZOnGSc,19120
|
| 704 |
+
setuptools/config/_validate_pyproject/NOTICE,sha256=XTANv6ZDE4sBO3WsnK7uWR-VG4sO4kKIw0zNkmxHgMg,18737
|
| 705 |
+
setuptools/config/_validate_pyproject/__init__.py,sha256=dnp6T7ePP1R5z4OuC7Fd2dkFlIrtIfizUfvpGJP6nz0,1042
|
| 706 |
+
setuptools/config/_validate_pyproject/__pycache__/__init__.cpython-312.pyc,,
|
| 707 |
+
setuptools/config/_validate_pyproject/__pycache__/error_reporting.cpython-312.pyc,,
|
| 708 |
+
setuptools/config/_validate_pyproject/__pycache__/extra_validations.cpython-312.pyc,,
|
| 709 |
+
setuptools/config/_validate_pyproject/__pycache__/fastjsonschema_exceptions.cpython-312.pyc,,
|
| 710 |
+
setuptools/config/_validate_pyproject/__pycache__/fastjsonschema_validations.cpython-312.pyc,,
|
| 711 |
+
setuptools/config/_validate_pyproject/__pycache__/formats.cpython-312.pyc,,
|
| 712 |
+
setuptools/config/_validate_pyproject/error_reporting.py,sha256=meldD7nBQdolQhvG-43r1Ue-gU1n7ORAJR86vh3Rrvk,11813
|
| 713 |
+
setuptools/config/_validate_pyproject/extra_validations.py,sha256=-GUG5S--ijY8WfXbdXPoHl6ywGsyEF9dtDpenSoJPHg,2858
|
| 714 |
+
setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py,sha256=w749JgqKi8clBFcObdcbZVqsmF4oJ_QByhZ1SGbUFNw,1612
|
| 715 |
+
setuptools/config/_validate_pyproject/fastjsonschema_validations.py,sha256=FihD5ZcM6p77BPZ04CGqh3BEwVNoPMKJZJAyuJpkAU0,354682
|
| 716 |
+
setuptools/config/_validate_pyproject/formats.py,sha256=TETokJBK9hjl-cVg1olsojkJwLxfP7_chgJQNmzAB98,13564
|
| 717 |
+
setuptools/config/distutils.schema.json,sha256=Tcp32kRnhwORGw_9p6GEi08lj2h15tQRzOYBbzGmcBU,972
|
| 718 |
+
setuptools/config/expand.py,sha256=JNAktRCsyyRB-rQodbPnCucmLWqcYvzCDC8Ebn2Z7xM,16041
|
| 719 |
+
setuptools/config/pyprojecttoml.py,sha256=YMu5PdbJJI5azp6kR_boM1mflf5nqOA-InF4s6LnLgw,18320
|
| 720 |
+
setuptools/config/setupcfg.py,sha256=VZDkwE7DYv45SbadJD8CwKrDtiXvjgllL8PYSvoRCyg,26575
|
| 721 |
+
setuptools/config/setuptools.schema.json,sha256=dZBRuSEnZkatoVlt1kVwG8ocTeRdO7BD0xvOWKH54PY,16071
|
| 722 |
+
setuptools/depends.py,sha256=jKYfjmt_2ZQYVghb8L9bU7LJ6erHJ5ze-K_fKV1BMXk,5965
|
| 723 |
+
setuptools/discovery.py,sha256=-42c3XhwzkfodDKKP50C2YBzr11fncAgmUzBdBRb0-Q,21258
|
| 724 |
+
setuptools/dist.py,sha256=RZz7aj9RxqSYriqgFoZOu-7KIV82cmlaMFx9owZrApQ,44897
|
| 725 |
+
setuptools/errors.py,sha256=gY2x2PIaIgy01yRANRC-zcCwxDCqCScgJoCOZFe0yio,3024
|
| 726 |
+
setuptools/extension.py,sha256=KCnv9p3tgm0ZVqtgE451fyILsm4hCyvOiUtOu787D-4,6683
|
| 727 |
+
setuptools/glob.py,sha256=AC_B33DY8g-CHELxDsJrtwFrpiucSAZsakPFdSOQzhc,6062
|
| 728 |
+
setuptools/gui-32.exe,sha256=hdrh6V13hF8stZvKw9Sv50u-TJGpvMW_SnHNQxBNvnw,11776
|
| 729 |
+
setuptools/gui-64.exe,sha256=NHG2FA6txkEid9u-_j_vjDRaDxpZd2CGuAo2GMOoPjs,14336
|
| 730 |
+
setuptools/gui-arm64.exe,sha256=5pT0dDQFyLWSb_RX22_n8aEt7HwWqcOGR4TT9OB64Jc,13824
|
| 731 |
+
setuptools/gui.exe,sha256=hdrh6V13hF8stZvKw9Sv50u-TJGpvMW_SnHNQxBNvnw,11776
|
| 732 |
+
setuptools/installer.py,sha256=_4Wegx4r3L05sMo3-IlqFp-OuxnWyBqjyMZ7LWQXmh8,5110
|
| 733 |
+
setuptools/launch.py,sha256=IBb5lEv69CyuZ9ewIrmKlXh154kdLmP29LKfTMkximE,820
|
| 734 |
+
setuptools/logging.py,sha256=W16iHJ1HcCXYQ0RxyrEfJ83FT4175tCtoYg-E6uSpVI,1261
|
| 735 |
+
setuptools/modified.py,sha256=ZwbfBfCFP88ltvbv_dJDz-t1LsQjnM-JUpgZnnQZjjM,568
|
| 736 |
+
setuptools/monkey.py,sha256=FwMWl2n1v2bHbeqBy-o9g8yUNaAkYFbszCbXe9d5Za8,3717
|
| 737 |
+
setuptools/msvc.py,sha256=vmM0qL4rIzrtD9pia9ZEwtqZ4LbbrgL0dU0EANVYRm8,41631
|
| 738 |
+
setuptools/namespaces.py,sha256=2GGqYY1BNDEhMtBc1rHTv7klgmNVRdksJeW-L1f--ys,3171
|
| 739 |
+
setuptools/package_index.py,sha256=yHXj4Z_QaUeh8W6rwq08I5LxnyHrSkNf01uXHwdE8K0,39095
|
| 740 |
+
setuptools/sandbox.py,sha256=fMqtcOuipHO6RKPh1YB5o7d985dLKo76Whp3vrIei2E,14906
|
| 741 |
+
setuptools/script (dev).tmpl,sha256=RUzQzCQUaXtwdLtYHWYbIQmOaES5Brqq1FvUA_tu-5I,218
|
| 742 |
+
setuptools/script.tmpl,sha256=WGTt5piezO27c-Dbx6l5Q4T3Ff20A5z7872hv3aAhYY,138
|
| 743 |
+
setuptools/tests/__init__.py,sha256=AnBfls2iJbTDQzmMKeLRt-9lxhaOHUVOZEgXv89Uwvs,335
|
| 744 |
+
setuptools/tests/__pycache__/__init__.cpython-312.pyc,,
|
| 745 |
+
setuptools/tests/__pycache__/contexts.cpython-312.pyc,,
|
| 746 |
+
setuptools/tests/__pycache__/environment.cpython-312.pyc,,
|
| 747 |
+
setuptools/tests/__pycache__/fixtures.cpython-312.pyc,,
|
| 748 |
+
setuptools/tests/__pycache__/mod_with_constant.cpython-312.pyc,,
|
| 749 |
+
setuptools/tests/__pycache__/namespaces.cpython-312.pyc,,
|
| 750 |
+
setuptools/tests/__pycache__/script-with-bom.cpython-312.pyc,,
|
| 751 |
+
setuptools/tests/__pycache__/server.cpython-312.pyc,,
|
| 752 |
+
setuptools/tests/__pycache__/test_archive_util.cpython-312.pyc,,
|
| 753 |
+
setuptools/tests/__pycache__/test_bdist_deprecations.cpython-312.pyc,,
|
| 754 |
+
setuptools/tests/__pycache__/test_bdist_egg.cpython-312.pyc,,
|
| 755 |
+
setuptools/tests/__pycache__/test_bdist_wheel.cpython-312.pyc,,
|
| 756 |
+
setuptools/tests/__pycache__/test_build.cpython-312.pyc,,
|
| 757 |
+
setuptools/tests/__pycache__/test_build_clib.cpython-312.pyc,,
|
| 758 |
+
setuptools/tests/__pycache__/test_build_ext.cpython-312.pyc,,
|
| 759 |
+
setuptools/tests/__pycache__/test_build_meta.cpython-312.pyc,,
|
| 760 |
+
setuptools/tests/__pycache__/test_build_py.cpython-312.pyc,,
|
| 761 |
+
setuptools/tests/__pycache__/test_config_discovery.cpython-312.pyc,,
|
| 762 |
+
setuptools/tests/__pycache__/test_core_metadata.cpython-312.pyc,,
|
| 763 |
+
setuptools/tests/__pycache__/test_depends.cpython-312.pyc,,
|
| 764 |
+
setuptools/tests/__pycache__/test_develop.cpython-312.pyc,,
|
| 765 |
+
setuptools/tests/__pycache__/test_dist.cpython-312.pyc,,
|
| 766 |
+
setuptools/tests/__pycache__/test_dist_info.cpython-312.pyc,,
|
| 767 |
+
setuptools/tests/__pycache__/test_distutils_adoption.cpython-312.pyc,,
|
| 768 |
+
setuptools/tests/__pycache__/test_easy_install.cpython-312.pyc,,
|
| 769 |
+
setuptools/tests/__pycache__/test_editable_install.cpython-312.pyc,,
|
| 770 |
+
setuptools/tests/__pycache__/test_egg_info.cpython-312.pyc,,
|
| 771 |
+
setuptools/tests/__pycache__/test_extern.cpython-312.pyc,,
|
| 772 |
+
setuptools/tests/__pycache__/test_find_packages.cpython-312.pyc,,
|
| 773 |
+
setuptools/tests/__pycache__/test_find_py_modules.cpython-312.pyc,,
|
| 774 |
+
setuptools/tests/__pycache__/test_glob.cpython-312.pyc,,
|
| 775 |
+
setuptools/tests/__pycache__/test_install_scripts.cpython-312.pyc,,
|
| 776 |
+
setuptools/tests/__pycache__/test_logging.cpython-312.pyc,,
|
| 777 |
+
setuptools/tests/__pycache__/test_manifest.cpython-312.pyc,,
|
| 778 |
+
setuptools/tests/__pycache__/test_namespaces.cpython-312.pyc,,
|
| 779 |
+
setuptools/tests/__pycache__/test_packageindex.cpython-312.pyc,,
|
| 780 |
+
setuptools/tests/__pycache__/test_sandbox.cpython-312.pyc,,
|
| 781 |
+
setuptools/tests/__pycache__/test_sdist.cpython-312.pyc,,
|
| 782 |
+
setuptools/tests/__pycache__/test_setopt.cpython-312.pyc,,
|
| 783 |
+
setuptools/tests/__pycache__/test_setuptools.cpython-312.pyc,,
|
| 784 |
+
setuptools/tests/__pycache__/test_shutil_wrapper.cpython-312.pyc,,
|
| 785 |
+
setuptools/tests/__pycache__/test_unicode_utils.cpython-312.pyc,,
|
| 786 |
+
setuptools/tests/__pycache__/test_virtualenv.cpython-312.pyc,,
|
| 787 |
+
setuptools/tests/__pycache__/test_warnings.cpython-312.pyc,,
|
| 788 |
+
setuptools/tests/__pycache__/test_wheel.cpython-312.pyc,,
|
| 789 |
+
setuptools/tests/__pycache__/test_windows_wrappers.cpython-312.pyc,,
|
| 790 |
+
setuptools/tests/__pycache__/text.cpython-312.pyc,,
|
| 791 |
+
setuptools/tests/__pycache__/textwrap.cpython-312.pyc,,
|
| 792 |
+
setuptools/tests/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 793 |
+
setuptools/tests/compat/__pycache__/__init__.cpython-312.pyc,,
|
| 794 |
+
setuptools/tests/compat/__pycache__/py39.cpython-312.pyc,,
|
| 795 |
+
setuptools/tests/compat/py39.py,sha256=eUy7_F-6KRTOIKl-veshUu6I0EdTSdBZMh0EV0lZ1-g,135
|
| 796 |
+
setuptools/tests/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 797 |
+
setuptools/tests/config/__pycache__/__init__.cpython-312.pyc,,
|
| 798 |
+
setuptools/tests/config/__pycache__/test_apply_pyprojecttoml.cpython-312.pyc,,
|
| 799 |
+
setuptools/tests/config/__pycache__/test_expand.cpython-312.pyc,,
|
| 800 |
+
setuptools/tests/config/__pycache__/test_pyprojecttoml.cpython-312.pyc,,
|
| 801 |
+
setuptools/tests/config/__pycache__/test_pyprojecttoml_dynamic_deps.cpython-312.pyc,,
|
| 802 |
+
setuptools/tests/config/__pycache__/test_setupcfg.cpython-312.pyc,,
|
| 803 |
+
setuptools/tests/config/downloads/__init__.py,sha256=9ixnDEdyL_arKbUzfuiJftAj9bGxKz8M9alOFZMjx9Y,1827
|
| 804 |
+
setuptools/tests/config/downloads/__pycache__/__init__.cpython-312.pyc,,
|
| 805 |
+
setuptools/tests/config/downloads/__pycache__/preload.cpython-312.pyc,,
|
| 806 |
+
setuptools/tests/config/downloads/preload.py,sha256=sIGGZpY3cmMpMwiJYYYYHG2ifZJkvJgEotRFtiulV1I,450
|
| 807 |
+
setuptools/tests/config/setupcfg_examples.txt,sha256=cAbVvCbkFZuTUL6xRRzRgqyB0rLvJTfvw3D30glo2OE,1912
|
| 808 |
+
setuptools/tests/config/test_apply_pyprojecttoml.py,sha256=l6nE4d8WLU_eSWRic7VSoqeKv9Bi7CZGHcEuB2ehk2w,28807
|
| 809 |
+
setuptools/tests/config/test_expand.py,sha256=S0oT6JvgA_oujR4YS4RUuf5gmOt1CTQV66RQDzV8xd4,8933
|
| 810 |
+
setuptools/tests/config/test_pyprojecttoml.py,sha256=0LefSljUhA6MqtJ5AVzLhomqZcYiFKdu_1ckDeMT1LY,12406
|
| 811 |
+
setuptools/tests/config/test_pyprojecttoml_dynamic_deps.py,sha256=9W73-yLhZJmvCiO4rTiQoBpZT5wNA90Xbd5n2HCshd4,3271
|
| 812 |
+
setuptools/tests/config/test_setupcfg.py,sha256=ZvN-O-2Dgon1adp6oM6il8JWdgT9y196fRvqESU5ELI,33427
|
| 813 |
+
setuptools/tests/contexts.py,sha256=TAdZKxmmodx1ExMVo01o4QpRjpIpo4X3IWKq_BnjxpU,3480
|
| 814 |
+
setuptools/tests/environment.py,sha256=95_UtTaRiuvwYC9eXKEHbn02kDtZysvZq3UZJmPUj1I,3102
|
| 815 |
+
setuptools/tests/fixtures.py,sha256=-V7iD6BeE2E0Rw6dVvTOCm36JG8ZTTnrXhN0GISlgrg,5197
|
| 816 |
+
setuptools/tests/indexes/test_links_priority/external.html,sha256=eL9euOuE93JKZdqlXxBOlHbKwIuNuIdq7GBRpsaPMcU,92
|
| 817 |
+
setuptools/tests/indexes/test_links_priority/simple/foobar/index.html,sha256=DD-TKr7UU4zAjHHz4VexYDNSAzR27levSh1c-k3ZdLE,174
|
| 818 |
+
setuptools/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 819 |
+
setuptools/tests/integration/__pycache__/__init__.cpython-312.pyc,,
|
| 820 |
+
setuptools/tests/integration/__pycache__/helpers.cpython-312.pyc,,
|
| 821 |
+
setuptools/tests/integration/__pycache__/test_pip_install_sdist.cpython-312.pyc,,
|
| 822 |
+
setuptools/tests/integration/helpers.py,sha256=3PHcS9SCA-fwVJmUP2ad5NQOttJAETI5Nnoc_xroO5k,2522
|
| 823 |
+
setuptools/tests/integration/test_pip_install_sdist.py,sha256=SFbvuYF_hDzt6OtsQ5GjFNnxmoJ_eElfvpYsiyyGJ-g,8256
|
| 824 |
+
setuptools/tests/mod_with_constant.py,sha256=X_Kj80M55w1tmQ4f7uZY91ZTALo4hKVT6EHxgYocUMQ,22
|
| 825 |
+
setuptools/tests/namespaces.py,sha256=HPcI3nR5MCFWXpaADIJ1fwKxymcQgBkuw87Ic5PUSAQ,2774
|
| 826 |
+
setuptools/tests/script-with-bom.py,sha256=hRRgIizEULGiG_ZTNoMY46HhKhxpWfy5FGcD6Qbh5fc,18
|
| 827 |
+
setuptools/tests/server.py,sha256=0FDZf0cSInCP5n1haK7AxHo3jD261RK7D3-RjP-F53k,2397
|
| 828 |
+
setuptools/tests/test_archive_util.py,sha256=buuKdY8XkW26Pe3IKAoBRGHG0MDumnuNoPg2WsAQzIg,845
|
| 829 |
+
setuptools/tests/test_bdist_deprecations.py,sha256=75Xq3gYn79LIIyusEltbHan0bEgAt2e_CaL7KLS8-KQ,775
|
| 830 |
+
setuptools/tests/test_bdist_egg.py,sha256=6PaYN1F3JDbIh1uK0urv7yJFcx98z5dn9SOJ8Mv91l8,1957
|
| 831 |
+
setuptools/tests/test_bdist_wheel.py,sha256=dZ9a7OT_UyRvLnoCi2KGEIbtzhEQjM3YutYMA6ZCezs,23083
|
| 832 |
+
setuptools/tests/test_build.py,sha256=wJgMz2hwHADcLFg-nXrwRVhus7hjmAeEGgrpIQwCGnA,798
|
| 833 |
+
setuptools/tests/test_build_clib.py,sha256=bX51XRAf4uO7IuHFpjePnoK8mE74N2gsoeEqF-ofgws,3123
|
| 834 |
+
setuptools/tests/test_build_ext.py,sha256=e4ZSxsYPB5zq1KSqGEuATZ0t0PJQzMhjjkKJ-hIjcgc,10099
|
| 835 |
+
setuptools/tests/test_build_meta.py,sha256=Iakpp9Micvhxi9_F2RPyY2NnCB1G90a38s4O5A3CuiE,34118
|
| 836 |
+
setuptools/tests/test_build_py.py,sha256=gobME_Cvzf6Ugxq70iWfXekb_xyyT61khwjFq8zkwfw,14186
|
| 837 |
+
setuptools/tests/test_config_discovery.py,sha256=FqV-lOtkqaI-ayzU2zocSdD5TaRAgCZnixNDilKA6FQ,22580
|
| 838 |
+
setuptools/tests/test_core_metadata.py,sha256=vbVJ5_Lsx_hsO_GdB6nQEXJRjA2ydx6_qSbr5LpheAA,20881
|
| 839 |
+
setuptools/tests/test_depends.py,sha256=yQBXoQbNQlJit6mbRVoz6Bb553f3sNrq02lZimNz5XY,424
|
| 840 |
+
setuptools/tests/test_develop.py,sha256=CLzXZ8-b5-VFTuau4P4yXEdLx1UdyTFcOfrV0qyUIdE,5142
|
| 841 |
+
setuptools/tests/test_dist.py,sha256=GFjyL2etAxvVM3q7NhFEGcXS5gyKj8VzbqcbKzpqbOk,8901
|
| 842 |
+
setuptools/tests/test_dist_info.py,sha256=5kBRj9tuBsVreBsY22H2feMO_JQZsSoOZMU_MJfUevY,7077
|
| 843 |
+
setuptools/tests/test_distutils_adoption.py,sha256=_eynrOfyEqXFEmjUJhzpe8GXPyTUPvNSObs4qAAmBy8,5987
|
| 844 |
+
setuptools/tests/test_easy_install.py,sha256=jx4lpFyee0G432cdnwBow3AkL4ibw-0QILwldwv5SCI,53534
|
| 845 |
+
setuptools/tests/test_editable_install.py,sha256=7eTEtpT0k7QeVyZg64eh3kZn-SjckuB9LcokOuV37DI,43383
|
| 846 |
+
setuptools/tests/test_egg_info.py,sha256=QCzoUOkFocmbkwS6XU7F8WNzKE8CGEMRxYBqKLgfUrc,44866
|
| 847 |
+
setuptools/tests/test_extern.py,sha256=rpKU6oCcksumLwf5TeKlDluFQ0TUfbPwTLQbpxcFrCU,296
|
| 848 |
+
setuptools/tests/test_find_packages.py,sha256=CTLAcTzWGWBLCcd2aAsUVkvO3ibrlqexFBdDKOWPoq8,7819
|
| 849 |
+
setuptools/tests/test_find_py_modules.py,sha256=zQjuhIG5TQN2SJPix9ARo4DL_w84Ln8QsHDUjjbrtAQ,2404
|
| 850 |
+
setuptools/tests/test_glob.py,sha256=P3JvpH-kXQ4BZ3zvRF-zKxOgwyWzwIaQIz0WHdxS0kk,887
|
| 851 |
+
setuptools/tests/test_install_scripts.py,sha256=scIrJ6a_ssKqg4vIBNaUjmAKHEYLUUZ9WKnPeKnE6gc,3433
|
| 852 |
+
setuptools/tests/test_logging.py,sha256=zlE5DlldukC7Jc54FNvDV_7ux3ErAkrfrN5CSsnNOUQ,2099
|
| 853 |
+
setuptools/tests/test_manifest.py,sha256=eMg65pIA52DizB6mpktSU-b8CjwaNCS5MSgL_V1LrFI,18562
|
| 854 |
+
setuptools/tests/test_namespaces.py,sha256=Y6utoe5PHHqL_DlgawqB9F8XpsUDPvvw1sQMenK04e0,4515
|
| 855 |
+
setuptools/tests/test_packageindex.py,sha256=qEjLHpSu2gAkegwEstzHQT-Om1uQIYjA8zeNzEX79uo,8775
|
| 856 |
+
setuptools/tests/test_sandbox.py,sha256=shUWE7fLTWe7Jzdfi6NheBWauG3oUukbUV46cArD0u0,4330
|
| 857 |
+
setuptools/tests/test_sdist.py,sha256=RYLvPa_nfyC1ZmoinzqMzJynTDG4RtPYC19_0LU6pvs,32872
|
| 858 |
+
setuptools/tests/test_setopt.py,sha256=3VxxM4ATfP-P4AGnDjoWCnHr5-i9CSEQTFYU1-FTnvI,1365
|
| 859 |
+
setuptools/tests/test_setuptools.py,sha256=_eIhqKf45-OtHqxRf20KndOZJlJdS0PuFLXBO3M-LN8,9008
|
| 860 |
+
setuptools/tests/test_shutil_wrapper.py,sha256=g15E11PtZxG-InB2BWNFyH-svObXx2XcMhgMLJPuFnc,641
|
| 861 |
+
setuptools/tests/test_unicode_utils.py,sha256=xWfEEl8jkQCt9othUTXJfFmdyATAFggJs2tTxjbumbw,316
|
| 862 |
+
setuptools/tests/test_virtualenv.py,sha256=g-njC_9JTAs1YVx_1dGJ_Q6RlInO4qKVu9-XAgNb6TY,3730
|
| 863 |
+
setuptools/tests/test_warnings.py,sha256=zwR2zcnCeCeDqILZlJOPAcuyPHoDvGu1OtOVYiLMk74,3347
|
| 864 |
+
setuptools/tests/test_wheel.py,sha256=J-83W1KdXTgAjFZE3H-ytohhvDE1iqdbE5YF5jLQlGQ,19370
|
| 865 |
+
setuptools/tests/test_windows_wrappers.py,sha256=aF6UTowN3yzCgdBh9nDQVvYIfSYogrTK776TEyXEBqg,7881
|
| 866 |
+
setuptools/tests/text.py,sha256=a12197pMVTvB6FAWQ0ujT8fIQiLIWJlFAl1UCaDUDfg,123
|
| 867 |
+
setuptools/tests/textwrap.py,sha256=FNNNq_MiaEJx88PnsbJQIRxmj1qmgcAOCXXRsODPJN4,98
|
| 868 |
+
setuptools/unicode_utils.py,sha256=ukMGh8pEAw6F_Ezb-K5D3c-078RgA_GcF0oW6lg4lSs,3189
|
| 869 |
+
setuptools/version.py,sha256=WJCeUuyq74Aok2TeK9-OexZOu8XrlQy7-y0BEuWNovQ,161
|
| 870 |
+
setuptools/warnings.py,sha256=oY0Se5eOqje_FEyjTgonUc0XGwgsrI5cgm1kkwulz_w,3796
|
| 871 |
+
setuptools/wheel.py,sha256=xkAtvgm7uPTyYV2zqVmQ0wA8kLwOyRT2Jes1zAy07Ks,8624
|
| 872 |
+
setuptools/windows_support.py,sha256=wW4IYLM1Bv7Z1MaauP2xmPjyy-wkmQnXdyvXscAf9fw,726
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (78.1.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-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
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 2 |
+
of this software and associated documentation files (the "Software"), to
|
| 3 |
+
deal in the Software without restriction, including without limitation the
|
| 4 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 5 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 6 |
+
furnished to do so, subject to the following conditions:
|
| 7 |
+
|
| 8 |
+
The above copyright notice and this permission notice shall be included in
|
| 9 |
+
all copies or substantial portions of the Software.
|
| 10 |
+
|
| 11 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 12 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 13 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 14 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 15 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 16 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 17 |
+
IN THE SOFTWARE.
|
.venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_distutils_hack
|
| 2 |
+
pkg_resources
|
| 3 |
+
setuptools
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_bdist_dumb.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.bdist_dumb."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import sys
|
| 5 |
+
import zipfile
|
| 6 |
+
from distutils.command.bdist_dumb import bdist_dumb
|
| 7 |
+
from distutils.core import Distribution
|
| 8 |
+
from distutils.tests import support
|
| 9 |
+
|
| 10 |
+
import pytest
|
| 11 |
+
|
| 12 |
+
SETUP_PY = """\
|
| 13 |
+
from distutils.core import setup
|
| 14 |
+
import foo
|
| 15 |
+
|
| 16 |
+
setup(name='foo', version='0.1', py_modules=['foo'],
|
| 17 |
+
url='xxx', author='xxx', author_email='xxx')
|
| 18 |
+
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@support.combine_markers
|
| 23 |
+
@pytest.mark.usefixtures('save_env')
|
| 24 |
+
@pytest.mark.usefixtures('save_argv')
|
| 25 |
+
@pytest.mark.usefixtures('save_cwd')
|
| 26 |
+
class TestBuildDumb(
|
| 27 |
+
support.TempdirManager,
|
| 28 |
+
):
|
| 29 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 30 |
+
def test_simple_built(self):
|
| 31 |
+
# let's create a simple package
|
| 32 |
+
tmp_dir = self.mkdtemp()
|
| 33 |
+
pkg_dir = os.path.join(tmp_dir, 'foo')
|
| 34 |
+
os.mkdir(pkg_dir)
|
| 35 |
+
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
|
| 36 |
+
self.write_file((pkg_dir, 'foo.py'), '#')
|
| 37 |
+
self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
|
| 38 |
+
self.write_file((pkg_dir, 'README'), '')
|
| 39 |
+
|
| 40 |
+
dist = Distribution({
|
| 41 |
+
'name': 'foo',
|
| 42 |
+
'version': '0.1',
|
| 43 |
+
'py_modules': ['foo'],
|
| 44 |
+
'url': 'xxx',
|
| 45 |
+
'author': 'xxx',
|
| 46 |
+
'author_email': 'xxx',
|
| 47 |
+
})
|
| 48 |
+
dist.script_name = 'setup.py'
|
| 49 |
+
os.chdir(pkg_dir)
|
| 50 |
+
|
| 51 |
+
sys.argv = ['setup.py']
|
| 52 |
+
cmd = bdist_dumb(dist)
|
| 53 |
+
|
| 54 |
+
# so the output is the same no matter
|
| 55 |
+
# what is the platform
|
| 56 |
+
cmd.format = 'zip'
|
| 57 |
+
|
| 58 |
+
cmd.ensure_finalized()
|
| 59 |
+
cmd.run()
|
| 60 |
+
|
| 61 |
+
# see what we have
|
| 62 |
+
dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
|
| 63 |
+
base = f"{dist.get_fullname()}.{cmd.plat_name}.zip"
|
| 64 |
+
|
| 65 |
+
assert dist_created == [base]
|
| 66 |
+
|
| 67 |
+
# now let's check what we have in the zip file
|
| 68 |
+
fp = zipfile.ZipFile(os.path.join('dist', base))
|
| 69 |
+
try:
|
| 70 |
+
contents = fp.namelist()
|
| 71 |
+
finally:
|
| 72 |
+
fp.close()
|
| 73 |
+
|
| 74 |
+
contents = sorted(filter(None, map(os.path.basename, contents)))
|
| 75 |
+
wanted = ['foo-0.1-py{}.{}.egg-info'.format(*sys.version_info[:2]), 'foo.py']
|
| 76 |
+
if not sys.dont_write_bytecode:
|
| 77 |
+
wanted.append(f'foo.{sys.implementation.cache_tag}.pyc')
|
| 78 |
+
assert contents == sorted(wanted)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_bdist_rpm.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.bdist_rpm."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import shutil # noqa: F401
|
| 5 |
+
import sys
|
| 6 |
+
from distutils.command.bdist_rpm import bdist_rpm
|
| 7 |
+
from distutils.core import Distribution
|
| 8 |
+
from distutils.tests import support
|
| 9 |
+
|
| 10 |
+
import pytest
|
| 11 |
+
from test.support import requires_zlib
|
| 12 |
+
|
| 13 |
+
SETUP_PY = """\
|
| 14 |
+
from distutils.core import setup
|
| 15 |
+
import foo
|
| 16 |
+
|
| 17 |
+
setup(name='foo', version='0.1', py_modules=['foo'],
|
| 18 |
+
url='xxx', author='xxx', author_email='xxx')
|
| 19 |
+
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@pytest.fixture(autouse=True)
|
| 24 |
+
def sys_executable_encodable():
|
| 25 |
+
try:
|
| 26 |
+
sys.executable.encode('UTF-8')
|
| 27 |
+
except UnicodeEncodeError:
|
| 28 |
+
pytest.skip("sys.executable is not encodable to UTF-8")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
mac_woes = pytest.mark.skipif(
|
| 32 |
+
"not sys.platform.startswith('linux')",
|
| 33 |
+
reason='spurious sdtout/stderr output under macOS',
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
@pytest.mark.usefixtures('save_env')
|
| 38 |
+
@pytest.mark.usefixtures('save_argv')
|
| 39 |
+
@pytest.mark.usefixtures('save_cwd')
|
| 40 |
+
class TestBuildRpm(
|
| 41 |
+
support.TempdirManager,
|
| 42 |
+
):
|
| 43 |
+
@mac_woes
|
| 44 |
+
@requires_zlib()
|
| 45 |
+
@pytest.mark.skipif("not shutil.which('rpm')")
|
| 46 |
+
@pytest.mark.skipif("not shutil.which('rpmbuild')")
|
| 47 |
+
def test_quiet(self):
|
| 48 |
+
# let's create a package
|
| 49 |
+
tmp_dir = self.mkdtemp()
|
| 50 |
+
os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
|
| 51 |
+
pkg_dir = os.path.join(tmp_dir, 'foo')
|
| 52 |
+
os.mkdir(pkg_dir)
|
| 53 |
+
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
|
| 54 |
+
self.write_file((pkg_dir, 'foo.py'), '#')
|
| 55 |
+
self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
|
| 56 |
+
self.write_file((pkg_dir, 'README'), '')
|
| 57 |
+
|
| 58 |
+
dist = Distribution({
|
| 59 |
+
'name': 'foo',
|
| 60 |
+
'version': '0.1',
|
| 61 |
+
'py_modules': ['foo'],
|
| 62 |
+
'url': 'xxx',
|
| 63 |
+
'author': 'xxx',
|
| 64 |
+
'author_email': 'xxx',
|
| 65 |
+
})
|
| 66 |
+
dist.script_name = 'setup.py'
|
| 67 |
+
os.chdir(pkg_dir)
|
| 68 |
+
|
| 69 |
+
sys.argv = ['setup.py']
|
| 70 |
+
cmd = bdist_rpm(dist)
|
| 71 |
+
cmd.fix_python = True
|
| 72 |
+
|
| 73 |
+
# running in quiet mode
|
| 74 |
+
cmd.quiet = True
|
| 75 |
+
cmd.ensure_finalized()
|
| 76 |
+
cmd.run()
|
| 77 |
+
|
| 78 |
+
dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
|
| 79 |
+
assert 'foo-0.1-1.noarch.rpm' in dist_created
|
| 80 |
+
|
| 81 |
+
# bug #2945: upload ignores bdist_rpm files
|
| 82 |
+
assert ('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm') in dist.dist_files
|
| 83 |
+
assert ('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm') in dist.dist_files
|
| 84 |
+
|
| 85 |
+
@mac_woes
|
| 86 |
+
@requires_zlib()
|
| 87 |
+
# https://bugs.python.org/issue1533164
|
| 88 |
+
@pytest.mark.skipif("not shutil.which('rpm')")
|
| 89 |
+
@pytest.mark.skipif("not shutil.which('rpmbuild')")
|
| 90 |
+
def test_no_optimize_flag(self):
|
| 91 |
+
# let's create a package that breaks bdist_rpm
|
| 92 |
+
tmp_dir = self.mkdtemp()
|
| 93 |
+
os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
|
| 94 |
+
pkg_dir = os.path.join(tmp_dir, 'foo')
|
| 95 |
+
os.mkdir(pkg_dir)
|
| 96 |
+
self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
|
| 97 |
+
self.write_file((pkg_dir, 'foo.py'), '#')
|
| 98 |
+
self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
|
| 99 |
+
self.write_file((pkg_dir, 'README'), '')
|
| 100 |
+
|
| 101 |
+
dist = Distribution({
|
| 102 |
+
'name': 'foo',
|
| 103 |
+
'version': '0.1',
|
| 104 |
+
'py_modules': ['foo'],
|
| 105 |
+
'url': 'xxx',
|
| 106 |
+
'author': 'xxx',
|
| 107 |
+
'author_email': 'xxx',
|
| 108 |
+
})
|
| 109 |
+
dist.script_name = 'setup.py'
|
| 110 |
+
os.chdir(pkg_dir)
|
| 111 |
+
|
| 112 |
+
sys.argv = ['setup.py']
|
| 113 |
+
cmd = bdist_rpm(dist)
|
| 114 |
+
cmd.fix_python = True
|
| 115 |
+
|
| 116 |
+
cmd.quiet = True
|
| 117 |
+
cmd.ensure_finalized()
|
| 118 |
+
cmd.run()
|
| 119 |
+
|
| 120 |
+
dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
|
| 121 |
+
assert 'foo-0.1-1.noarch.rpm' in dist_created
|
| 122 |
+
|
| 123 |
+
# bug #2945: upload ignores bdist_rpm files
|
| 124 |
+
assert ('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm') in dist.dist_files
|
| 125 |
+
assert ('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm') in dist.dist_files
|
| 126 |
+
|
| 127 |
+
os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.build."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import sys
|
| 5 |
+
from distutils.command.build import build
|
| 6 |
+
from distutils.tests import support
|
| 7 |
+
from sysconfig import get_config_var, get_platform
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class TestBuild(support.TempdirManager):
|
| 11 |
+
def test_finalize_options(self):
|
| 12 |
+
pkg_dir, dist = self.create_dist()
|
| 13 |
+
cmd = build(dist)
|
| 14 |
+
cmd.finalize_options()
|
| 15 |
+
|
| 16 |
+
# if not specified, plat_name gets the current platform
|
| 17 |
+
assert cmd.plat_name == get_platform()
|
| 18 |
+
|
| 19 |
+
# build_purelib is build + lib
|
| 20 |
+
wanted = os.path.join(cmd.build_base, 'lib')
|
| 21 |
+
assert cmd.build_purelib == wanted
|
| 22 |
+
|
| 23 |
+
# build_platlib is 'build/lib.platform-cache_tag[-pydebug]'
|
| 24 |
+
# examples:
|
| 25 |
+
# build/lib.macosx-10.3-i386-cpython39
|
| 26 |
+
plat_spec = f'.{cmd.plat_name}-{sys.implementation.cache_tag}'
|
| 27 |
+
if get_config_var('Py_GIL_DISABLED'):
|
| 28 |
+
plat_spec += 't'
|
| 29 |
+
if hasattr(sys, 'gettotalrefcount'):
|
| 30 |
+
assert cmd.build_platlib.endswith('-pydebug')
|
| 31 |
+
plat_spec += '-pydebug'
|
| 32 |
+
wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
|
| 33 |
+
assert cmd.build_platlib == wanted
|
| 34 |
+
|
| 35 |
+
# by default, build_lib = build_purelib
|
| 36 |
+
assert cmd.build_lib == cmd.build_purelib
|
| 37 |
+
|
| 38 |
+
# build_temp is build/temp.<plat>
|
| 39 |
+
wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
|
| 40 |
+
assert cmd.build_temp == wanted
|
| 41 |
+
|
| 42 |
+
# build_scripts is build/scripts-x.x
|
| 43 |
+
wanted = os.path.join(
|
| 44 |
+
cmd.build_base, f'scripts-{sys.version_info.major}.{sys.version_info.minor}'
|
| 45 |
+
)
|
| 46 |
+
assert cmd.build_scripts == wanted
|
| 47 |
+
|
| 48 |
+
# executable is os.path.normpath(sys.executable)
|
| 49 |
+
assert cmd.executable == os.path.normpath(sys.executable)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_clib.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.build_clib."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
from distutils.command.build_clib import build_clib
|
| 5 |
+
from distutils.errors import DistutilsSetupError
|
| 6 |
+
from distutils.tests import missing_compiler_executable, support
|
| 7 |
+
|
| 8 |
+
import pytest
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class TestBuildCLib(support.TempdirManager):
|
| 12 |
+
def test_check_library_dist(self):
|
| 13 |
+
pkg_dir, dist = self.create_dist()
|
| 14 |
+
cmd = build_clib(dist)
|
| 15 |
+
|
| 16 |
+
# 'libraries' option must be a list
|
| 17 |
+
with pytest.raises(DistutilsSetupError):
|
| 18 |
+
cmd.check_library_list('foo')
|
| 19 |
+
|
| 20 |
+
# each element of 'libraries' must a 2-tuple
|
| 21 |
+
with pytest.raises(DistutilsSetupError):
|
| 22 |
+
cmd.check_library_list(['foo1', 'foo2'])
|
| 23 |
+
|
| 24 |
+
# first element of each tuple in 'libraries'
|
| 25 |
+
# must be a string (the library name)
|
| 26 |
+
with pytest.raises(DistutilsSetupError):
|
| 27 |
+
cmd.check_library_list([(1, 'foo1'), ('name', 'foo2')])
|
| 28 |
+
|
| 29 |
+
# library name may not contain directory separators
|
| 30 |
+
with pytest.raises(DistutilsSetupError):
|
| 31 |
+
cmd.check_library_list(
|
| 32 |
+
[('name', 'foo1'), ('another/name', 'foo2')],
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
# second element of each tuple must be a dictionary (build info)
|
| 36 |
+
with pytest.raises(DistutilsSetupError):
|
| 37 |
+
cmd.check_library_list(
|
| 38 |
+
[('name', {}), ('another', 'foo2')],
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# those work
|
| 42 |
+
libs = [('name', {}), ('name', {'ok': 'good'})]
|
| 43 |
+
cmd.check_library_list(libs)
|
| 44 |
+
|
| 45 |
+
def test_get_source_files(self):
|
| 46 |
+
pkg_dir, dist = self.create_dist()
|
| 47 |
+
cmd = build_clib(dist)
|
| 48 |
+
|
| 49 |
+
# "in 'libraries' option 'sources' must be present and must be
|
| 50 |
+
# a list of source filenames
|
| 51 |
+
cmd.libraries = [('name', {})]
|
| 52 |
+
with pytest.raises(DistutilsSetupError):
|
| 53 |
+
cmd.get_source_files()
|
| 54 |
+
|
| 55 |
+
cmd.libraries = [('name', {'sources': 1})]
|
| 56 |
+
with pytest.raises(DistutilsSetupError):
|
| 57 |
+
cmd.get_source_files()
|
| 58 |
+
|
| 59 |
+
cmd.libraries = [('name', {'sources': ['a', 'b']})]
|
| 60 |
+
assert cmd.get_source_files() == ['a', 'b']
|
| 61 |
+
|
| 62 |
+
cmd.libraries = [('name', {'sources': ('a', 'b')})]
|
| 63 |
+
assert cmd.get_source_files() == ['a', 'b']
|
| 64 |
+
|
| 65 |
+
cmd.libraries = [
|
| 66 |
+
('name', {'sources': ('a', 'b')}),
|
| 67 |
+
('name2', {'sources': ['c', 'd']}),
|
| 68 |
+
]
|
| 69 |
+
assert cmd.get_source_files() == ['a', 'b', 'c', 'd']
|
| 70 |
+
|
| 71 |
+
def test_build_libraries(self):
|
| 72 |
+
pkg_dir, dist = self.create_dist()
|
| 73 |
+
cmd = build_clib(dist)
|
| 74 |
+
|
| 75 |
+
class FakeCompiler:
|
| 76 |
+
def compile(*args, **kw):
|
| 77 |
+
pass
|
| 78 |
+
|
| 79 |
+
create_static_lib = compile
|
| 80 |
+
|
| 81 |
+
cmd.compiler = FakeCompiler()
|
| 82 |
+
|
| 83 |
+
# build_libraries is also doing a bit of typo checking
|
| 84 |
+
lib = [('name', {'sources': 'notvalid'})]
|
| 85 |
+
with pytest.raises(DistutilsSetupError):
|
| 86 |
+
cmd.build_libraries(lib)
|
| 87 |
+
|
| 88 |
+
lib = [('name', {'sources': list()})]
|
| 89 |
+
cmd.build_libraries(lib)
|
| 90 |
+
|
| 91 |
+
lib = [('name', {'sources': tuple()})]
|
| 92 |
+
cmd.build_libraries(lib)
|
| 93 |
+
|
| 94 |
+
def test_finalize_options(self):
|
| 95 |
+
pkg_dir, dist = self.create_dist()
|
| 96 |
+
cmd = build_clib(dist)
|
| 97 |
+
|
| 98 |
+
cmd.include_dirs = 'one-dir'
|
| 99 |
+
cmd.finalize_options()
|
| 100 |
+
assert cmd.include_dirs == ['one-dir']
|
| 101 |
+
|
| 102 |
+
cmd.include_dirs = None
|
| 103 |
+
cmd.finalize_options()
|
| 104 |
+
assert cmd.include_dirs == []
|
| 105 |
+
|
| 106 |
+
cmd.distribution.libraries = 'WONTWORK'
|
| 107 |
+
with pytest.raises(DistutilsSetupError):
|
| 108 |
+
cmd.finalize_options()
|
| 109 |
+
|
| 110 |
+
@pytest.mark.skipif('platform.system() == "Windows"')
|
| 111 |
+
def test_run(self):
|
| 112 |
+
pkg_dir, dist = self.create_dist()
|
| 113 |
+
cmd = build_clib(dist)
|
| 114 |
+
|
| 115 |
+
foo_c = os.path.join(pkg_dir, 'foo.c')
|
| 116 |
+
self.write_file(foo_c, 'int main(void) { return 1;}\n')
|
| 117 |
+
cmd.libraries = [('foo', {'sources': [foo_c]})]
|
| 118 |
+
|
| 119 |
+
build_temp = os.path.join(pkg_dir, 'build')
|
| 120 |
+
os.mkdir(build_temp)
|
| 121 |
+
cmd.build_temp = build_temp
|
| 122 |
+
cmd.build_clib = build_temp
|
| 123 |
+
|
| 124 |
+
# Before we run the command, we want to make sure
|
| 125 |
+
# all commands are present on the system.
|
| 126 |
+
ccmd = missing_compiler_executable()
|
| 127 |
+
if ccmd is not None:
|
| 128 |
+
self.skipTest(f'The {ccmd!r} command is not found')
|
| 129 |
+
|
| 130 |
+
# this should work
|
| 131 |
+
cmd.run()
|
| 132 |
+
|
| 133 |
+
# let's check the result
|
| 134 |
+
assert 'libfoo.a' in os.listdir(build_temp)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_ext.py
ADDED
|
@@ -0,0 +1,628 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import contextlib
|
| 2 |
+
import glob
|
| 3 |
+
import importlib
|
| 4 |
+
import os.path
|
| 5 |
+
import platform
|
| 6 |
+
import re
|
| 7 |
+
import shutil
|
| 8 |
+
import site
|
| 9 |
+
import subprocess
|
| 10 |
+
import sys
|
| 11 |
+
import tempfile
|
| 12 |
+
import textwrap
|
| 13 |
+
import time
|
| 14 |
+
from distutils import sysconfig
|
| 15 |
+
from distutils.command.build_ext import build_ext
|
| 16 |
+
from distutils.core import Distribution
|
| 17 |
+
from distutils.errors import (
|
| 18 |
+
CompileError,
|
| 19 |
+
DistutilsPlatformError,
|
| 20 |
+
DistutilsSetupError,
|
| 21 |
+
UnknownFileError,
|
| 22 |
+
)
|
| 23 |
+
from distutils.extension import Extension
|
| 24 |
+
from distutils.tests import missing_compiler_executable
|
| 25 |
+
from distutils.tests.support import TempdirManager, copy_xxmodule_c, fixup_build_ext
|
| 26 |
+
from io import StringIO
|
| 27 |
+
|
| 28 |
+
import jaraco.path
|
| 29 |
+
import path
|
| 30 |
+
import pytest
|
| 31 |
+
from test import support
|
| 32 |
+
|
| 33 |
+
from .compat import py39 as import_helper
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@pytest.fixture()
|
| 37 |
+
def user_site_dir(request):
|
| 38 |
+
self = request.instance
|
| 39 |
+
self.tmp_dir = self.mkdtemp()
|
| 40 |
+
self.tmp_path = path.Path(self.tmp_dir)
|
| 41 |
+
from distutils.command import build_ext
|
| 42 |
+
|
| 43 |
+
orig_user_base = site.USER_BASE
|
| 44 |
+
|
| 45 |
+
site.USER_BASE = self.mkdtemp()
|
| 46 |
+
build_ext.USER_BASE = site.USER_BASE
|
| 47 |
+
|
| 48 |
+
# bpo-30132: On Windows, a .pdb file may be created in the current
|
| 49 |
+
# working directory. Create a temporary working directory to cleanup
|
| 50 |
+
# everything at the end of the test.
|
| 51 |
+
with self.tmp_path:
|
| 52 |
+
yield
|
| 53 |
+
|
| 54 |
+
site.USER_BASE = orig_user_base
|
| 55 |
+
build_ext.USER_BASE = orig_user_base
|
| 56 |
+
|
| 57 |
+
if sys.platform == 'cygwin':
|
| 58 |
+
time.sleep(1)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
@contextlib.contextmanager
|
| 62 |
+
def safe_extension_import(name, path):
|
| 63 |
+
with import_helper.CleanImport(name):
|
| 64 |
+
with extension_redirect(name, path) as new_path:
|
| 65 |
+
with import_helper.DirsOnSysPath(new_path):
|
| 66 |
+
yield
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
@contextlib.contextmanager
|
| 70 |
+
def extension_redirect(mod, path):
|
| 71 |
+
"""
|
| 72 |
+
Tests will fail to tear down an extension module if it's been imported.
|
| 73 |
+
|
| 74 |
+
Before importing, copy the file to a temporary directory that won't
|
| 75 |
+
be cleaned up. Yield the new path.
|
| 76 |
+
"""
|
| 77 |
+
if platform.system() != "Windows" and sys.platform != "cygwin":
|
| 78 |
+
yield path
|
| 79 |
+
return
|
| 80 |
+
with import_helper.DirsOnSysPath(path):
|
| 81 |
+
spec = importlib.util.find_spec(mod)
|
| 82 |
+
filename = os.path.basename(spec.origin)
|
| 83 |
+
trash_dir = tempfile.mkdtemp(prefix='deleteme')
|
| 84 |
+
dest = os.path.join(trash_dir, os.path.basename(filename))
|
| 85 |
+
shutil.copy(spec.origin, dest)
|
| 86 |
+
yield trash_dir
|
| 87 |
+
# TODO: can the file be scheduled for deletion?
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
@pytest.mark.usefixtures('user_site_dir')
|
| 91 |
+
class TestBuildExt(TempdirManager):
|
| 92 |
+
def build_ext(self, *args, **kwargs):
|
| 93 |
+
return build_ext(*args, **kwargs)
|
| 94 |
+
|
| 95 |
+
@pytest.mark.parametrize("copy_so", [False])
|
| 96 |
+
def test_build_ext(self, copy_so):
|
| 97 |
+
missing_compiler_executable()
|
| 98 |
+
copy_xxmodule_c(self.tmp_dir)
|
| 99 |
+
xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
|
| 100 |
+
xx_ext = Extension('xx', [xx_c])
|
| 101 |
+
if sys.platform != "win32":
|
| 102 |
+
if not copy_so:
|
| 103 |
+
xx_ext = Extension(
|
| 104 |
+
'xx',
|
| 105 |
+
[xx_c],
|
| 106 |
+
library_dirs=['/usr/lib'],
|
| 107 |
+
libraries=['z'],
|
| 108 |
+
runtime_library_dirs=['/usr/lib'],
|
| 109 |
+
)
|
| 110 |
+
elif sys.platform == 'linux':
|
| 111 |
+
libz_so = {
|
| 112 |
+
os.path.realpath(name) for name in glob.iglob('/usr/lib*/libz.so*')
|
| 113 |
+
}
|
| 114 |
+
libz_so = sorted(libz_so, key=lambda lib_path: len(lib_path))
|
| 115 |
+
shutil.copyfile(libz_so[-1], '/tmp/libxx_z.so')
|
| 116 |
+
|
| 117 |
+
xx_ext = Extension(
|
| 118 |
+
'xx',
|
| 119 |
+
[xx_c],
|
| 120 |
+
library_dirs=['/tmp'],
|
| 121 |
+
libraries=['xx_z'],
|
| 122 |
+
runtime_library_dirs=['/tmp'],
|
| 123 |
+
)
|
| 124 |
+
dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]})
|
| 125 |
+
dist.package_dir = self.tmp_dir
|
| 126 |
+
cmd = self.build_ext(dist)
|
| 127 |
+
fixup_build_ext(cmd)
|
| 128 |
+
cmd.build_lib = self.tmp_dir
|
| 129 |
+
cmd.build_temp = self.tmp_dir
|
| 130 |
+
|
| 131 |
+
old_stdout = sys.stdout
|
| 132 |
+
if not support.verbose:
|
| 133 |
+
# silence compiler output
|
| 134 |
+
sys.stdout = StringIO()
|
| 135 |
+
try:
|
| 136 |
+
cmd.ensure_finalized()
|
| 137 |
+
cmd.run()
|
| 138 |
+
finally:
|
| 139 |
+
sys.stdout = old_stdout
|
| 140 |
+
|
| 141 |
+
with safe_extension_import('xx', self.tmp_dir):
|
| 142 |
+
self._test_xx(copy_so)
|
| 143 |
+
|
| 144 |
+
if sys.platform == 'linux' and copy_so:
|
| 145 |
+
os.unlink('/tmp/libxx_z.so')
|
| 146 |
+
|
| 147 |
+
@staticmethod
|
| 148 |
+
def _test_xx(copy_so):
|
| 149 |
+
import xx # type: ignore[import-not-found] # Module generated for tests
|
| 150 |
+
|
| 151 |
+
for attr in ('error', 'foo', 'new', 'roj'):
|
| 152 |
+
assert hasattr(xx, attr)
|
| 153 |
+
|
| 154 |
+
assert xx.foo(2, 5) == 7
|
| 155 |
+
assert xx.foo(13, 15) == 28
|
| 156 |
+
assert xx.new().demo() is None
|
| 157 |
+
if support.HAVE_DOCSTRINGS:
|
| 158 |
+
doc = 'This is a template module just for instruction.'
|
| 159 |
+
assert xx.__doc__ == doc
|
| 160 |
+
assert isinstance(xx.Null(), xx.Null)
|
| 161 |
+
assert isinstance(xx.Str(), xx.Str)
|
| 162 |
+
|
| 163 |
+
if sys.platform == 'linux':
|
| 164 |
+
so_headers = subprocess.check_output(
|
| 165 |
+
["readelf", "-d", xx.__file__], universal_newlines=True
|
| 166 |
+
)
|
| 167 |
+
import pprint
|
| 168 |
+
|
| 169 |
+
pprint.pprint(so_headers)
|
| 170 |
+
rpaths = [
|
| 171 |
+
rpath
|
| 172 |
+
for line in so_headers.split("\n")
|
| 173 |
+
if "RPATH" in line or "RUNPATH" in line
|
| 174 |
+
for rpath in line.split()[2][1:-1].split(":")
|
| 175 |
+
]
|
| 176 |
+
if not copy_so:
|
| 177 |
+
pprint.pprint(rpaths)
|
| 178 |
+
# Linked against a library in /usr/lib{,64}
|
| 179 |
+
assert "/usr/lib" not in rpaths and "/usr/lib64" not in rpaths
|
| 180 |
+
else:
|
| 181 |
+
# Linked against a library in /tmp
|
| 182 |
+
assert "/tmp" in rpaths
|
| 183 |
+
# The import is the real test here
|
| 184 |
+
|
| 185 |
+
def test_solaris_enable_shared(self):
|
| 186 |
+
dist = Distribution({'name': 'xx'})
|
| 187 |
+
cmd = self.build_ext(dist)
|
| 188 |
+
old = sys.platform
|
| 189 |
+
|
| 190 |
+
sys.platform = 'sunos' # fooling finalize_options
|
| 191 |
+
from distutils.sysconfig import _config_vars
|
| 192 |
+
|
| 193 |
+
old_var = _config_vars.get('Py_ENABLE_SHARED')
|
| 194 |
+
_config_vars['Py_ENABLE_SHARED'] = True
|
| 195 |
+
try:
|
| 196 |
+
cmd.ensure_finalized()
|
| 197 |
+
finally:
|
| 198 |
+
sys.platform = old
|
| 199 |
+
if old_var is None:
|
| 200 |
+
del _config_vars['Py_ENABLE_SHARED']
|
| 201 |
+
else:
|
| 202 |
+
_config_vars['Py_ENABLE_SHARED'] = old_var
|
| 203 |
+
|
| 204 |
+
# make sure we get some library dirs under solaris
|
| 205 |
+
assert len(cmd.library_dirs) > 0
|
| 206 |
+
|
| 207 |
+
def test_user_site(self):
|
| 208 |
+
import site
|
| 209 |
+
|
| 210 |
+
dist = Distribution({'name': 'xx'})
|
| 211 |
+
cmd = self.build_ext(dist)
|
| 212 |
+
|
| 213 |
+
# making sure the user option is there
|
| 214 |
+
options = [name for name, short, label in cmd.user_options]
|
| 215 |
+
assert 'user' in options
|
| 216 |
+
|
| 217 |
+
# setting a value
|
| 218 |
+
cmd.user = True
|
| 219 |
+
|
| 220 |
+
# setting user based lib and include
|
| 221 |
+
lib = os.path.join(site.USER_BASE, 'lib')
|
| 222 |
+
incl = os.path.join(site.USER_BASE, 'include')
|
| 223 |
+
os.mkdir(lib)
|
| 224 |
+
os.mkdir(incl)
|
| 225 |
+
|
| 226 |
+
# let's run finalize
|
| 227 |
+
cmd.ensure_finalized()
|
| 228 |
+
|
| 229 |
+
# see if include_dirs and library_dirs
|
| 230 |
+
# were set
|
| 231 |
+
assert lib in cmd.library_dirs
|
| 232 |
+
assert lib in cmd.rpath
|
| 233 |
+
assert incl in cmd.include_dirs
|
| 234 |
+
|
| 235 |
+
def test_optional_extension(self):
|
| 236 |
+
# this extension will fail, but let's ignore this failure
|
| 237 |
+
# with the optional argument.
|
| 238 |
+
modules = [Extension('foo', ['xxx'], optional=False)]
|
| 239 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 240 |
+
cmd = self.build_ext(dist)
|
| 241 |
+
cmd.ensure_finalized()
|
| 242 |
+
with pytest.raises((UnknownFileError, CompileError)):
|
| 243 |
+
cmd.run() # should raise an error
|
| 244 |
+
|
| 245 |
+
modules = [Extension('foo', ['xxx'], optional=True)]
|
| 246 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 247 |
+
cmd = self.build_ext(dist)
|
| 248 |
+
cmd.ensure_finalized()
|
| 249 |
+
cmd.run() # should pass
|
| 250 |
+
|
| 251 |
+
def test_finalize_options(self):
|
| 252 |
+
# Make sure Python's include directories (for Python.h, pyconfig.h,
|
| 253 |
+
# etc.) are in the include search path.
|
| 254 |
+
modules = [Extension('foo', ['xxx'], optional=False)]
|
| 255 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 256 |
+
cmd = self.build_ext(dist)
|
| 257 |
+
cmd.finalize_options()
|
| 258 |
+
|
| 259 |
+
py_include = sysconfig.get_python_inc()
|
| 260 |
+
for p in py_include.split(os.path.pathsep):
|
| 261 |
+
assert p in cmd.include_dirs
|
| 262 |
+
|
| 263 |
+
plat_py_include = sysconfig.get_python_inc(plat_specific=True)
|
| 264 |
+
for p in plat_py_include.split(os.path.pathsep):
|
| 265 |
+
assert p in cmd.include_dirs
|
| 266 |
+
|
| 267 |
+
# make sure cmd.libraries is turned into a list
|
| 268 |
+
# if it's a string
|
| 269 |
+
cmd = self.build_ext(dist)
|
| 270 |
+
cmd.libraries = 'my_lib, other_lib lastlib'
|
| 271 |
+
cmd.finalize_options()
|
| 272 |
+
assert cmd.libraries == ['my_lib', 'other_lib', 'lastlib']
|
| 273 |
+
|
| 274 |
+
# make sure cmd.library_dirs is turned into a list
|
| 275 |
+
# if it's a string
|
| 276 |
+
cmd = self.build_ext(dist)
|
| 277 |
+
cmd.library_dirs = f'my_lib_dir{os.pathsep}other_lib_dir'
|
| 278 |
+
cmd.finalize_options()
|
| 279 |
+
assert 'my_lib_dir' in cmd.library_dirs
|
| 280 |
+
assert 'other_lib_dir' in cmd.library_dirs
|
| 281 |
+
|
| 282 |
+
# make sure rpath is turned into a list
|
| 283 |
+
# if it's a string
|
| 284 |
+
cmd = self.build_ext(dist)
|
| 285 |
+
cmd.rpath = f'one{os.pathsep}two'
|
| 286 |
+
cmd.finalize_options()
|
| 287 |
+
assert cmd.rpath == ['one', 'two']
|
| 288 |
+
|
| 289 |
+
# make sure cmd.link_objects is turned into a list
|
| 290 |
+
# if it's a string
|
| 291 |
+
cmd = build_ext(dist)
|
| 292 |
+
cmd.link_objects = 'one two,three'
|
| 293 |
+
cmd.finalize_options()
|
| 294 |
+
assert cmd.link_objects == ['one', 'two', 'three']
|
| 295 |
+
|
| 296 |
+
# XXX more tests to perform for win32
|
| 297 |
+
|
| 298 |
+
# make sure define is turned into 2-tuples
|
| 299 |
+
# strings if they are ','-separated strings
|
| 300 |
+
cmd = self.build_ext(dist)
|
| 301 |
+
cmd.define = 'one,two'
|
| 302 |
+
cmd.finalize_options()
|
| 303 |
+
assert cmd.define == [('one', '1'), ('two', '1')]
|
| 304 |
+
|
| 305 |
+
# make sure undef is turned into a list of
|
| 306 |
+
# strings if they are ','-separated strings
|
| 307 |
+
cmd = self.build_ext(dist)
|
| 308 |
+
cmd.undef = 'one,two'
|
| 309 |
+
cmd.finalize_options()
|
| 310 |
+
assert cmd.undef == ['one', 'two']
|
| 311 |
+
|
| 312 |
+
# make sure swig_opts is turned into a list
|
| 313 |
+
cmd = self.build_ext(dist)
|
| 314 |
+
cmd.swig_opts = None
|
| 315 |
+
cmd.finalize_options()
|
| 316 |
+
assert cmd.swig_opts == []
|
| 317 |
+
|
| 318 |
+
cmd = self.build_ext(dist)
|
| 319 |
+
cmd.swig_opts = '1 2'
|
| 320 |
+
cmd.finalize_options()
|
| 321 |
+
assert cmd.swig_opts == ['1', '2']
|
| 322 |
+
|
| 323 |
+
def test_check_extensions_list(self):
|
| 324 |
+
dist = Distribution()
|
| 325 |
+
cmd = self.build_ext(dist)
|
| 326 |
+
cmd.finalize_options()
|
| 327 |
+
|
| 328 |
+
# 'extensions' option must be a list of Extension instances
|
| 329 |
+
with pytest.raises(DistutilsSetupError):
|
| 330 |
+
cmd.check_extensions_list('foo')
|
| 331 |
+
|
| 332 |
+
# each element of 'ext_modules' option must be an
|
| 333 |
+
# Extension instance or 2-tuple
|
| 334 |
+
exts = [('bar', 'foo', 'bar'), 'foo']
|
| 335 |
+
with pytest.raises(DistutilsSetupError):
|
| 336 |
+
cmd.check_extensions_list(exts)
|
| 337 |
+
|
| 338 |
+
# first element of each tuple in 'ext_modules'
|
| 339 |
+
# must be the extension name (a string) and match
|
| 340 |
+
# a python dotted-separated name
|
| 341 |
+
exts = [('foo-bar', '')]
|
| 342 |
+
with pytest.raises(DistutilsSetupError):
|
| 343 |
+
cmd.check_extensions_list(exts)
|
| 344 |
+
|
| 345 |
+
# second element of each tuple in 'ext_modules'
|
| 346 |
+
# must be a dictionary (build info)
|
| 347 |
+
exts = [('foo.bar', '')]
|
| 348 |
+
with pytest.raises(DistutilsSetupError):
|
| 349 |
+
cmd.check_extensions_list(exts)
|
| 350 |
+
|
| 351 |
+
# ok this one should pass
|
| 352 |
+
exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', 'some': 'bar'})]
|
| 353 |
+
cmd.check_extensions_list(exts)
|
| 354 |
+
ext = exts[0]
|
| 355 |
+
assert isinstance(ext, Extension)
|
| 356 |
+
|
| 357 |
+
# check_extensions_list adds in ext the values passed
|
| 358 |
+
# when they are in ('include_dirs', 'library_dirs', 'libraries'
|
| 359 |
+
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
|
| 360 |
+
assert ext.libraries == 'foo'
|
| 361 |
+
assert not hasattr(ext, 'some')
|
| 362 |
+
|
| 363 |
+
# 'macros' element of build info dict must be 1- or 2-tuple
|
| 364 |
+
exts = [
|
| 365 |
+
(
|
| 366 |
+
'foo.bar',
|
| 367 |
+
{
|
| 368 |
+
'sources': [''],
|
| 369 |
+
'libraries': 'foo',
|
| 370 |
+
'some': 'bar',
|
| 371 |
+
'macros': [('1', '2', '3'), 'foo'],
|
| 372 |
+
},
|
| 373 |
+
)
|
| 374 |
+
]
|
| 375 |
+
with pytest.raises(DistutilsSetupError):
|
| 376 |
+
cmd.check_extensions_list(exts)
|
| 377 |
+
|
| 378 |
+
exts[0][1]['macros'] = [('1', '2'), ('3',)]
|
| 379 |
+
cmd.check_extensions_list(exts)
|
| 380 |
+
assert exts[0].undef_macros == ['3']
|
| 381 |
+
assert exts[0].define_macros == [('1', '2')]
|
| 382 |
+
|
| 383 |
+
def test_get_source_files(self):
|
| 384 |
+
modules = [Extension('foo', ['xxx'], optional=False)]
|
| 385 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 386 |
+
cmd = self.build_ext(dist)
|
| 387 |
+
cmd.ensure_finalized()
|
| 388 |
+
assert cmd.get_source_files() == ['xxx']
|
| 389 |
+
|
| 390 |
+
def test_unicode_module_names(self):
|
| 391 |
+
modules = [
|
| 392 |
+
Extension('foo', ['aaa'], optional=False),
|
| 393 |
+
Extension('föö', ['uuu'], optional=False),
|
| 394 |
+
]
|
| 395 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 396 |
+
cmd = self.build_ext(dist)
|
| 397 |
+
cmd.ensure_finalized()
|
| 398 |
+
assert re.search(r'foo(_d)?\..*', cmd.get_ext_filename(modules[0].name))
|
| 399 |
+
assert re.search(r'föö(_d)?\..*', cmd.get_ext_filename(modules[1].name))
|
| 400 |
+
assert cmd.get_export_symbols(modules[0]) == ['PyInit_foo']
|
| 401 |
+
assert cmd.get_export_symbols(modules[1]) == ['PyInitU_f_1gaa']
|
| 402 |
+
|
| 403 |
+
def test_export_symbols__init__(self):
|
| 404 |
+
# https://github.com/python/cpython/issues/80074
|
| 405 |
+
# https://github.com/pypa/setuptools/issues/4826
|
| 406 |
+
modules = [
|
| 407 |
+
Extension('foo.__init__', ['aaa']),
|
| 408 |
+
Extension('föö.__init__', ['uuu']),
|
| 409 |
+
]
|
| 410 |
+
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
| 411 |
+
cmd = self.build_ext(dist)
|
| 412 |
+
cmd.ensure_finalized()
|
| 413 |
+
assert cmd.get_export_symbols(modules[0]) == ['PyInit_foo']
|
| 414 |
+
assert cmd.get_export_symbols(modules[1]) == ['PyInitU_f_1gaa']
|
| 415 |
+
|
| 416 |
+
def test_compiler_option(self):
|
| 417 |
+
# cmd.compiler is an option and
|
| 418 |
+
# should not be overridden by a compiler instance
|
| 419 |
+
# when the command is run
|
| 420 |
+
dist = Distribution()
|
| 421 |
+
cmd = self.build_ext(dist)
|
| 422 |
+
cmd.compiler = 'unix'
|
| 423 |
+
cmd.ensure_finalized()
|
| 424 |
+
cmd.run()
|
| 425 |
+
assert cmd.compiler == 'unix'
|
| 426 |
+
|
| 427 |
+
def test_get_outputs(self):
|
| 428 |
+
missing_compiler_executable()
|
| 429 |
+
tmp_dir = self.mkdtemp()
|
| 430 |
+
c_file = os.path.join(tmp_dir, 'foo.c')
|
| 431 |
+
self.write_file(c_file, 'void PyInit_foo(void) {}\n')
|
| 432 |
+
ext = Extension('foo', [c_file], optional=False)
|
| 433 |
+
dist = Distribution({'name': 'xx', 'ext_modules': [ext]})
|
| 434 |
+
cmd = self.build_ext(dist)
|
| 435 |
+
fixup_build_ext(cmd)
|
| 436 |
+
cmd.ensure_finalized()
|
| 437 |
+
assert len(cmd.get_outputs()) == 1
|
| 438 |
+
|
| 439 |
+
cmd.build_lib = os.path.join(self.tmp_dir, 'build')
|
| 440 |
+
cmd.build_temp = os.path.join(self.tmp_dir, 'tempt')
|
| 441 |
+
|
| 442 |
+
# issue #5977 : distutils build_ext.get_outputs
|
| 443 |
+
# returns wrong result with --inplace
|
| 444 |
+
other_tmp_dir = os.path.realpath(self.mkdtemp())
|
| 445 |
+
old_wd = os.getcwd()
|
| 446 |
+
os.chdir(other_tmp_dir)
|
| 447 |
+
try:
|
| 448 |
+
cmd.inplace = True
|
| 449 |
+
cmd.run()
|
| 450 |
+
so_file = cmd.get_outputs()[0]
|
| 451 |
+
finally:
|
| 452 |
+
os.chdir(old_wd)
|
| 453 |
+
assert os.path.exists(so_file)
|
| 454 |
+
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
| 455 |
+
assert so_file.endswith(ext_suffix)
|
| 456 |
+
so_dir = os.path.dirname(so_file)
|
| 457 |
+
assert so_dir == other_tmp_dir
|
| 458 |
+
|
| 459 |
+
cmd.inplace = False
|
| 460 |
+
cmd.compiler = None
|
| 461 |
+
cmd.run()
|
| 462 |
+
so_file = cmd.get_outputs()[0]
|
| 463 |
+
assert os.path.exists(so_file)
|
| 464 |
+
assert so_file.endswith(ext_suffix)
|
| 465 |
+
so_dir = os.path.dirname(so_file)
|
| 466 |
+
assert so_dir == cmd.build_lib
|
| 467 |
+
|
| 468 |
+
# inplace = False, cmd.package = 'bar'
|
| 469 |
+
build_py = cmd.get_finalized_command('build_py')
|
| 470 |
+
build_py.package_dir = {'': 'bar'}
|
| 471 |
+
path = cmd.get_ext_fullpath('foo')
|
| 472 |
+
# checking that the last directory is the build_dir
|
| 473 |
+
path = os.path.split(path)[0]
|
| 474 |
+
assert path == cmd.build_lib
|
| 475 |
+
|
| 476 |
+
# inplace = True, cmd.package = 'bar'
|
| 477 |
+
cmd.inplace = True
|
| 478 |
+
other_tmp_dir = os.path.realpath(self.mkdtemp())
|
| 479 |
+
old_wd = os.getcwd()
|
| 480 |
+
os.chdir(other_tmp_dir)
|
| 481 |
+
try:
|
| 482 |
+
path = cmd.get_ext_fullpath('foo')
|
| 483 |
+
finally:
|
| 484 |
+
os.chdir(old_wd)
|
| 485 |
+
# checking that the last directory is bar
|
| 486 |
+
path = os.path.split(path)[0]
|
| 487 |
+
lastdir = os.path.split(path)[-1]
|
| 488 |
+
assert lastdir == 'bar'
|
| 489 |
+
|
| 490 |
+
def test_ext_fullpath(self):
|
| 491 |
+
ext = sysconfig.get_config_var('EXT_SUFFIX')
|
| 492 |
+
# building lxml.etree inplace
|
| 493 |
+
# etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c')
|
| 494 |
+
# etree_ext = Extension('lxml.etree', [etree_c])
|
| 495 |
+
# dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]})
|
| 496 |
+
dist = Distribution()
|
| 497 |
+
cmd = self.build_ext(dist)
|
| 498 |
+
cmd.inplace = True
|
| 499 |
+
cmd.distribution.package_dir = {'': 'src'}
|
| 500 |
+
cmd.distribution.packages = ['lxml', 'lxml.html']
|
| 501 |
+
curdir = os.getcwd()
|
| 502 |
+
wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
|
| 503 |
+
path = cmd.get_ext_fullpath('lxml.etree')
|
| 504 |
+
assert wanted == path
|
| 505 |
+
|
| 506 |
+
# building lxml.etree not inplace
|
| 507 |
+
cmd.inplace = False
|
| 508 |
+
cmd.build_lib = os.path.join(curdir, 'tmpdir')
|
| 509 |
+
wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
|
| 510 |
+
path = cmd.get_ext_fullpath('lxml.etree')
|
| 511 |
+
assert wanted == path
|
| 512 |
+
|
| 513 |
+
# building twisted.runner.portmap not inplace
|
| 514 |
+
build_py = cmd.get_finalized_command('build_py')
|
| 515 |
+
build_py.package_dir = {}
|
| 516 |
+
cmd.distribution.packages = ['twisted', 'twisted.runner.portmap']
|
| 517 |
+
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
| 518 |
+
wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner', 'portmap' + ext)
|
| 519 |
+
assert wanted == path
|
| 520 |
+
|
| 521 |
+
# building twisted.runner.portmap inplace
|
| 522 |
+
cmd.inplace = True
|
| 523 |
+
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
| 524 |
+
wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
|
| 525 |
+
assert wanted == path
|
| 526 |
+
|
| 527 |
+
@pytest.mark.skipif('platform.system() != "Darwin"')
|
| 528 |
+
@pytest.mark.usefixtures('save_env')
|
| 529 |
+
def test_deployment_target_default(self):
|
| 530 |
+
# Issue 9516: Test that, in the absence of the environment variable,
|
| 531 |
+
# an extension module is compiled with the same deployment target as
|
| 532 |
+
# the interpreter.
|
| 533 |
+
self._try_compile_deployment_target('==', None)
|
| 534 |
+
|
| 535 |
+
@pytest.mark.skipif('platform.system() != "Darwin"')
|
| 536 |
+
@pytest.mark.usefixtures('save_env')
|
| 537 |
+
def test_deployment_target_too_low(self):
|
| 538 |
+
# Issue 9516: Test that an extension module is not allowed to be
|
| 539 |
+
# compiled with a deployment target less than that of the interpreter.
|
| 540 |
+
with pytest.raises(DistutilsPlatformError):
|
| 541 |
+
self._try_compile_deployment_target('>', '10.1')
|
| 542 |
+
|
| 543 |
+
@pytest.mark.skipif('platform.system() != "Darwin"')
|
| 544 |
+
@pytest.mark.usefixtures('save_env')
|
| 545 |
+
def test_deployment_target_higher_ok(self): # pragma: no cover
|
| 546 |
+
# Issue 9516: Test that an extension module can be compiled with a
|
| 547 |
+
# deployment target higher than that of the interpreter: the ext
|
| 548 |
+
# module may depend on some newer OS feature.
|
| 549 |
+
deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
| 550 |
+
if deptarget:
|
| 551 |
+
# increment the minor version number (i.e. 10.6 -> 10.7)
|
| 552 |
+
deptarget = [int(x) for x in deptarget.split('.')]
|
| 553 |
+
deptarget[-1] += 1
|
| 554 |
+
deptarget = '.'.join(str(i) for i in deptarget)
|
| 555 |
+
self._try_compile_deployment_target('<', deptarget)
|
| 556 |
+
|
| 557 |
+
def _try_compile_deployment_target(self, operator, target): # pragma: no cover
|
| 558 |
+
if target is None:
|
| 559 |
+
if os.environ.get('MACOSX_DEPLOYMENT_TARGET'):
|
| 560 |
+
del os.environ['MACOSX_DEPLOYMENT_TARGET']
|
| 561 |
+
else:
|
| 562 |
+
os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
|
| 563 |
+
|
| 564 |
+
jaraco.path.build(
|
| 565 |
+
{
|
| 566 |
+
'deptargetmodule.c': textwrap.dedent(f"""\
|
| 567 |
+
#include <AvailabilityMacros.h>
|
| 568 |
+
|
| 569 |
+
int dummy;
|
| 570 |
+
|
| 571 |
+
#if TARGET {operator} MAC_OS_X_VERSION_MIN_REQUIRED
|
| 572 |
+
#else
|
| 573 |
+
#error "Unexpected target"
|
| 574 |
+
#endif
|
| 575 |
+
|
| 576 |
+
"""),
|
| 577 |
+
},
|
| 578 |
+
self.tmp_path,
|
| 579 |
+
)
|
| 580 |
+
|
| 581 |
+
# get the deployment target that the interpreter was built with
|
| 582 |
+
target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
| 583 |
+
target = tuple(map(int, target.split('.')[0:2]))
|
| 584 |
+
# format the target value as defined in the Apple
|
| 585 |
+
# Availability Macros. We can't use the macro names since
|
| 586 |
+
# at least one value we test with will not exist yet.
|
| 587 |
+
if target[:2] < (10, 10):
|
| 588 |
+
# for 10.1 through 10.9.x -> "10n0"
|
| 589 |
+
tmpl = '{:02}{:01}0'
|
| 590 |
+
else:
|
| 591 |
+
# for 10.10 and beyond -> "10nn00"
|
| 592 |
+
if len(target) >= 2:
|
| 593 |
+
tmpl = '{:02}{:02}00'
|
| 594 |
+
else:
|
| 595 |
+
# 11 and later can have no minor version (11 instead of 11.0)
|
| 596 |
+
tmpl = '{:02}0000'
|
| 597 |
+
target = tmpl.format(*target)
|
| 598 |
+
deptarget_ext = Extension(
|
| 599 |
+
'deptarget',
|
| 600 |
+
[self.tmp_path / 'deptargetmodule.c'],
|
| 601 |
+
extra_compile_args=[f'-DTARGET={target}'],
|
| 602 |
+
)
|
| 603 |
+
dist = Distribution({'name': 'deptarget', 'ext_modules': [deptarget_ext]})
|
| 604 |
+
dist.package_dir = self.tmp_dir
|
| 605 |
+
cmd = self.build_ext(dist)
|
| 606 |
+
cmd.build_lib = self.tmp_dir
|
| 607 |
+
cmd.build_temp = self.tmp_dir
|
| 608 |
+
|
| 609 |
+
try:
|
| 610 |
+
old_stdout = sys.stdout
|
| 611 |
+
if not support.verbose:
|
| 612 |
+
# silence compiler output
|
| 613 |
+
sys.stdout = StringIO()
|
| 614 |
+
try:
|
| 615 |
+
cmd.ensure_finalized()
|
| 616 |
+
cmd.run()
|
| 617 |
+
finally:
|
| 618 |
+
sys.stdout = old_stdout
|
| 619 |
+
|
| 620 |
+
except CompileError:
|
| 621 |
+
self.fail("Wrong deployment target during compilation")
|
| 622 |
+
|
| 623 |
+
|
| 624 |
+
class TestParallelBuildExt(TestBuildExt):
|
| 625 |
+
def build_ext(self, *args, **kwargs):
|
| 626 |
+
build_ext = super().build_ext(*args, **kwargs)
|
| 627 |
+
build_ext.parallel = True
|
| 628 |
+
return build_ext
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_py.py
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.build_py."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import sys
|
| 5 |
+
from distutils.command.build_py import build_py
|
| 6 |
+
from distutils.core import Distribution
|
| 7 |
+
from distutils.errors import DistutilsFileError
|
| 8 |
+
from distutils.tests import support
|
| 9 |
+
|
| 10 |
+
import jaraco.path
|
| 11 |
+
import pytest
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@support.combine_markers
|
| 15 |
+
class TestBuildPy(support.TempdirManager):
|
| 16 |
+
def test_package_data(self):
|
| 17 |
+
sources = self.mkdtemp()
|
| 18 |
+
jaraco.path.build(
|
| 19 |
+
{
|
| 20 |
+
'__init__.py': "# Pretend this is a package.",
|
| 21 |
+
'README.txt': 'Info about this package',
|
| 22 |
+
},
|
| 23 |
+
sources,
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
destination = self.mkdtemp()
|
| 27 |
+
|
| 28 |
+
dist = Distribution({"packages": ["pkg"], "package_dir": {"pkg": sources}})
|
| 29 |
+
# script_name need not exist, it just need to be initialized
|
| 30 |
+
dist.script_name = os.path.join(sources, "setup.py")
|
| 31 |
+
dist.command_obj["build"] = support.DummyCommand(
|
| 32 |
+
force=False, build_lib=destination
|
| 33 |
+
)
|
| 34 |
+
dist.packages = ["pkg"]
|
| 35 |
+
dist.package_data = {"pkg": ["README.txt"]}
|
| 36 |
+
dist.package_dir = {"pkg": sources}
|
| 37 |
+
|
| 38 |
+
cmd = build_py(dist)
|
| 39 |
+
cmd.compile = True
|
| 40 |
+
cmd.ensure_finalized()
|
| 41 |
+
assert cmd.package_data == dist.package_data
|
| 42 |
+
|
| 43 |
+
cmd.run()
|
| 44 |
+
|
| 45 |
+
# This makes sure the list of outputs includes byte-compiled
|
| 46 |
+
# files for Python modules but not for package data files
|
| 47 |
+
# (there shouldn't *be* byte-code files for those!).
|
| 48 |
+
assert len(cmd.get_outputs()) == 3
|
| 49 |
+
pkgdest = os.path.join(destination, "pkg")
|
| 50 |
+
files = os.listdir(pkgdest)
|
| 51 |
+
pycache_dir = os.path.join(pkgdest, "__pycache__")
|
| 52 |
+
assert "__init__.py" in files
|
| 53 |
+
assert "README.txt" in files
|
| 54 |
+
if sys.dont_write_bytecode:
|
| 55 |
+
assert not os.path.exists(pycache_dir)
|
| 56 |
+
else:
|
| 57 |
+
pyc_files = os.listdir(pycache_dir)
|
| 58 |
+
assert f"__init__.{sys.implementation.cache_tag}.pyc" in pyc_files
|
| 59 |
+
|
| 60 |
+
def test_empty_package_dir(self):
|
| 61 |
+
# See bugs #1668596/#1720897
|
| 62 |
+
sources = self.mkdtemp()
|
| 63 |
+
jaraco.path.build({'__init__.py': '', 'doc': {'testfile': ''}}, sources)
|
| 64 |
+
|
| 65 |
+
os.chdir(sources)
|
| 66 |
+
dist = Distribution({
|
| 67 |
+
"packages": ["pkg"],
|
| 68 |
+
"package_dir": {"pkg": ""},
|
| 69 |
+
"package_data": {"pkg": ["doc/*"]},
|
| 70 |
+
})
|
| 71 |
+
# script_name need not exist, it just need to be initialized
|
| 72 |
+
dist.script_name = os.path.join(sources, "setup.py")
|
| 73 |
+
dist.script_args = ["build"]
|
| 74 |
+
dist.parse_command_line()
|
| 75 |
+
|
| 76 |
+
try:
|
| 77 |
+
dist.run_commands()
|
| 78 |
+
except DistutilsFileError:
|
| 79 |
+
self.fail("failed package_data test when package_dir is ''")
|
| 80 |
+
|
| 81 |
+
@pytest.mark.skipif('sys.dont_write_bytecode')
|
| 82 |
+
def test_byte_compile(self):
|
| 83 |
+
project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
|
| 84 |
+
os.chdir(project_dir)
|
| 85 |
+
self.write_file('boiledeggs.py', 'import antigravity')
|
| 86 |
+
cmd = build_py(dist)
|
| 87 |
+
cmd.compile = True
|
| 88 |
+
cmd.build_lib = 'here'
|
| 89 |
+
cmd.finalize_options()
|
| 90 |
+
cmd.run()
|
| 91 |
+
|
| 92 |
+
found = os.listdir(cmd.build_lib)
|
| 93 |
+
assert sorted(found) == ['__pycache__', 'boiledeggs.py']
|
| 94 |
+
found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
|
| 95 |
+
assert found == [f'boiledeggs.{sys.implementation.cache_tag}.pyc']
|
| 96 |
+
|
| 97 |
+
@pytest.mark.skipif('sys.dont_write_bytecode')
|
| 98 |
+
def test_byte_compile_optimized(self):
|
| 99 |
+
project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
|
| 100 |
+
os.chdir(project_dir)
|
| 101 |
+
self.write_file('boiledeggs.py', 'import antigravity')
|
| 102 |
+
cmd = build_py(dist)
|
| 103 |
+
cmd.compile = False
|
| 104 |
+
cmd.optimize = 1
|
| 105 |
+
cmd.build_lib = 'here'
|
| 106 |
+
cmd.finalize_options()
|
| 107 |
+
cmd.run()
|
| 108 |
+
|
| 109 |
+
found = os.listdir(cmd.build_lib)
|
| 110 |
+
assert sorted(found) == ['__pycache__', 'boiledeggs.py']
|
| 111 |
+
found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
|
| 112 |
+
expect = f'boiledeggs.{sys.implementation.cache_tag}.opt-1.pyc'
|
| 113 |
+
assert sorted(found) == [expect]
|
| 114 |
+
|
| 115 |
+
def test_dir_in_package_data(self):
|
| 116 |
+
"""
|
| 117 |
+
A directory in package_data should not be added to the filelist.
|
| 118 |
+
"""
|
| 119 |
+
# See bug 19286
|
| 120 |
+
sources = self.mkdtemp()
|
| 121 |
+
jaraco.path.build(
|
| 122 |
+
{
|
| 123 |
+
'pkg': {
|
| 124 |
+
'__init__.py': '',
|
| 125 |
+
'doc': {
|
| 126 |
+
'testfile': '',
|
| 127 |
+
# create a directory that could be incorrectly detected as a file
|
| 128 |
+
'otherdir': {},
|
| 129 |
+
},
|
| 130 |
+
}
|
| 131 |
+
},
|
| 132 |
+
sources,
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
os.chdir(sources)
|
| 136 |
+
dist = Distribution({"packages": ["pkg"], "package_data": {"pkg": ["doc/*"]}})
|
| 137 |
+
# script_name need not exist, it just need to be initialized
|
| 138 |
+
dist.script_name = os.path.join(sources, "setup.py")
|
| 139 |
+
dist.script_args = ["build"]
|
| 140 |
+
dist.parse_command_line()
|
| 141 |
+
|
| 142 |
+
try:
|
| 143 |
+
dist.run_commands()
|
| 144 |
+
except DistutilsFileError:
|
| 145 |
+
self.fail("failed package_data when data dir includes a dir")
|
| 146 |
+
|
| 147 |
+
def test_dont_write_bytecode(self, caplog):
|
| 148 |
+
# makes sure byte_compile is not used
|
| 149 |
+
dist = self.create_dist()[1]
|
| 150 |
+
cmd = build_py(dist)
|
| 151 |
+
cmd.compile = True
|
| 152 |
+
cmd.optimize = 1
|
| 153 |
+
|
| 154 |
+
old_dont_write_bytecode = sys.dont_write_bytecode
|
| 155 |
+
sys.dont_write_bytecode = True
|
| 156 |
+
try:
|
| 157 |
+
cmd.byte_compile([])
|
| 158 |
+
finally:
|
| 159 |
+
sys.dont_write_bytecode = old_dont_write_bytecode
|
| 160 |
+
|
| 161 |
+
assert 'byte-compiling is disabled' in caplog.records[0].message
|
| 162 |
+
|
| 163 |
+
def test_namespace_package_does_not_warn(self, caplog):
|
| 164 |
+
"""
|
| 165 |
+
Originally distutils implementation did not account for PEP 420
|
| 166 |
+
and included warns for package directories that did not contain
|
| 167 |
+
``__init__.py`` files.
|
| 168 |
+
After the acceptance of PEP 420, these warnings don't make more sense
|
| 169 |
+
so we want to ensure there are not displayed to not confuse the users.
|
| 170 |
+
"""
|
| 171 |
+
# Create a fake project structure with a package namespace:
|
| 172 |
+
tmp = self.mkdtemp()
|
| 173 |
+
jaraco.path.build({'ns': {'pkg': {'module.py': ''}}}, tmp)
|
| 174 |
+
os.chdir(tmp)
|
| 175 |
+
|
| 176 |
+
# Configure the package:
|
| 177 |
+
attrs = {
|
| 178 |
+
"name": "ns.pkg",
|
| 179 |
+
"packages": ["ns", "ns.pkg"],
|
| 180 |
+
"script_name": "setup.py",
|
| 181 |
+
}
|
| 182 |
+
dist = Distribution(attrs)
|
| 183 |
+
|
| 184 |
+
# Run code paths that would trigger the trap:
|
| 185 |
+
cmd = dist.get_command_obj("build_py")
|
| 186 |
+
cmd.finalize_options()
|
| 187 |
+
modules = cmd.find_all_modules()
|
| 188 |
+
assert len(modules) == 1
|
| 189 |
+
module_path = modules[0][-1]
|
| 190 |
+
assert module_path.replace(os.sep, "/") == "ns/pkg/module.py"
|
| 191 |
+
|
| 192 |
+
cmd.run()
|
| 193 |
+
|
| 194 |
+
assert not any(
|
| 195 |
+
"package init file" in msg and "not found" in msg for msg in caplog.messages
|
| 196 |
+
)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_build_scripts.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.build_scripts."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import textwrap
|
| 5 |
+
from distutils import sysconfig
|
| 6 |
+
from distutils.command.build_scripts import build_scripts
|
| 7 |
+
from distutils.core import Distribution
|
| 8 |
+
from distutils.tests import support
|
| 9 |
+
|
| 10 |
+
import jaraco.path
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class TestBuildScripts(support.TempdirManager):
|
| 14 |
+
def test_default_settings(self):
|
| 15 |
+
cmd = self.get_build_scripts_cmd("/foo/bar", [])
|
| 16 |
+
assert not cmd.force
|
| 17 |
+
assert cmd.build_dir is None
|
| 18 |
+
|
| 19 |
+
cmd.finalize_options()
|
| 20 |
+
|
| 21 |
+
assert cmd.force
|
| 22 |
+
assert cmd.build_dir == "/foo/bar"
|
| 23 |
+
|
| 24 |
+
def test_build(self):
|
| 25 |
+
source = self.mkdtemp()
|
| 26 |
+
target = self.mkdtemp()
|
| 27 |
+
expected = self.write_sample_scripts(source)
|
| 28 |
+
|
| 29 |
+
cmd = self.get_build_scripts_cmd(
|
| 30 |
+
target, [os.path.join(source, fn) for fn in expected]
|
| 31 |
+
)
|
| 32 |
+
cmd.finalize_options()
|
| 33 |
+
cmd.run()
|
| 34 |
+
|
| 35 |
+
built = os.listdir(target)
|
| 36 |
+
for name in expected:
|
| 37 |
+
assert name in built
|
| 38 |
+
|
| 39 |
+
def get_build_scripts_cmd(self, target, scripts):
|
| 40 |
+
import sys
|
| 41 |
+
|
| 42 |
+
dist = Distribution()
|
| 43 |
+
dist.scripts = scripts
|
| 44 |
+
dist.command_obj["build"] = support.DummyCommand(
|
| 45 |
+
build_scripts=target, force=True, executable=sys.executable
|
| 46 |
+
)
|
| 47 |
+
return build_scripts(dist)
|
| 48 |
+
|
| 49 |
+
@staticmethod
|
| 50 |
+
def write_sample_scripts(dir):
|
| 51 |
+
spec = {
|
| 52 |
+
'script1.py': textwrap.dedent("""
|
| 53 |
+
#! /usr/bin/env python2.3
|
| 54 |
+
# bogus script w/ Python sh-bang
|
| 55 |
+
pass
|
| 56 |
+
""").lstrip(),
|
| 57 |
+
'script2.py': textwrap.dedent("""
|
| 58 |
+
#!/usr/bin/python
|
| 59 |
+
# bogus script w/ Python sh-bang
|
| 60 |
+
pass
|
| 61 |
+
""").lstrip(),
|
| 62 |
+
'shell.sh': textwrap.dedent("""
|
| 63 |
+
#!/bin/sh
|
| 64 |
+
# bogus shell script w/ sh-bang
|
| 65 |
+
exit 0
|
| 66 |
+
""").lstrip(),
|
| 67 |
+
}
|
| 68 |
+
jaraco.path.build(spec, dir)
|
| 69 |
+
return list(spec)
|
| 70 |
+
|
| 71 |
+
def test_version_int(self):
|
| 72 |
+
source = self.mkdtemp()
|
| 73 |
+
target = self.mkdtemp()
|
| 74 |
+
expected = self.write_sample_scripts(source)
|
| 75 |
+
|
| 76 |
+
cmd = self.get_build_scripts_cmd(
|
| 77 |
+
target, [os.path.join(source, fn) for fn in expected]
|
| 78 |
+
)
|
| 79 |
+
cmd.finalize_options()
|
| 80 |
+
|
| 81 |
+
# https://bugs.python.org/issue4524
|
| 82 |
+
#
|
| 83 |
+
# On linux-g++-32 with command line `./configure --enable-ipv6
|
| 84 |
+
# --with-suffix=3`, python is compiled okay but the build scripts
|
| 85 |
+
# failed when writing the name of the executable
|
| 86 |
+
old = sysconfig.get_config_vars().get('VERSION')
|
| 87 |
+
sysconfig._config_vars['VERSION'] = 4
|
| 88 |
+
try:
|
| 89 |
+
cmd.run()
|
| 90 |
+
finally:
|
| 91 |
+
if old is not None:
|
| 92 |
+
sysconfig._config_vars['VERSION'] = old
|
| 93 |
+
|
| 94 |
+
built = os.listdir(target)
|
| 95 |
+
for name in expected:
|
| 96 |
+
assert name in built
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_check.py
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.check."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import textwrap
|
| 5 |
+
from distutils.command.check import check
|
| 6 |
+
from distutils.errors import DistutilsSetupError
|
| 7 |
+
from distutils.tests import support
|
| 8 |
+
|
| 9 |
+
import pytest
|
| 10 |
+
|
| 11 |
+
try:
|
| 12 |
+
import pygments
|
| 13 |
+
except ImportError:
|
| 14 |
+
pygments = None
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
HERE = os.path.dirname(__file__)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
@support.combine_markers
|
| 21 |
+
class TestCheck(support.TempdirManager):
|
| 22 |
+
def _run(self, metadata=None, cwd=None, **options):
|
| 23 |
+
if metadata is None:
|
| 24 |
+
metadata = {}
|
| 25 |
+
if cwd is not None:
|
| 26 |
+
old_dir = os.getcwd()
|
| 27 |
+
os.chdir(cwd)
|
| 28 |
+
pkg_info, dist = self.create_dist(**metadata)
|
| 29 |
+
cmd = check(dist)
|
| 30 |
+
cmd.initialize_options()
|
| 31 |
+
for name, value in options.items():
|
| 32 |
+
setattr(cmd, name, value)
|
| 33 |
+
cmd.ensure_finalized()
|
| 34 |
+
cmd.run()
|
| 35 |
+
if cwd is not None:
|
| 36 |
+
os.chdir(old_dir)
|
| 37 |
+
return cmd
|
| 38 |
+
|
| 39 |
+
def test_check_metadata(self):
|
| 40 |
+
# let's run the command with no metadata at all
|
| 41 |
+
# by default, check is checking the metadata
|
| 42 |
+
# should have some warnings
|
| 43 |
+
cmd = self._run()
|
| 44 |
+
assert cmd._warnings == 1
|
| 45 |
+
|
| 46 |
+
# now let's add the required fields
|
| 47 |
+
# and run it again, to make sure we don't get
|
| 48 |
+
# any warning anymore
|
| 49 |
+
metadata = {
|
| 50 |
+
'url': 'xxx',
|
| 51 |
+
'author': 'xxx',
|
| 52 |
+
'author_email': 'xxx',
|
| 53 |
+
'name': 'xxx',
|
| 54 |
+
'version': 'xxx',
|
| 55 |
+
}
|
| 56 |
+
cmd = self._run(metadata)
|
| 57 |
+
assert cmd._warnings == 0
|
| 58 |
+
|
| 59 |
+
# now with the strict mode, we should
|
| 60 |
+
# get an error if there are missing metadata
|
| 61 |
+
with pytest.raises(DistutilsSetupError):
|
| 62 |
+
self._run({}, **{'strict': 1})
|
| 63 |
+
|
| 64 |
+
# and of course, no error when all metadata are present
|
| 65 |
+
cmd = self._run(metadata, strict=True)
|
| 66 |
+
assert cmd._warnings == 0
|
| 67 |
+
|
| 68 |
+
# now a test with non-ASCII characters
|
| 69 |
+
metadata = {
|
| 70 |
+
'url': 'xxx',
|
| 71 |
+
'author': '\u00c9ric',
|
| 72 |
+
'author_email': 'xxx',
|
| 73 |
+
'name': 'xxx',
|
| 74 |
+
'version': 'xxx',
|
| 75 |
+
'description': 'Something about esszet \u00df',
|
| 76 |
+
'long_description': 'More things about esszet \u00df',
|
| 77 |
+
}
|
| 78 |
+
cmd = self._run(metadata)
|
| 79 |
+
assert cmd._warnings == 0
|
| 80 |
+
|
| 81 |
+
def test_check_author_maintainer(self):
|
| 82 |
+
for kind in ("author", "maintainer"):
|
| 83 |
+
# ensure no warning when author_email or maintainer_email is given
|
| 84 |
+
# (the spec allows these fields to take the form "Name <email>")
|
| 85 |
+
metadata = {
|
| 86 |
+
'url': 'xxx',
|
| 87 |
+
kind + '_email': 'Name <name@email.com>',
|
| 88 |
+
'name': 'xxx',
|
| 89 |
+
'version': 'xxx',
|
| 90 |
+
}
|
| 91 |
+
cmd = self._run(metadata)
|
| 92 |
+
assert cmd._warnings == 0
|
| 93 |
+
|
| 94 |
+
# the check should not warn if only email is given
|
| 95 |
+
metadata[kind + '_email'] = 'name@email.com'
|
| 96 |
+
cmd = self._run(metadata)
|
| 97 |
+
assert cmd._warnings == 0
|
| 98 |
+
|
| 99 |
+
# the check should not warn if only the name is given
|
| 100 |
+
metadata[kind] = "Name"
|
| 101 |
+
del metadata[kind + '_email']
|
| 102 |
+
cmd = self._run(metadata)
|
| 103 |
+
assert cmd._warnings == 0
|
| 104 |
+
|
| 105 |
+
def test_check_document(self):
|
| 106 |
+
pytest.importorskip('docutils')
|
| 107 |
+
pkg_info, dist = self.create_dist()
|
| 108 |
+
cmd = check(dist)
|
| 109 |
+
|
| 110 |
+
# let's see if it detects broken rest
|
| 111 |
+
broken_rest = 'title\n===\n\ntest'
|
| 112 |
+
msgs = cmd._check_rst_data(broken_rest)
|
| 113 |
+
assert len(msgs) == 1
|
| 114 |
+
|
| 115 |
+
# and non-broken rest
|
| 116 |
+
rest = 'title\n=====\n\ntest'
|
| 117 |
+
msgs = cmd._check_rst_data(rest)
|
| 118 |
+
assert len(msgs) == 0
|
| 119 |
+
|
| 120 |
+
def test_check_restructuredtext(self):
|
| 121 |
+
pytest.importorskip('docutils')
|
| 122 |
+
# let's see if it detects broken rest in long_description
|
| 123 |
+
broken_rest = 'title\n===\n\ntest'
|
| 124 |
+
pkg_info, dist = self.create_dist(long_description=broken_rest)
|
| 125 |
+
cmd = check(dist)
|
| 126 |
+
cmd.check_restructuredtext()
|
| 127 |
+
assert cmd._warnings == 1
|
| 128 |
+
|
| 129 |
+
# let's see if we have an error with strict=True
|
| 130 |
+
metadata = {
|
| 131 |
+
'url': 'xxx',
|
| 132 |
+
'author': 'xxx',
|
| 133 |
+
'author_email': 'xxx',
|
| 134 |
+
'name': 'xxx',
|
| 135 |
+
'version': 'xxx',
|
| 136 |
+
'long_description': broken_rest,
|
| 137 |
+
}
|
| 138 |
+
with pytest.raises(DistutilsSetupError):
|
| 139 |
+
self._run(metadata, **{'strict': 1, 'restructuredtext': 1})
|
| 140 |
+
|
| 141 |
+
# and non-broken rest, including a non-ASCII character to test #12114
|
| 142 |
+
metadata['long_description'] = 'title\n=====\n\ntest \u00df'
|
| 143 |
+
cmd = self._run(metadata, strict=True, restructuredtext=True)
|
| 144 |
+
assert cmd._warnings == 0
|
| 145 |
+
|
| 146 |
+
# check that includes work to test #31292
|
| 147 |
+
metadata['long_description'] = 'title\n=====\n\n.. include:: includetest.rst'
|
| 148 |
+
cmd = self._run(metadata, cwd=HERE, strict=True, restructuredtext=True)
|
| 149 |
+
assert cmd._warnings == 0
|
| 150 |
+
|
| 151 |
+
def test_check_restructuredtext_with_syntax_highlight(self):
|
| 152 |
+
pytest.importorskip('docutils')
|
| 153 |
+
# Don't fail if there is a `code` or `code-block` directive
|
| 154 |
+
|
| 155 |
+
example_rst_docs = [
|
| 156 |
+
textwrap.dedent(
|
| 157 |
+
"""\
|
| 158 |
+
Here's some code:
|
| 159 |
+
|
| 160 |
+
.. code:: python
|
| 161 |
+
|
| 162 |
+
def foo():
|
| 163 |
+
pass
|
| 164 |
+
"""
|
| 165 |
+
),
|
| 166 |
+
textwrap.dedent(
|
| 167 |
+
"""\
|
| 168 |
+
Here's some code:
|
| 169 |
+
|
| 170 |
+
.. code-block:: python
|
| 171 |
+
|
| 172 |
+
def foo():
|
| 173 |
+
pass
|
| 174 |
+
"""
|
| 175 |
+
),
|
| 176 |
+
]
|
| 177 |
+
|
| 178 |
+
for rest_with_code in example_rst_docs:
|
| 179 |
+
pkg_info, dist = self.create_dist(long_description=rest_with_code)
|
| 180 |
+
cmd = check(dist)
|
| 181 |
+
cmd.check_restructuredtext()
|
| 182 |
+
msgs = cmd._check_rst_data(rest_with_code)
|
| 183 |
+
if pygments is not None:
|
| 184 |
+
assert len(msgs) == 0
|
| 185 |
+
else:
|
| 186 |
+
assert len(msgs) == 1
|
| 187 |
+
assert (
|
| 188 |
+
str(msgs[0][1])
|
| 189 |
+
== 'Cannot analyze code. Pygments package not found.'
|
| 190 |
+
)
|
| 191 |
+
|
| 192 |
+
def test_check_all(self):
|
| 193 |
+
with pytest.raises(DistutilsSetupError):
|
| 194 |
+
self._run({}, **{'strict': 1, 'restructuredtext': 1})
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_clean.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.clean."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
from distutils.command.clean import clean
|
| 5 |
+
from distutils.tests import support
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class TestClean(support.TempdirManager):
|
| 9 |
+
def test_simple_run(self):
|
| 10 |
+
pkg_dir, dist = self.create_dist()
|
| 11 |
+
cmd = clean(dist)
|
| 12 |
+
|
| 13 |
+
# let's add some elements clean should remove
|
| 14 |
+
dirs = [
|
| 15 |
+
(d, os.path.join(pkg_dir, d))
|
| 16 |
+
for d in (
|
| 17 |
+
'build_temp',
|
| 18 |
+
'build_lib',
|
| 19 |
+
'bdist_base',
|
| 20 |
+
'build_scripts',
|
| 21 |
+
'build_base',
|
| 22 |
+
)
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
for name, path in dirs:
|
| 26 |
+
os.mkdir(path)
|
| 27 |
+
setattr(cmd, name, path)
|
| 28 |
+
if name == 'build_base':
|
| 29 |
+
continue
|
| 30 |
+
for f in ('one', 'two', 'three'):
|
| 31 |
+
self.write_file(os.path.join(path, f))
|
| 32 |
+
|
| 33 |
+
# let's run the command
|
| 34 |
+
cmd.all = 1
|
| 35 |
+
cmd.ensure_finalized()
|
| 36 |
+
cmd.run()
|
| 37 |
+
|
| 38 |
+
# make sure the files where removed
|
| 39 |
+
for _name, path in dirs:
|
| 40 |
+
assert not os.path.exists(path), f'{path} was not removed'
|
| 41 |
+
|
| 42 |
+
# let's run the command again (should spit warnings but succeed)
|
| 43 |
+
cmd.all = 1
|
| 44 |
+
cmd.ensure_finalized()
|
| 45 |
+
cmd.run()
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_cmd.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.cmd."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
from distutils import debug
|
| 5 |
+
from distutils.cmd import Command
|
| 6 |
+
from distutils.dist import Distribution
|
| 7 |
+
from distutils.errors import DistutilsOptionError
|
| 8 |
+
|
| 9 |
+
import pytest
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class MyCmd(Command):
|
| 13 |
+
def initialize_options(self):
|
| 14 |
+
pass
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
@pytest.fixture
|
| 18 |
+
def cmd(request):
|
| 19 |
+
return MyCmd(Distribution())
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class TestCommand:
|
| 23 |
+
def test_ensure_string_list(self, cmd):
|
| 24 |
+
cmd.not_string_list = ['one', 2, 'three']
|
| 25 |
+
cmd.yes_string_list = ['one', 'two', 'three']
|
| 26 |
+
cmd.not_string_list2 = object()
|
| 27 |
+
cmd.yes_string_list2 = 'ok'
|
| 28 |
+
cmd.ensure_string_list('yes_string_list')
|
| 29 |
+
cmd.ensure_string_list('yes_string_list2')
|
| 30 |
+
|
| 31 |
+
with pytest.raises(DistutilsOptionError):
|
| 32 |
+
cmd.ensure_string_list('not_string_list')
|
| 33 |
+
|
| 34 |
+
with pytest.raises(DistutilsOptionError):
|
| 35 |
+
cmd.ensure_string_list('not_string_list2')
|
| 36 |
+
|
| 37 |
+
cmd.option1 = 'ok,dok'
|
| 38 |
+
cmd.ensure_string_list('option1')
|
| 39 |
+
assert cmd.option1 == ['ok', 'dok']
|
| 40 |
+
|
| 41 |
+
cmd.option2 = ['xxx', 'www']
|
| 42 |
+
cmd.ensure_string_list('option2')
|
| 43 |
+
|
| 44 |
+
cmd.option3 = ['ok', 2]
|
| 45 |
+
with pytest.raises(DistutilsOptionError):
|
| 46 |
+
cmd.ensure_string_list('option3')
|
| 47 |
+
|
| 48 |
+
def test_make_file(self, cmd):
|
| 49 |
+
# making sure it raises when infiles is not a string or a list/tuple
|
| 50 |
+
with pytest.raises(TypeError):
|
| 51 |
+
cmd.make_file(infiles=True, outfile='', func='func', args=())
|
| 52 |
+
|
| 53 |
+
# making sure execute gets called properly
|
| 54 |
+
def _execute(func, args, exec_msg, level):
|
| 55 |
+
assert exec_msg == 'generating out from in'
|
| 56 |
+
|
| 57 |
+
cmd.force = True
|
| 58 |
+
cmd.execute = _execute
|
| 59 |
+
cmd.make_file(infiles='in', outfile='out', func='func', args=())
|
| 60 |
+
|
| 61 |
+
def test_dump_options(self, cmd):
|
| 62 |
+
msgs = []
|
| 63 |
+
|
| 64 |
+
def _announce(msg, level):
|
| 65 |
+
msgs.append(msg)
|
| 66 |
+
|
| 67 |
+
cmd.announce = _announce
|
| 68 |
+
cmd.option1 = 1
|
| 69 |
+
cmd.option2 = 1
|
| 70 |
+
cmd.user_options = [('option1', '', ''), ('option2', '', '')]
|
| 71 |
+
cmd.dump_options()
|
| 72 |
+
|
| 73 |
+
wanted = ["command options for 'MyCmd':", ' option1 = 1', ' option2 = 1']
|
| 74 |
+
assert msgs == wanted
|
| 75 |
+
|
| 76 |
+
def test_ensure_string(self, cmd):
|
| 77 |
+
cmd.option1 = 'ok'
|
| 78 |
+
cmd.ensure_string('option1')
|
| 79 |
+
|
| 80 |
+
cmd.option2 = None
|
| 81 |
+
cmd.ensure_string('option2', 'xxx')
|
| 82 |
+
assert hasattr(cmd, 'option2')
|
| 83 |
+
|
| 84 |
+
cmd.option3 = 1
|
| 85 |
+
with pytest.raises(DistutilsOptionError):
|
| 86 |
+
cmd.ensure_string('option3')
|
| 87 |
+
|
| 88 |
+
def test_ensure_filename(self, cmd):
|
| 89 |
+
cmd.option1 = __file__
|
| 90 |
+
cmd.ensure_filename('option1')
|
| 91 |
+
cmd.option2 = 'xxx'
|
| 92 |
+
with pytest.raises(DistutilsOptionError):
|
| 93 |
+
cmd.ensure_filename('option2')
|
| 94 |
+
|
| 95 |
+
def test_ensure_dirname(self, cmd):
|
| 96 |
+
cmd.option1 = os.path.dirname(__file__) or os.curdir
|
| 97 |
+
cmd.ensure_dirname('option1')
|
| 98 |
+
cmd.option2 = 'xxx'
|
| 99 |
+
with pytest.raises(DistutilsOptionError):
|
| 100 |
+
cmd.ensure_dirname('option2')
|
| 101 |
+
|
| 102 |
+
def test_debug_print(self, cmd, capsys, monkeypatch):
|
| 103 |
+
cmd.debug_print('xxx')
|
| 104 |
+
assert capsys.readouterr().out == ''
|
| 105 |
+
monkeypatch.setattr(debug, 'DEBUG', True)
|
| 106 |
+
cmd.debug_print('xxx')
|
| 107 |
+
assert capsys.readouterr().out == 'xxx\n'
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_config_cmd.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.config."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import sys
|
| 5 |
+
from distutils._log import log
|
| 6 |
+
from distutils.command.config import config, dump_file
|
| 7 |
+
from distutils.tests import missing_compiler_executable, support
|
| 8 |
+
|
| 9 |
+
import more_itertools
|
| 10 |
+
import path
|
| 11 |
+
import pytest
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@pytest.fixture(autouse=True)
|
| 15 |
+
def info_log(request, monkeypatch):
|
| 16 |
+
self = request.instance
|
| 17 |
+
self._logs = []
|
| 18 |
+
monkeypatch.setattr(log, 'info', self._info)
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
@support.combine_markers
|
| 22 |
+
class TestConfig(support.TempdirManager):
|
| 23 |
+
def _info(self, msg, *args):
|
| 24 |
+
for line in msg.splitlines():
|
| 25 |
+
self._logs.append(line)
|
| 26 |
+
|
| 27 |
+
def test_dump_file(self):
|
| 28 |
+
this_file = path.Path(__file__).with_suffix('.py')
|
| 29 |
+
with this_file.open(encoding='utf-8') as f:
|
| 30 |
+
numlines = more_itertools.ilen(f)
|
| 31 |
+
|
| 32 |
+
dump_file(this_file, 'I am the header')
|
| 33 |
+
assert len(self._logs) == numlines + 1
|
| 34 |
+
|
| 35 |
+
@pytest.mark.skipif('platform.system() == "Windows"')
|
| 36 |
+
def test_search_cpp(self):
|
| 37 |
+
cmd = missing_compiler_executable(['preprocessor'])
|
| 38 |
+
if cmd is not None:
|
| 39 |
+
self.skipTest(f'The {cmd!r} command is not found')
|
| 40 |
+
pkg_dir, dist = self.create_dist()
|
| 41 |
+
cmd = config(dist)
|
| 42 |
+
cmd._check_compiler()
|
| 43 |
+
compiler = cmd.compiler
|
| 44 |
+
if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower():
|
| 45 |
+
self.skipTest(
|
| 46 |
+
'xlc: The -E option overrides the -P, -o, and -qsyntaxonly options'
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
# simple pattern searches
|
| 50 |
+
match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
|
| 51 |
+
assert match == 0
|
| 52 |
+
|
| 53 |
+
match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
|
| 54 |
+
assert match == 1
|
| 55 |
+
|
| 56 |
+
def test_finalize_options(self):
|
| 57 |
+
# finalize_options does a bit of transformation
|
| 58 |
+
# on options
|
| 59 |
+
pkg_dir, dist = self.create_dist()
|
| 60 |
+
cmd = config(dist)
|
| 61 |
+
cmd.include_dirs = f'one{os.pathsep}two'
|
| 62 |
+
cmd.libraries = 'one'
|
| 63 |
+
cmd.library_dirs = f'three{os.pathsep}four'
|
| 64 |
+
cmd.ensure_finalized()
|
| 65 |
+
|
| 66 |
+
assert cmd.include_dirs == ['one', 'two']
|
| 67 |
+
assert cmd.libraries == ['one']
|
| 68 |
+
assert cmd.library_dirs == ['three', 'four']
|
| 69 |
+
|
| 70 |
+
def test_clean(self):
|
| 71 |
+
# _clean removes files
|
| 72 |
+
tmp_dir = self.mkdtemp()
|
| 73 |
+
f1 = os.path.join(tmp_dir, 'one')
|
| 74 |
+
f2 = os.path.join(tmp_dir, 'two')
|
| 75 |
+
|
| 76 |
+
self.write_file(f1, 'xxx')
|
| 77 |
+
self.write_file(f2, 'xxx')
|
| 78 |
+
|
| 79 |
+
for f in (f1, f2):
|
| 80 |
+
assert os.path.exists(f)
|
| 81 |
+
|
| 82 |
+
pkg_dir, dist = self.create_dist()
|
| 83 |
+
cmd = config(dist)
|
| 84 |
+
cmd._clean(f1, f2)
|
| 85 |
+
|
| 86 |
+
for f in (f1, f2):
|
| 87 |
+
assert not os.path.exists(f)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_core.py
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.core."""
|
| 2 |
+
|
| 3 |
+
import distutils.core
|
| 4 |
+
import io
|
| 5 |
+
import os
|
| 6 |
+
import sys
|
| 7 |
+
from distutils.dist import Distribution
|
| 8 |
+
|
| 9 |
+
import pytest
|
| 10 |
+
|
| 11 |
+
# setup script that uses __file__
|
| 12 |
+
setup_using___file__ = """\
|
| 13 |
+
|
| 14 |
+
__file__
|
| 15 |
+
|
| 16 |
+
from distutils.core import setup
|
| 17 |
+
setup()
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
setup_prints_cwd = """\
|
| 21 |
+
|
| 22 |
+
import os
|
| 23 |
+
print(os.getcwd())
|
| 24 |
+
|
| 25 |
+
from distutils.core import setup
|
| 26 |
+
setup()
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
setup_does_nothing = """\
|
| 30 |
+
from distutils.core import setup
|
| 31 |
+
setup()
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
setup_defines_subclass = """\
|
| 36 |
+
from distutils.core import setup
|
| 37 |
+
from distutils.command.install import install as _install
|
| 38 |
+
|
| 39 |
+
class install(_install):
|
| 40 |
+
sub_commands = _install.sub_commands + ['cmd']
|
| 41 |
+
|
| 42 |
+
setup(cmdclass={'install': install})
|
| 43 |
+
"""
|
| 44 |
+
|
| 45 |
+
setup_within_if_main = """\
|
| 46 |
+
from distutils.core import setup
|
| 47 |
+
|
| 48 |
+
def main():
|
| 49 |
+
return setup(name="setup_within_if_main")
|
| 50 |
+
|
| 51 |
+
if __name__ == "__main__":
|
| 52 |
+
main()
|
| 53 |
+
"""
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
@pytest.fixture(autouse=True)
|
| 57 |
+
def save_stdout(monkeypatch):
|
| 58 |
+
monkeypatch.setattr(sys, 'stdout', sys.stdout)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
@pytest.fixture
|
| 62 |
+
def temp_file(tmp_path):
|
| 63 |
+
return tmp_path / 'file'
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@pytest.mark.usefixtures('save_env')
|
| 67 |
+
@pytest.mark.usefixtures('save_argv')
|
| 68 |
+
class TestCore:
|
| 69 |
+
def test_run_setup_provides_file(self, temp_file):
|
| 70 |
+
# Make sure the script can use __file__; if that's missing, the test
|
| 71 |
+
# setup.py script will raise NameError.
|
| 72 |
+
temp_file.write_text(setup_using___file__, encoding='utf-8')
|
| 73 |
+
distutils.core.run_setup(temp_file)
|
| 74 |
+
|
| 75 |
+
def test_run_setup_preserves_sys_argv(self, temp_file):
|
| 76 |
+
# Make sure run_setup does not clobber sys.argv
|
| 77 |
+
argv_copy = sys.argv.copy()
|
| 78 |
+
temp_file.write_text(setup_does_nothing, encoding='utf-8')
|
| 79 |
+
distutils.core.run_setup(temp_file)
|
| 80 |
+
assert sys.argv == argv_copy
|
| 81 |
+
|
| 82 |
+
def test_run_setup_defines_subclass(self, temp_file):
|
| 83 |
+
# Make sure the script can use __file__; if that's missing, the test
|
| 84 |
+
# setup.py script will raise NameError.
|
| 85 |
+
temp_file.write_text(setup_defines_subclass, encoding='utf-8')
|
| 86 |
+
dist = distutils.core.run_setup(temp_file)
|
| 87 |
+
install = dist.get_command_obj('install')
|
| 88 |
+
assert 'cmd' in install.sub_commands
|
| 89 |
+
|
| 90 |
+
def test_run_setup_uses_current_dir(self, tmp_path):
|
| 91 |
+
"""
|
| 92 |
+
Test that the setup script is run with the current directory
|
| 93 |
+
as its own current directory.
|
| 94 |
+
"""
|
| 95 |
+
sys.stdout = io.StringIO()
|
| 96 |
+
cwd = os.getcwd()
|
| 97 |
+
|
| 98 |
+
# Create a directory and write the setup.py file there:
|
| 99 |
+
setup_py = tmp_path / 'setup.py'
|
| 100 |
+
setup_py.write_text(setup_prints_cwd, encoding='utf-8')
|
| 101 |
+
distutils.core.run_setup(setup_py)
|
| 102 |
+
|
| 103 |
+
output = sys.stdout.getvalue()
|
| 104 |
+
if output.endswith("\n"):
|
| 105 |
+
output = output[:-1]
|
| 106 |
+
assert cwd == output
|
| 107 |
+
|
| 108 |
+
def test_run_setup_within_if_main(self, temp_file):
|
| 109 |
+
temp_file.write_text(setup_within_if_main, encoding='utf-8')
|
| 110 |
+
dist = distutils.core.run_setup(temp_file, stop_after="config")
|
| 111 |
+
assert isinstance(dist, Distribution)
|
| 112 |
+
assert dist.get_name() == "setup_within_if_main"
|
| 113 |
+
|
| 114 |
+
def test_run_commands(self, temp_file):
|
| 115 |
+
sys.argv = ['setup.py', 'build']
|
| 116 |
+
temp_file.write_text(setup_within_if_main, encoding='utf-8')
|
| 117 |
+
dist = distutils.core.run_setup(temp_file, stop_after="commandline")
|
| 118 |
+
assert 'build' not in dist.have_run
|
| 119 |
+
distutils.core.run_commands(dist)
|
| 120 |
+
assert 'build' in dist.have_run
|
| 121 |
+
|
| 122 |
+
def test_debug_mode(self, capsys, monkeypatch):
|
| 123 |
+
# this covers the code called when DEBUG is set
|
| 124 |
+
sys.argv = ['setup.py', '--name']
|
| 125 |
+
distutils.core.setup(name='bar')
|
| 126 |
+
assert capsys.readouterr().out == 'bar\n'
|
| 127 |
+
monkeypatch.setattr(distutils.core, 'DEBUG', True)
|
| 128 |
+
distutils.core.setup(name='bar')
|
| 129 |
+
wanted = "options (after parsing config files):\n"
|
| 130 |
+
assert capsys.readouterr().out.startswith(wanted)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_dir_util.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.dir_util."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import pathlib
|
| 5 |
+
import stat
|
| 6 |
+
import sys
|
| 7 |
+
import unittest.mock as mock
|
| 8 |
+
from distutils import dir_util, errors
|
| 9 |
+
from distutils.dir_util import (
|
| 10 |
+
copy_tree,
|
| 11 |
+
create_tree,
|
| 12 |
+
ensure_relative,
|
| 13 |
+
mkpath,
|
| 14 |
+
remove_tree,
|
| 15 |
+
)
|
| 16 |
+
from distutils.tests import support
|
| 17 |
+
|
| 18 |
+
import jaraco.path
|
| 19 |
+
import path
|
| 20 |
+
import pytest
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
@pytest.fixture(autouse=True)
|
| 24 |
+
def stuff(request, monkeypatch, distutils_managed_tempdir):
|
| 25 |
+
self = request.instance
|
| 26 |
+
tmp_dir = self.mkdtemp()
|
| 27 |
+
self.root_target = os.path.join(tmp_dir, 'deep')
|
| 28 |
+
self.target = os.path.join(self.root_target, 'here')
|
| 29 |
+
self.target2 = os.path.join(tmp_dir, 'deep2')
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class TestDirUtil(support.TempdirManager):
|
| 33 |
+
def test_mkpath_remove_tree_verbosity(self, caplog):
|
| 34 |
+
mkpath(self.target, verbose=False)
|
| 35 |
+
assert not caplog.records
|
| 36 |
+
remove_tree(self.root_target, verbose=False)
|
| 37 |
+
|
| 38 |
+
mkpath(self.target, verbose=True)
|
| 39 |
+
wanted = [f'creating {self.target}']
|
| 40 |
+
assert caplog.messages == wanted
|
| 41 |
+
caplog.clear()
|
| 42 |
+
|
| 43 |
+
remove_tree(self.root_target, verbose=True)
|
| 44 |
+
wanted = [f"removing '{self.root_target}' (and everything under it)"]
|
| 45 |
+
assert caplog.messages == wanted
|
| 46 |
+
|
| 47 |
+
@pytest.mark.skipif("platform.system() == 'Windows'")
|
| 48 |
+
def test_mkpath_with_custom_mode(self):
|
| 49 |
+
# Get and set the current umask value for testing mode bits.
|
| 50 |
+
umask = os.umask(0o002)
|
| 51 |
+
os.umask(umask)
|
| 52 |
+
mkpath(self.target, 0o700)
|
| 53 |
+
assert stat.S_IMODE(os.stat(self.target).st_mode) == 0o700 & ~umask
|
| 54 |
+
mkpath(self.target2, 0o555)
|
| 55 |
+
assert stat.S_IMODE(os.stat(self.target2).st_mode) == 0o555 & ~umask
|
| 56 |
+
|
| 57 |
+
def test_create_tree_verbosity(self, caplog):
|
| 58 |
+
create_tree(self.root_target, ['one', 'two', 'three'], verbose=False)
|
| 59 |
+
assert caplog.messages == []
|
| 60 |
+
remove_tree(self.root_target, verbose=False)
|
| 61 |
+
|
| 62 |
+
wanted = [f'creating {self.root_target}']
|
| 63 |
+
create_tree(self.root_target, ['one', 'two', 'three'], verbose=True)
|
| 64 |
+
assert caplog.messages == wanted
|
| 65 |
+
|
| 66 |
+
remove_tree(self.root_target, verbose=False)
|
| 67 |
+
|
| 68 |
+
def test_copy_tree_verbosity(self, caplog):
|
| 69 |
+
mkpath(self.target, verbose=False)
|
| 70 |
+
|
| 71 |
+
copy_tree(self.target, self.target2, verbose=False)
|
| 72 |
+
assert caplog.messages == []
|
| 73 |
+
|
| 74 |
+
remove_tree(self.root_target, verbose=False)
|
| 75 |
+
|
| 76 |
+
mkpath(self.target, verbose=False)
|
| 77 |
+
a_file = path.Path(self.target) / 'ok.txt'
|
| 78 |
+
jaraco.path.build({'ok.txt': 'some content'}, self.target)
|
| 79 |
+
|
| 80 |
+
wanted = [f'copying {a_file} -> {self.target2}']
|
| 81 |
+
copy_tree(self.target, self.target2, verbose=True)
|
| 82 |
+
assert caplog.messages == wanted
|
| 83 |
+
|
| 84 |
+
remove_tree(self.root_target, verbose=False)
|
| 85 |
+
remove_tree(self.target2, verbose=False)
|
| 86 |
+
|
| 87 |
+
def test_copy_tree_skips_nfs_temp_files(self):
|
| 88 |
+
mkpath(self.target, verbose=False)
|
| 89 |
+
|
| 90 |
+
jaraco.path.build({'ok.txt': 'some content', '.nfs123abc': ''}, self.target)
|
| 91 |
+
|
| 92 |
+
copy_tree(self.target, self.target2)
|
| 93 |
+
assert os.listdir(self.target2) == ['ok.txt']
|
| 94 |
+
|
| 95 |
+
remove_tree(self.root_target, verbose=False)
|
| 96 |
+
remove_tree(self.target2, verbose=False)
|
| 97 |
+
|
| 98 |
+
def test_ensure_relative(self):
|
| 99 |
+
if os.sep == '/':
|
| 100 |
+
assert ensure_relative('/home/foo') == 'home/foo'
|
| 101 |
+
assert ensure_relative('some/path') == 'some/path'
|
| 102 |
+
else: # \\
|
| 103 |
+
assert ensure_relative('c:\\home\\foo') == 'c:home\\foo'
|
| 104 |
+
assert ensure_relative('home\\foo') == 'home\\foo'
|
| 105 |
+
|
| 106 |
+
def test_copy_tree_exception_in_listdir(self):
|
| 107 |
+
"""
|
| 108 |
+
An exception in listdir should raise a DistutilsFileError
|
| 109 |
+
"""
|
| 110 |
+
with (
|
| 111 |
+
mock.patch("os.listdir", side_effect=OSError()),
|
| 112 |
+
pytest.raises(errors.DistutilsFileError),
|
| 113 |
+
):
|
| 114 |
+
src = self.tempdirs[-1]
|
| 115 |
+
dir_util.copy_tree(src, None)
|
| 116 |
+
|
| 117 |
+
def test_mkpath_exception_uncached(self, monkeypatch, tmp_path):
|
| 118 |
+
"""
|
| 119 |
+
Caching should not remember failed attempts.
|
| 120 |
+
|
| 121 |
+
pypa/distutils#304
|
| 122 |
+
"""
|
| 123 |
+
|
| 124 |
+
class FailPath(pathlib.Path):
|
| 125 |
+
def mkdir(self, *args, **kwargs):
|
| 126 |
+
raise OSError("Failed to create directory")
|
| 127 |
+
|
| 128 |
+
if sys.version_info < (3, 12):
|
| 129 |
+
_flavour = pathlib.Path()._flavour
|
| 130 |
+
|
| 131 |
+
target = tmp_path / 'foodir'
|
| 132 |
+
|
| 133 |
+
with pytest.raises(errors.DistutilsFileError):
|
| 134 |
+
mkpath(FailPath(target))
|
| 135 |
+
|
| 136 |
+
assert not target.exists()
|
| 137 |
+
|
| 138 |
+
mkpath(target)
|
| 139 |
+
assert target.exists()
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_dist.py
ADDED
|
@@ -0,0 +1,552 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.dist."""
|
| 2 |
+
|
| 3 |
+
import email
|
| 4 |
+
import email.generator
|
| 5 |
+
import email.policy
|
| 6 |
+
import functools
|
| 7 |
+
import io
|
| 8 |
+
import os
|
| 9 |
+
import sys
|
| 10 |
+
import textwrap
|
| 11 |
+
import unittest.mock as mock
|
| 12 |
+
import warnings
|
| 13 |
+
from distutils.cmd import Command
|
| 14 |
+
from distutils.dist import Distribution, fix_help_options
|
| 15 |
+
from distutils.tests import support
|
| 16 |
+
from typing import ClassVar
|
| 17 |
+
|
| 18 |
+
import jaraco.path
|
| 19 |
+
import pytest
|
| 20 |
+
|
| 21 |
+
pydistutils_cfg = '.' * (os.name == 'posix') + 'pydistutils.cfg'
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class test_dist(Command):
|
| 25 |
+
"""Sample distutils extension command."""
|
| 26 |
+
|
| 27 |
+
user_options: ClassVar[list[tuple[str, str, str]]] = [
|
| 28 |
+
("sample-option=", "S", "help text"),
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
def initialize_options(self):
|
| 32 |
+
self.sample_option = None
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class TestDistribution(Distribution):
|
| 36 |
+
"""Distribution subclasses that avoids the default search for
|
| 37 |
+
configuration files.
|
| 38 |
+
|
| 39 |
+
The ._config_files attribute must be set before
|
| 40 |
+
.parse_config_files() is called.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
def find_config_files(self):
|
| 44 |
+
return self._config_files
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
@pytest.fixture
|
| 48 |
+
def clear_argv():
|
| 49 |
+
del sys.argv[1:]
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
@support.combine_markers
|
| 53 |
+
@pytest.mark.usefixtures('save_env')
|
| 54 |
+
@pytest.mark.usefixtures('save_argv')
|
| 55 |
+
class TestDistributionBehavior(support.TempdirManager):
|
| 56 |
+
def create_distribution(self, configfiles=()):
|
| 57 |
+
d = TestDistribution()
|
| 58 |
+
d._config_files = configfiles
|
| 59 |
+
d.parse_config_files()
|
| 60 |
+
d.parse_command_line()
|
| 61 |
+
return d
|
| 62 |
+
|
| 63 |
+
def test_command_packages_unspecified(self, clear_argv):
|
| 64 |
+
sys.argv.append("build")
|
| 65 |
+
d = self.create_distribution()
|
| 66 |
+
assert d.get_command_packages() == ["distutils.command"]
|
| 67 |
+
|
| 68 |
+
def test_command_packages_cmdline(self, clear_argv):
|
| 69 |
+
from distutils.tests.test_dist import test_dist
|
| 70 |
+
|
| 71 |
+
sys.argv.extend([
|
| 72 |
+
"--command-packages",
|
| 73 |
+
"foo.bar,distutils.tests",
|
| 74 |
+
"test_dist",
|
| 75 |
+
"-Ssometext",
|
| 76 |
+
])
|
| 77 |
+
d = self.create_distribution()
|
| 78 |
+
# let's actually try to load our test command:
|
| 79 |
+
assert d.get_command_packages() == [
|
| 80 |
+
"distutils.command",
|
| 81 |
+
"foo.bar",
|
| 82 |
+
"distutils.tests",
|
| 83 |
+
]
|
| 84 |
+
cmd = d.get_command_obj("test_dist")
|
| 85 |
+
assert isinstance(cmd, test_dist)
|
| 86 |
+
assert cmd.sample_option == "sometext"
|
| 87 |
+
|
| 88 |
+
@pytest.mark.skipif(
|
| 89 |
+
'distutils' not in Distribution.parse_config_files.__module__,
|
| 90 |
+
reason='Cannot test when virtualenv has monkey-patched Distribution',
|
| 91 |
+
)
|
| 92 |
+
def test_venv_install_options(self, tmp_path, clear_argv):
|
| 93 |
+
sys.argv.append("install")
|
| 94 |
+
file = str(tmp_path / 'file')
|
| 95 |
+
|
| 96 |
+
fakepath = '/somedir'
|
| 97 |
+
|
| 98 |
+
jaraco.path.build({
|
| 99 |
+
file: f"""
|
| 100 |
+
[install]
|
| 101 |
+
install-base = {fakepath}
|
| 102 |
+
install-platbase = {fakepath}
|
| 103 |
+
install-lib = {fakepath}
|
| 104 |
+
install-platlib = {fakepath}
|
| 105 |
+
install-purelib = {fakepath}
|
| 106 |
+
install-headers = {fakepath}
|
| 107 |
+
install-scripts = {fakepath}
|
| 108 |
+
install-data = {fakepath}
|
| 109 |
+
prefix = {fakepath}
|
| 110 |
+
exec-prefix = {fakepath}
|
| 111 |
+
home = {fakepath}
|
| 112 |
+
user = {fakepath}
|
| 113 |
+
root = {fakepath}
|
| 114 |
+
""",
|
| 115 |
+
})
|
| 116 |
+
|
| 117 |
+
# Base case: Not in a Virtual Environment
|
| 118 |
+
with mock.patch.multiple(sys, prefix='/a', base_prefix='/a'):
|
| 119 |
+
d = self.create_distribution([file])
|
| 120 |
+
|
| 121 |
+
option_tuple = (file, fakepath)
|
| 122 |
+
|
| 123 |
+
result_dict = {
|
| 124 |
+
'install_base': option_tuple,
|
| 125 |
+
'install_platbase': option_tuple,
|
| 126 |
+
'install_lib': option_tuple,
|
| 127 |
+
'install_platlib': option_tuple,
|
| 128 |
+
'install_purelib': option_tuple,
|
| 129 |
+
'install_headers': option_tuple,
|
| 130 |
+
'install_scripts': option_tuple,
|
| 131 |
+
'install_data': option_tuple,
|
| 132 |
+
'prefix': option_tuple,
|
| 133 |
+
'exec_prefix': option_tuple,
|
| 134 |
+
'home': option_tuple,
|
| 135 |
+
'user': option_tuple,
|
| 136 |
+
'root': option_tuple,
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
assert sorted(d.command_options.get('install').keys()) == sorted(
|
| 140 |
+
result_dict.keys()
|
| 141 |
+
)
|
| 142 |
+
|
| 143 |
+
for key, value in d.command_options.get('install').items():
|
| 144 |
+
assert value == result_dict[key]
|
| 145 |
+
|
| 146 |
+
# Test case: In a Virtual Environment
|
| 147 |
+
with mock.patch.multiple(sys, prefix='/a', base_prefix='/b'):
|
| 148 |
+
d = self.create_distribution([file])
|
| 149 |
+
|
| 150 |
+
for key in result_dict.keys():
|
| 151 |
+
assert key not in d.command_options.get('install', {})
|
| 152 |
+
|
| 153 |
+
def test_command_packages_configfile(self, tmp_path, clear_argv):
|
| 154 |
+
sys.argv.append("build")
|
| 155 |
+
file = str(tmp_path / "file")
|
| 156 |
+
jaraco.path.build({
|
| 157 |
+
file: """
|
| 158 |
+
[global]
|
| 159 |
+
command_packages = foo.bar, splat
|
| 160 |
+
""",
|
| 161 |
+
})
|
| 162 |
+
|
| 163 |
+
d = self.create_distribution([file])
|
| 164 |
+
assert d.get_command_packages() == ["distutils.command", "foo.bar", "splat"]
|
| 165 |
+
|
| 166 |
+
# ensure command line overrides config:
|
| 167 |
+
sys.argv[1:] = ["--command-packages", "spork", "build"]
|
| 168 |
+
d = self.create_distribution([file])
|
| 169 |
+
assert d.get_command_packages() == ["distutils.command", "spork"]
|
| 170 |
+
|
| 171 |
+
# Setting --command-packages to '' should cause the default to
|
| 172 |
+
# be used even if a config file specified something else:
|
| 173 |
+
sys.argv[1:] = ["--command-packages", "", "build"]
|
| 174 |
+
d = self.create_distribution([file])
|
| 175 |
+
assert d.get_command_packages() == ["distutils.command"]
|
| 176 |
+
|
| 177 |
+
def test_empty_options(self, request):
|
| 178 |
+
# an empty options dictionary should not stay in the
|
| 179 |
+
# list of attributes
|
| 180 |
+
|
| 181 |
+
# catching warnings
|
| 182 |
+
warns = []
|
| 183 |
+
|
| 184 |
+
def _warn(msg):
|
| 185 |
+
warns.append(msg)
|
| 186 |
+
|
| 187 |
+
request.addfinalizer(
|
| 188 |
+
functools.partial(setattr, warnings, 'warn', warnings.warn)
|
| 189 |
+
)
|
| 190 |
+
warnings.warn = _warn
|
| 191 |
+
dist = Distribution(
|
| 192 |
+
attrs={
|
| 193 |
+
'author': 'xxx',
|
| 194 |
+
'name': 'xxx',
|
| 195 |
+
'version': 'xxx',
|
| 196 |
+
'url': 'xxxx',
|
| 197 |
+
'options': {},
|
| 198 |
+
}
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
assert len(warns) == 0
|
| 202 |
+
assert 'options' not in dir(dist)
|
| 203 |
+
|
| 204 |
+
def test_finalize_options(self):
|
| 205 |
+
attrs = {'keywords': 'one,two', 'platforms': 'one,two'}
|
| 206 |
+
|
| 207 |
+
dist = Distribution(attrs=attrs)
|
| 208 |
+
dist.finalize_options()
|
| 209 |
+
|
| 210 |
+
# finalize_option splits platforms and keywords
|
| 211 |
+
assert dist.metadata.platforms == ['one', 'two']
|
| 212 |
+
assert dist.metadata.keywords == ['one', 'two']
|
| 213 |
+
|
| 214 |
+
attrs = {'keywords': 'foo bar', 'platforms': 'foo bar'}
|
| 215 |
+
dist = Distribution(attrs=attrs)
|
| 216 |
+
dist.finalize_options()
|
| 217 |
+
assert dist.metadata.platforms == ['foo bar']
|
| 218 |
+
assert dist.metadata.keywords == ['foo bar']
|
| 219 |
+
|
| 220 |
+
def test_get_command_packages(self):
|
| 221 |
+
dist = Distribution()
|
| 222 |
+
assert dist.command_packages is None
|
| 223 |
+
cmds = dist.get_command_packages()
|
| 224 |
+
assert cmds == ['distutils.command']
|
| 225 |
+
assert dist.command_packages == ['distutils.command']
|
| 226 |
+
|
| 227 |
+
dist.command_packages = 'one,two'
|
| 228 |
+
cmds = dist.get_command_packages()
|
| 229 |
+
assert cmds == ['distutils.command', 'one', 'two']
|
| 230 |
+
|
| 231 |
+
def test_announce(self):
|
| 232 |
+
# make sure the level is known
|
| 233 |
+
dist = Distribution()
|
| 234 |
+
with pytest.raises(TypeError):
|
| 235 |
+
dist.announce('ok', level='ok2')
|
| 236 |
+
|
| 237 |
+
def test_find_config_files_disable(self, temp_home):
|
| 238 |
+
# Ticket #1180: Allow user to disable their home config file.
|
| 239 |
+
jaraco.path.build({pydistutils_cfg: '[distutils]\n'}, temp_home)
|
| 240 |
+
|
| 241 |
+
d = Distribution()
|
| 242 |
+
all_files = d.find_config_files()
|
| 243 |
+
|
| 244 |
+
d = Distribution(attrs={'script_args': ['--no-user-cfg']})
|
| 245 |
+
files = d.find_config_files()
|
| 246 |
+
|
| 247 |
+
# make sure --no-user-cfg disables the user cfg file
|
| 248 |
+
assert len(all_files) - 1 == len(files)
|
| 249 |
+
|
| 250 |
+
def test_script_args_list_coercion(self):
|
| 251 |
+
d = Distribution(attrs={'script_args': ('build', '--no-user-cfg')})
|
| 252 |
+
|
| 253 |
+
# make sure script_args is a list even if it started as a different iterable
|
| 254 |
+
assert d.script_args == ['build', '--no-user-cfg']
|
| 255 |
+
|
| 256 |
+
@pytest.mark.skipif(
|
| 257 |
+
'platform.system() == "Windows"',
|
| 258 |
+
reason='Windows does not honor chmod 000',
|
| 259 |
+
)
|
| 260 |
+
def test_find_config_files_permission_error(self, fake_home):
|
| 261 |
+
"""
|
| 262 |
+
Finding config files should not fail when directory is inaccessible.
|
| 263 |
+
"""
|
| 264 |
+
fake_home.joinpath(pydistutils_cfg).write_text('', encoding='utf-8')
|
| 265 |
+
fake_home.chmod(0o000)
|
| 266 |
+
Distribution().find_config_files()
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
@pytest.mark.usefixtures('save_env')
|
| 270 |
+
@pytest.mark.usefixtures('save_argv')
|
| 271 |
+
class TestMetadata(support.TempdirManager):
|
| 272 |
+
def format_metadata(self, dist):
|
| 273 |
+
sio = io.StringIO()
|
| 274 |
+
dist.metadata.write_pkg_file(sio)
|
| 275 |
+
return sio.getvalue()
|
| 276 |
+
|
| 277 |
+
def test_simple_metadata(self):
|
| 278 |
+
attrs = {"name": "package", "version": "1.0"}
|
| 279 |
+
dist = Distribution(attrs)
|
| 280 |
+
meta = self.format_metadata(dist)
|
| 281 |
+
assert "Metadata-Version: 1.0" in meta
|
| 282 |
+
assert "provides:" not in meta.lower()
|
| 283 |
+
assert "requires:" not in meta.lower()
|
| 284 |
+
assert "obsoletes:" not in meta.lower()
|
| 285 |
+
|
| 286 |
+
def test_provides(self):
|
| 287 |
+
attrs = {
|
| 288 |
+
"name": "package",
|
| 289 |
+
"version": "1.0",
|
| 290 |
+
"provides": ["package", "package.sub"],
|
| 291 |
+
}
|
| 292 |
+
dist = Distribution(attrs)
|
| 293 |
+
assert dist.metadata.get_provides() == ["package", "package.sub"]
|
| 294 |
+
assert dist.get_provides() == ["package", "package.sub"]
|
| 295 |
+
meta = self.format_metadata(dist)
|
| 296 |
+
assert "Metadata-Version: 1.1" in meta
|
| 297 |
+
assert "requires:" not in meta.lower()
|
| 298 |
+
assert "obsoletes:" not in meta.lower()
|
| 299 |
+
|
| 300 |
+
def test_provides_illegal(self):
|
| 301 |
+
with pytest.raises(ValueError):
|
| 302 |
+
Distribution(
|
| 303 |
+
{"name": "package", "version": "1.0", "provides": ["my.pkg (splat)"]},
|
| 304 |
+
)
|
| 305 |
+
|
| 306 |
+
def test_requires(self):
|
| 307 |
+
attrs = {
|
| 308 |
+
"name": "package",
|
| 309 |
+
"version": "1.0",
|
| 310 |
+
"requires": ["other", "another (==1.0)"],
|
| 311 |
+
}
|
| 312 |
+
dist = Distribution(attrs)
|
| 313 |
+
assert dist.metadata.get_requires() == ["other", "another (==1.0)"]
|
| 314 |
+
assert dist.get_requires() == ["other", "another (==1.0)"]
|
| 315 |
+
meta = self.format_metadata(dist)
|
| 316 |
+
assert "Metadata-Version: 1.1" in meta
|
| 317 |
+
assert "provides:" not in meta.lower()
|
| 318 |
+
assert "Requires: other" in meta
|
| 319 |
+
assert "Requires: another (==1.0)" in meta
|
| 320 |
+
assert "obsoletes:" not in meta.lower()
|
| 321 |
+
|
| 322 |
+
def test_requires_illegal(self):
|
| 323 |
+
with pytest.raises(ValueError):
|
| 324 |
+
Distribution(
|
| 325 |
+
{"name": "package", "version": "1.0", "requires": ["my.pkg (splat)"]},
|
| 326 |
+
)
|
| 327 |
+
|
| 328 |
+
def test_requires_to_list(self):
|
| 329 |
+
attrs = {"name": "package", "requires": iter(["other"])}
|
| 330 |
+
dist = Distribution(attrs)
|
| 331 |
+
assert isinstance(dist.metadata.requires, list)
|
| 332 |
+
|
| 333 |
+
def test_obsoletes(self):
|
| 334 |
+
attrs = {
|
| 335 |
+
"name": "package",
|
| 336 |
+
"version": "1.0",
|
| 337 |
+
"obsoletes": ["other", "another (<1.0)"],
|
| 338 |
+
}
|
| 339 |
+
dist = Distribution(attrs)
|
| 340 |
+
assert dist.metadata.get_obsoletes() == ["other", "another (<1.0)"]
|
| 341 |
+
assert dist.get_obsoletes() == ["other", "another (<1.0)"]
|
| 342 |
+
meta = self.format_metadata(dist)
|
| 343 |
+
assert "Metadata-Version: 1.1" in meta
|
| 344 |
+
assert "provides:" not in meta.lower()
|
| 345 |
+
assert "requires:" not in meta.lower()
|
| 346 |
+
assert "Obsoletes: other" in meta
|
| 347 |
+
assert "Obsoletes: another (<1.0)" in meta
|
| 348 |
+
|
| 349 |
+
def test_obsoletes_illegal(self):
|
| 350 |
+
with pytest.raises(ValueError):
|
| 351 |
+
Distribution(
|
| 352 |
+
{"name": "package", "version": "1.0", "obsoletes": ["my.pkg (splat)"]},
|
| 353 |
+
)
|
| 354 |
+
|
| 355 |
+
def test_obsoletes_to_list(self):
|
| 356 |
+
attrs = {"name": "package", "obsoletes": iter(["other"])}
|
| 357 |
+
dist = Distribution(attrs)
|
| 358 |
+
assert isinstance(dist.metadata.obsoletes, list)
|
| 359 |
+
|
| 360 |
+
def test_classifier(self):
|
| 361 |
+
attrs = {
|
| 362 |
+
'name': 'Boa',
|
| 363 |
+
'version': '3.0',
|
| 364 |
+
'classifiers': ['Programming Language :: Python :: 3'],
|
| 365 |
+
}
|
| 366 |
+
dist = Distribution(attrs)
|
| 367 |
+
assert dist.get_classifiers() == ['Programming Language :: Python :: 3']
|
| 368 |
+
meta = self.format_metadata(dist)
|
| 369 |
+
assert 'Metadata-Version: 1.1' in meta
|
| 370 |
+
|
| 371 |
+
def test_classifier_invalid_type(self, caplog):
|
| 372 |
+
attrs = {
|
| 373 |
+
'name': 'Boa',
|
| 374 |
+
'version': '3.0',
|
| 375 |
+
'classifiers': ('Programming Language :: Python :: 3',),
|
| 376 |
+
}
|
| 377 |
+
d = Distribution(attrs)
|
| 378 |
+
# should have warning about passing a non-list
|
| 379 |
+
assert 'should be a list' in caplog.messages[0]
|
| 380 |
+
# should be converted to a list
|
| 381 |
+
assert isinstance(d.metadata.classifiers, list)
|
| 382 |
+
assert d.metadata.classifiers == list(attrs['classifiers'])
|
| 383 |
+
|
| 384 |
+
def test_keywords(self):
|
| 385 |
+
attrs = {
|
| 386 |
+
'name': 'Monty',
|
| 387 |
+
'version': '1.0',
|
| 388 |
+
'keywords': ['spam', 'eggs', 'life of brian'],
|
| 389 |
+
}
|
| 390 |
+
dist = Distribution(attrs)
|
| 391 |
+
assert dist.get_keywords() == ['spam', 'eggs', 'life of brian']
|
| 392 |
+
|
| 393 |
+
def test_keywords_invalid_type(self, caplog):
|
| 394 |
+
attrs = {
|
| 395 |
+
'name': 'Monty',
|
| 396 |
+
'version': '1.0',
|
| 397 |
+
'keywords': ('spam', 'eggs', 'life of brian'),
|
| 398 |
+
}
|
| 399 |
+
d = Distribution(attrs)
|
| 400 |
+
# should have warning about passing a non-list
|
| 401 |
+
assert 'should be a list' in caplog.messages[0]
|
| 402 |
+
# should be converted to a list
|
| 403 |
+
assert isinstance(d.metadata.keywords, list)
|
| 404 |
+
assert d.metadata.keywords == list(attrs['keywords'])
|
| 405 |
+
|
| 406 |
+
def test_platforms(self):
|
| 407 |
+
attrs = {
|
| 408 |
+
'name': 'Monty',
|
| 409 |
+
'version': '1.0',
|
| 410 |
+
'platforms': ['GNU/Linux', 'Some Evil Platform'],
|
| 411 |
+
}
|
| 412 |
+
dist = Distribution(attrs)
|
| 413 |
+
assert dist.get_platforms() == ['GNU/Linux', 'Some Evil Platform']
|
| 414 |
+
|
| 415 |
+
def test_platforms_invalid_types(self, caplog):
|
| 416 |
+
attrs = {
|
| 417 |
+
'name': 'Monty',
|
| 418 |
+
'version': '1.0',
|
| 419 |
+
'platforms': ('GNU/Linux', 'Some Evil Platform'),
|
| 420 |
+
}
|
| 421 |
+
d = Distribution(attrs)
|
| 422 |
+
# should have warning about passing a non-list
|
| 423 |
+
assert 'should be a list' in caplog.messages[0]
|
| 424 |
+
# should be converted to a list
|
| 425 |
+
assert isinstance(d.metadata.platforms, list)
|
| 426 |
+
assert d.metadata.platforms == list(attrs['platforms'])
|
| 427 |
+
|
| 428 |
+
def test_download_url(self):
|
| 429 |
+
attrs = {
|
| 430 |
+
'name': 'Boa',
|
| 431 |
+
'version': '3.0',
|
| 432 |
+
'download_url': 'http://example.org/boa',
|
| 433 |
+
}
|
| 434 |
+
dist = Distribution(attrs)
|
| 435 |
+
meta = self.format_metadata(dist)
|
| 436 |
+
assert 'Metadata-Version: 1.1' in meta
|
| 437 |
+
|
| 438 |
+
def test_long_description(self):
|
| 439 |
+
long_desc = textwrap.dedent(
|
| 440 |
+
"""\
|
| 441 |
+
example::
|
| 442 |
+
We start here
|
| 443 |
+
and continue here
|
| 444 |
+
and end here."""
|
| 445 |
+
)
|
| 446 |
+
attrs = {"name": "package", "version": "1.0", "long_description": long_desc}
|
| 447 |
+
|
| 448 |
+
dist = Distribution(attrs)
|
| 449 |
+
meta = self.format_metadata(dist)
|
| 450 |
+
meta = meta.replace('\n' + 8 * ' ', '\n')
|
| 451 |
+
assert long_desc in meta
|
| 452 |
+
|
| 453 |
+
def test_custom_pydistutils(self, temp_home):
|
| 454 |
+
"""
|
| 455 |
+
pydistutils.cfg is found
|
| 456 |
+
"""
|
| 457 |
+
jaraco.path.build({pydistutils_cfg: ''}, temp_home)
|
| 458 |
+
config_path = temp_home / pydistutils_cfg
|
| 459 |
+
|
| 460 |
+
assert str(config_path) in Distribution().find_config_files()
|
| 461 |
+
|
| 462 |
+
def test_extra_pydistutils(self, monkeypatch, tmp_path):
|
| 463 |
+
jaraco.path.build({'overrides.cfg': ''}, tmp_path)
|
| 464 |
+
filename = tmp_path / 'overrides.cfg'
|
| 465 |
+
monkeypatch.setenv('DIST_EXTRA_CONFIG', str(filename))
|
| 466 |
+
assert str(filename) in Distribution().find_config_files()
|
| 467 |
+
|
| 468 |
+
def test_fix_help_options(self):
|
| 469 |
+
help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)]
|
| 470 |
+
fancy_options = fix_help_options(help_tuples)
|
| 471 |
+
assert fancy_options[0] == ('a', 'b', 'c')
|
| 472 |
+
assert fancy_options[1] == (1, 2, 3)
|
| 473 |
+
|
| 474 |
+
def test_show_help(self, request, capsys):
|
| 475 |
+
# smoke test, just makes sure some help is displayed
|
| 476 |
+
dist = Distribution()
|
| 477 |
+
sys.argv = []
|
| 478 |
+
dist.help = True
|
| 479 |
+
dist.script_name = 'setup.py'
|
| 480 |
+
dist.parse_command_line()
|
| 481 |
+
|
| 482 |
+
output = [
|
| 483 |
+
line for line in capsys.readouterr().out.split('\n') if line.strip() != ''
|
| 484 |
+
]
|
| 485 |
+
assert output
|
| 486 |
+
|
| 487 |
+
def test_read_metadata(self):
|
| 488 |
+
attrs = {
|
| 489 |
+
"name": "package",
|
| 490 |
+
"version": "1.0",
|
| 491 |
+
"long_description": "desc",
|
| 492 |
+
"description": "xxx",
|
| 493 |
+
"download_url": "http://example.com",
|
| 494 |
+
"keywords": ['one', 'two'],
|
| 495 |
+
"requires": ['foo'],
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
dist = Distribution(attrs)
|
| 499 |
+
metadata = dist.metadata
|
| 500 |
+
|
| 501 |
+
# write it then reloads it
|
| 502 |
+
PKG_INFO = io.StringIO()
|
| 503 |
+
metadata.write_pkg_file(PKG_INFO)
|
| 504 |
+
PKG_INFO.seek(0)
|
| 505 |
+
metadata.read_pkg_file(PKG_INFO)
|
| 506 |
+
|
| 507 |
+
assert metadata.name == "package"
|
| 508 |
+
assert metadata.version == "1.0"
|
| 509 |
+
assert metadata.description == "xxx"
|
| 510 |
+
assert metadata.download_url == 'http://example.com'
|
| 511 |
+
assert metadata.keywords == ['one', 'two']
|
| 512 |
+
assert metadata.platforms is None
|
| 513 |
+
assert metadata.obsoletes is None
|
| 514 |
+
assert metadata.requires == ['foo']
|
| 515 |
+
|
| 516 |
+
def test_round_trip_through_email_generator(self):
|
| 517 |
+
"""
|
| 518 |
+
In pypa/setuptools#4033, it was shown that once PKG-INFO is
|
| 519 |
+
re-generated using ``email.generator.Generator``, some control
|
| 520 |
+
characters might cause problems.
|
| 521 |
+
"""
|
| 522 |
+
# Given a PKG-INFO file ...
|
| 523 |
+
attrs = {
|
| 524 |
+
"name": "package",
|
| 525 |
+
"version": "1.0",
|
| 526 |
+
"long_description": "hello\x0b\nworld\n",
|
| 527 |
+
}
|
| 528 |
+
dist = Distribution(attrs)
|
| 529 |
+
metadata = dist.metadata
|
| 530 |
+
|
| 531 |
+
with io.StringIO() as buffer:
|
| 532 |
+
metadata.write_pkg_file(buffer)
|
| 533 |
+
msg = buffer.getvalue()
|
| 534 |
+
|
| 535 |
+
# ... when it is read and re-written using stdlib's email library,
|
| 536 |
+
orig = email.message_from_string(msg)
|
| 537 |
+
policy = email.policy.EmailPolicy(
|
| 538 |
+
utf8=True,
|
| 539 |
+
mangle_from_=False,
|
| 540 |
+
max_line_length=0,
|
| 541 |
+
)
|
| 542 |
+
with io.StringIO() as buffer:
|
| 543 |
+
email.generator.Generator(buffer, policy=policy).flatten(orig)
|
| 544 |
+
|
| 545 |
+
buffer.seek(0)
|
| 546 |
+
regen = email.message_from_file(buffer)
|
| 547 |
+
|
| 548 |
+
# ... then it should be the same as the original
|
| 549 |
+
# (except for the specific line break characters)
|
| 550 |
+
orig_desc = set(orig["Description"].splitlines())
|
| 551 |
+
regen_desc = set(regen["Description"].splitlines())
|
| 552 |
+
assert regen_desc == orig_desc
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_extension.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.extension."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import pathlib
|
| 5 |
+
import warnings
|
| 6 |
+
from distutils.extension import Extension, read_setup_file
|
| 7 |
+
|
| 8 |
+
import pytest
|
| 9 |
+
from test.support.warnings_helper import check_warnings
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class TestExtension:
|
| 13 |
+
def test_read_setup_file(self):
|
| 14 |
+
# trying to read a Setup file
|
| 15 |
+
# (sample extracted from the PyGame project)
|
| 16 |
+
setup = os.path.join(os.path.dirname(__file__), 'Setup.sample')
|
| 17 |
+
|
| 18 |
+
exts = read_setup_file(setup)
|
| 19 |
+
names = [ext.name for ext in exts]
|
| 20 |
+
names.sort()
|
| 21 |
+
|
| 22 |
+
# here are the extensions read_setup_file should have created
|
| 23 |
+
# out of the file
|
| 24 |
+
wanted = [
|
| 25 |
+
'_arraysurfarray',
|
| 26 |
+
'_camera',
|
| 27 |
+
'_numericsndarray',
|
| 28 |
+
'_numericsurfarray',
|
| 29 |
+
'base',
|
| 30 |
+
'bufferproxy',
|
| 31 |
+
'cdrom',
|
| 32 |
+
'color',
|
| 33 |
+
'constants',
|
| 34 |
+
'display',
|
| 35 |
+
'draw',
|
| 36 |
+
'event',
|
| 37 |
+
'fastevent',
|
| 38 |
+
'font',
|
| 39 |
+
'gfxdraw',
|
| 40 |
+
'image',
|
| 41 |
+
'imageext',
|
| 42 |
+
'joystick',
|
| 43 |
+
'key',
|
| 44 |
+
'mask',
|
| 45 |
+
'mixer',
|
| 46 |
+
'mixer_music',
|
| 47 |
+
'mouse',
|
| 48 |
+
'movie',
|
| 49 |
+
'overlay',
|
| 50 |
+
'pixelarray',
|
| 51 |
+
'pypm',
|
| 52 |
+
'rect',
|
| 53 |
+
'rwobject',
|
| 54 |
+
'scrap',
|
| 55 |
+
'surface',
|
| 56 |
+
'surflock',
|
| 57 |
+
'time',
|
| 58 |
+
'transform',
|
| 59 |
+
]
|
| 60 |
+
|
| 61 |
+
assert names == wanted
|
| 62 |
+
|
| 63 |
+
def test_extension_init(self):
|
| 64 |
+
# the first argument, which is the name, must be a string
|
| 65 |
+
with pytest.raises(TypeError):
|
| 66 |
+
Extension(1, [])
|
| 67 |
+
ext = Extension('name', [])
|
| 68 |
+
assert ext.name == 'name'
|
| 69 |
+
|
| 70 |
+
# the second argument, which is the list of files, must
|
| 71 |
+
# be an iterable of strings or PathLike objects, and not a string
|
| 72 |
+
with pytest.raises(TypeError):
|
| 73 |
+
Extension('name', 'file')
|
| 74 |
+
with pytest.raises(TypeError):
|
| 75 |
+
Extension('name', ['file', 1])
|
| 76 |
+
ext = Extension('name', ['file1', 'file2'])
|
| 77 |
+
assert ext.sources == ['file1', 'file2']
|
| 78 |
+
ext = Extension('name', [pathlib.Path('file1'), pathlib.Path('file2')])
|
| 79 |
+
assert ext.sources == ['file1', 'file2']
|
| 80 |
+
|
| 81 |
+
# any non-string iterable of strings or PathLike objects should work
|
| 82 |
+
ext = Extension('name', ('file1', 'file2')) # tuple
|
| 83 |
+
assert ext.sources == ['file1', 'file2']
|
| 84 |
+
ext = Extension('name', {'file1', 'file2'}) # set
|
| 85 |
+
assert sorted(ext.sources) == ['file1', 'file2']
|
| 86 |
+
ext = Extension('name', iter(['file1', 'file2'])) # iterator
|
| 87 |
+
assert ext.sources == ['file1', 'file2']
|
| 88 |
+
ext = Extension('name', [pathlib.Path('file1'), 'file2']) # mixed types
|
| 89 |
+
assert ext.sources == ['file1', 'file2']
|
| 90 |
+
|
| 91 |
+
# others arguments have defaults
|
| 92 |
+
for attr in (
|
| 93 |
+
'include_dirs',
|
| 94 |
+
'define_macros',
|
| 95 |
+
'undef_macros',
|
| 96 |
+
'library_dirs',
|
| 97 |
+
'libraries',
|
| 98 |
+
'runtime_library_dirs',
|
| 99 |
+
'extra_objects',
|
| 100 |
+
'extra_compile_args',
|
| 101 |
+
'extra_link_args',
|
| 102 |
+
'export_symbols',
|
| 103 |
+
'swig_opts',
|
| 104 |
+
'depends',
|
| 105 |
+
):
|
| 106 |
+
assert getattr(ext, attr) == []
|
| 107 |
+
|
| 108 |
+
assert ext.language is None
|
| 109 |
+
assert ext.optional is None
|
| 110 |
+
|
| 111 |
+
# if there are unknown keyword options, warn about them
|
| 112 |
+
with check_warnings() as w:
|
| 113 |
+
warnings.simplefilter('always')
|
| 114 |
+
ext = Extension('name', ['file1', 'file2'], chic=True)
|
| 115 |
+
|
| 116 |
+
assert len(w.warnings) == 1
|
| 117 |
+
assert str(w.warnings[0].message) == "Unknown Extension options: 'chic'"
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_file_util.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.file_util."""
|
| 2 |
+
|
| 3 |
+
import errno
|
| 4 |
+
import os
|
| 5 |
+
import unittest.mock as mock
|
| 6 |
+
from distutils.errors import DistutilsFileError
|
| 7 |
+
from distutils.file_util import copy_file, move_file
|
| 8 |
+
|
| 9 |
+
import jaraco.path
|
| 10 |
+
import pytest
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
@pytest.fixture(autouse=True)
|
| 14 |
+
def stuff(request, tmp_path):
|
| 15 |
+
self = request.instance
|
| 16 |
+
self.source = tmp_path / 'f1'
|
| 17 |
+
self.target = tmp_path / 'f2'
|
| 18 |
+
self.target_dir = tmp_path / 'd1'
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class TestFileUtil:
|
| 22 |
+
def test_move_file_verbosity(self, caplog):
|
| 23 |
+
jaraco.path.build({self.source: 'some content'})
|
| 24 |
+
|
| 25 |
+
move_file(self.source, self.target, verbose=False)
|
| 26 |
+
assert not caplog.messages
|
| 27 |
+
|
| 28 |
+
# back to original state
|
| 29 |
+
move_file(self.target, self.source, verbose=False)
|
| 30 |
+
|
| 31 |
+
move_file(self.source, self.target, verbose=True)
|
| 32 |
+
wanted = [f'moving {self.source} -> {self.target}']
|
| 33 |
+
assert caplog.messages == wanted
|
| 34 |
+
|
| 35 |
+
# back to original state
|
| 36 |
+
move_file(self.target, self.source, verbose=False)
|
| 37 |
+
|
| 38 |
+
caplog.clear()
|
| 39 |
+
# now the target is a dir
|
| 40 |
+
os.mkdir(self.target_dir)
|
| 41 |
+
move_file(self.source, self.target_dir, verbose=True)
|
| 42 |
+
wanted = [f'moving {self.source} -> {self.target_dir}']
|
| 43 |
+
assert caplog.messages == wanted
|
| 44 |
+
|
| 45 |
+
def test_move_file_exception_unpacking_rename(self):
|
| 46 |
+
# see issue 22182
|
| 47 |
+
with (
|
| 48 |
+
mock.patch("os.rename", side_effect=OSError("wrong", 1)),
|
| 49 |
+
pytest.raises(DistutilsFileError),
|
| 50 |
+
):
|
| 51 |
+
jaraco.path.build({self.source: 'spam eggs'})
|
| 52 |
+
move_file(self.source, self.target, verbose=False)
|
| 53 |
+
|
| 54 |
+
def test_move_file_exception_unpacking_unlink(self):
|
| 55 |
+
# see issue 22182
|
| 56 |
+
with (
|
| 57 |
+
mock.patch("os.rename", side_effect=OSError(errno.EXDEV, "wrong")),
|
| 58 |
+
mock.patch("os.unlink", side_effect=OSError("wrong", 1)),
|
| 59 |
+
pytest.raises(DistutilsFileError),
|
| 60 |
+
):
|
| 61 |
+
jaraco.path.build({self.source: 'spam eggs'})
|
| 62 |
+
move_file(self.source, self.target, verbose=False)
|
| 63 |
+
|
| 64 |
+
def test_copy_file_hard_link(self):
|
| 65 |
+
jaraco.path.build({self.source: 'some content'})
|
| 66 |
+
# Check first that copy_file() will not fall back on copying the file
|
| 67 |
+
# instead of creating the hard link.
|
| 68 |
+
try:
|
| 69 |
+
os.link(self.source, self.target)
|
| 70 |
+
except OSError as e:
|
| 71 |
+
self.skipTest(f'os.link: {e}')
|
| 72 |
+
else:
|
| 73 |
+
self.target.unlink()
|
| 74 |
+
st = os.stat(self.source)
|
| 75 |
+
copy_file(self.source, self.target, link='hard')
|
| 76 |
+
st2 = os.stat(self.source)
|
| 77 |
+
st3 = os.stat(self.target)
|
| 78 |
+
assert os.path.samestat(st, st2), (st, st2)
|
| 79 |
+
assert os.path.samestat(st2, st3), (st2, st3)
|
| 80 |
+
assert self.source.read_text(encoding='utf-8') == 'some content'
|
| 81 |
+
|
| 82 |
+
def test_copy_file_hard_link_failure(self):
|
| 83 |
+
# If hard linking fails, copy_file() falls back on copying file
|
| 84 |
+
# (some special filesystems don't support hard linking even under
|
| 85 |
+
# Unix, see issue #8876).
|
| 86 |
+
jaraco.path.build({self.source: 'some content'})
|
| 87 |
+
st = os.stat(self.source)
|
| 88 |
+
with mock.patch("os.link", side_effect=OSError(0, "linking unsupported")):
|
| 89 |
+
copy_file(self.source, self.target, link='hard')
|
| 90 |
+
st2 = os.stat(self.source)
|
| 91 |
+
st3 = os.stat(self.target)
|
| 92 |
+
assert os.path.samestat(st, st2), (st, st2)
|
| 93 |
+
assert not os.path.samestat(st2, st3), (st2, st3)
|
| 94 |
+
for fn in (self.source, self.target):
|
| 95 |
+
assert fn.read_text(encoding='utf-8') == 'some content'
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_filelist.py
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.filelist."""
|
| 2 |
+
|
| 3 |
+
import logging
|
| 4 |
+
import os
|
| 5 |
+
import re
|
| 6 |
+
from distutils import debug, filelist
|
| 7 |
+
from distutils.errors import DistutilsTemplateError
|
| 8 |
+
from distutils.filelist import FileList, glob_to_re, translate_pattern
|
| 9 |
+
|
| 10 |
+
import jaraco.path
|
| 11 |
+
import pytest
|
| 12 |
+
|
| 13 |
+
from .compat import py39 as os_helper
|
| 14 |
+
|
| 15 |
+
MANIFEST_IN = """\
|
| 16 |
+
include ok
|
| 17 |
+
include xo
|
| 18 |
+
exclude xo
|
| 19 |
+
include foo.tmp
|
| 20 |
+
include buildout.cfg
|
| 21 |
+
global-include *.x
|
| 22 |
+
global-include *.txt
|
| 23 |
+
global-exclude *.tmp
|
| 24 |
+
recursive-include f *.oo
|
| 25 |
+
recursive-exclude global *.x
|
| 26 |
+
graft dir
|
| 27 |
+
prune dir3
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def make_local_path(s):
|
| 32 |
+
"""Converts '/' in a string to os.sep"""
|
| 33 |
+
return s.replace('/', os.sep)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
class TestFileList:
|
| 37 |
+
def assertNoWarnings(self, caplog):
|
| 38 |
+
warnings = [rec for rec in caplog.records if rec.levelno == logging.WARNING]
|
| 39 |
+
assert not warnings
|
| 40 |
+
caplog.clear()
|
| 41 |
+
|
| 42 |
+
def assertWarnings(self, caplog):
|
| 43 |
+
warnings = [rec for rec in caplog.records if rec.levelno == logging.WARNING]
|
| 44 |
+
assert warnings
|
| 45 |
+
caplog.clear()
|
| 46 |
+
|
| 47 |
+
def test_glob_to_re(self):
|
| 48 |
+
sep = os.sep
|
| 49 |
+
if os.sep == '\\':
|
| 50 |
+
sep = re.escape(os.sep)
|
| 51 |
+
|
| 52 |
+
for glob, regex in (
|
| 53 |
+
# simple cases
|
| 54 |
+
('foo*', r'(?s:foo[^%(sep)s]*)\Z'),
|
| 55 |
+
('foo?', r'(?s:foo[^%(sep)s])\Z'),
|
| 56 |
+
('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'),
|
| 57 |
+
# special cases
|
| 58 |
+
(r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'),
|
| 59 |
+
(r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'),
|
| 60 |
+
('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'),
|
| 61 |
+
(r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z'),
|
| 62 |
+
):
|
| 63 |
+
regex = regex % {'sep': sep}
|
| 64 |
+
assert glob_to_re(glob) == regex
|
| 65 |
+
|
| 66 |
+
def test_process_template_line(self):
|
| 67 |
+
# testing all MANIFEST.in template patterns
|
| 68 |
+
file_list = FileList()
|
| 69 |
+
mlp = make_local_path
|
| 70 |
+
|
| 71 |
+
# simulated file list
|
| 72 |
+
file_list.allfiles = [
|
| 73 |
+
'foo.tmp',
|
| 74 |
+
'ok',
|
| 75 |
+
'xo',
|
| 76 |
+
'four.txt',
|
| 77 |
+
'buildout.cfg',
|
| 78 |
+
# filelist does not filter out VCS directories,
|
| 79 |
+
# it's sdist that does
|
| 80 |
+
mlp('.hg/last-message.txt'),
|
| 81 |
+
mlp('global/one.txt'),
|
| 82 |
+
mlp('global/two.txt'),
|
| 83 |
+
mlp('global/files.x'),
|
| 84 |
+
mlp('global/here.tmp'),
|
| 85 |
+
mlp('f/o/f.oo'),
|
| 86 |
+
mlp('dir/graft-one'),
|
| 87 |
+
mlp('dir/dir2/graft2'),
|
| 88 |
+
mlp('dir3/ok'),
|
| 89 |
+
mlp('dir3/sub/ok.txt'),
|
| 90 |
+
]
|
| 91 |
+
|
| 92 |
+
for line in MANIFEST_IN.split('\n'):
|
| 93 |
+
if line.strip() == '':
|
| 94 |
+
continue
|
| 95 |
+
file_list.process_template_line(line)
|
| 96 |
+
|
| 97 |
+
wanted = [
|
| 98 |
+
'ok',
|
| 99 |
+
'buildout.cfg',
|
| 100 |
+
'four.txt',
|
| 101 |
+
mlp('.hg/last-message.txt'),
|
| 102 |
+
mlp('global/one.txt'),
|
| 103 |
+
mlp('global/two.txt'),
|
| 104 |
+
mlp('f/o/f.oo'),
|
| 105 |
+
mlp('dir/graft-one'),
|
| 106 |
+
mlp('dir/dir2/graft2'),
|
| 107 |
+
]
|
| 108 |
+
|
| 109 |
+
assert file_list.files == wanted
|
| 110 |
+
|
| 111 |
+
def test_debug_print(self, capsys, monkeypatch):
|
| 112 |
+
file_list = FileList()
|
| 113 |
+
file_list.debug_print('xxx')
|
| 114 |
+
assert capsys.readouterr().out == ''
|
| 115 |
+
|
| 116 |
+
monkeypatch.setattr(debug, 'DEBUG', True)
|
| 117 |
+
file_list.debug_print('xxx')
|
| 118 |
+
assert capsys.readouterr().out == 'xxx\n'
|
| 119 |
+
|
| 120 |
+
def test_set_allfiles(self):
|
| 121 |
+
file_list = FileList()
|
| 122 |
+
files = ['a', 'b', 'c']
|
| 123 |
+
file_list.set_allfiles(files)
|
| 124 |
+
assert file_list.allfiles == files
|
| 125 |
+
|
| 126 |
+
def test_remove_duplicates(self):
|
| 127 |
+
file_list = FileList()
|
| 128 |
+
file_list.files = ['a', 'b', 'a', 'g', 'c', 'g']
|
| 129 |
+
# files must be sorted beforehand (sdist does it)
|
| 130 |
+
file_list.sort()
|
| 131 |
+
file_list.remove_duplicates()
|
| 132 |
+
assert file_list.files == ['a', 'b', 'c', 'g']
|
| 133 |
+
|
| 134 |
+
def test_translate_pattern(self):
|
| 135 |
+
# not regex
|
| 136 |
+
assert hasattr(translate_pattern('a', anchor=True, is_regex=False), 'search')
|
| 137 |
+
|
| 138 |
+
# is a regex
|
| 139 |
+
regex = re.compile('a')
|
| 140 |
+
assert translate_pattern(regex, anchor=True, is_regex=True) == regex
|
| 141 |
+
|
| 142 |
+
# plain string flagged as regex
|
| 143 |
+
assert hasattr(translate_pattern('a', anchor=True, is_regex=True), 'search')
|
| 144 |
+
|
| 145 |
+
# glob support
|
| 146 |
+
assert translate_pattern('*.py', anchor=True, is_regex=False).search(
|
| 147 |
+
'filelist.py'
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
def test_exclude_pattern(self):
|
| 151 |
+
# return False if no match
|
| 152 |
+
file_list = FileList()
|
| 153 |
+
assert not file_list.exclude_pattern('*.py')
|
| 154 |
+
|
| 155 |
+
# return True if files match
|
| 156 |
+
file_list = FileList()
|
| 157 |
+
file_list.files = ['a.py', 'b.py']
|
| 158 |
+
assert file_list.exclude_pattern('*.py')
|
| 159 |
+
|
| 160 |
+
# test excludes
|
| 161 |
+
file_list = FileList()
|
| 162 |
+
file_list.files = ['a.py', 'a.txt']
|
| 163 |
+
file_list.exclude_pattern('*.py')
|
| 164 |
+
assert file_list.files == ['a.txt']
|
| 165 |
+
|
| 166 |
+
def test_include_pattern(self):
|
| 167 |
+
# return False if no match
|
| 168 |
+
file_list = FileList()
|
| 169 |
+
file_list.set_allfiles([])
|
| 170 |
+
assert not file_list.include_pattern('*.py')
|
| 171 |
+
|
| 172 |
+
# return True if files match
|
| 173 |
+
file_list = FileList()
|
| 174 |
+
file_list.set_allfiles(['a.py', 'b.txt'])
|
| 175 |
+
assert file_list.include_pattern('*.py')
|
| 176 |
+
|
| 177 |
+
# test * matches all files
|
| 178 |
+
file_list = FileList()
|
| 179 |
+
assert file_list.allfiles is None
|
| 180 |
+
file_list.set_allfiles(['a.py', 'b.txt'])
|
| 181 |
+
file_list.include_pattern('*')
|
| 182 |
+
assert file_list.allfiles == ['a.py', 'b.txt']
|
| 183 |
+
|
| 184 |
+
def test_process_template(self, caplog):
|
| 185 |
+
mlp = make_local_path
|
| 186 |
+
# invalid lines
|
| 187 |
+
file_list = FileList()
|
| 188 |
+
for action in (
|
| 189 |
+
'include',
|
| 190 |
+
'exclude',
|
| 191 |
+
'global-include',
|
| 192 |
+
'global-exclude',
|
| 193 |
+
'recursive-include',
|
| 194 |
+
'recursive-exclude',
|
| 195 |
+
'graft',
|
| 196 |
+
'prune',
|
| 197 |
+
'blarg',
|
| 198 |
+
):
|
| 199 |
+
with pytest.raises(DistutilsTemplateError):
|
| 200 |
+
file_list.process_template_line(action)
|
| 201 |
+
|
| 202 |
+
# include
|
| 203 |
+
file_list = FileList()
|
| 204 |
+
file_list.set_allfiles(['a.py', 'b.txt', mlp('d/c.py')])
|
| 205 |
+
|
| 206 |
+
file_list.process_template_line('include *.py')
|
| 207 |
+
assert file_list.files == ['a.py']
|
| 208 |
+
self.assertNoWarnings(caplog)
|
| 209 |
+
|
| 210 |
+
file_list.process_template_line('include *.rb')
|
| 211 |
+
assert file_list.files == ['a.py']
|
| 212 |
+
self.assertWarnings(caplog)
|
| 213 |
+
|
| 214 |
+
# exclude
|
| 215 |
+
file_list = FileList()
|
| 216 |
+
file_list.files = ['a.py', 'b.txt', mlp('d/c.py')]
|
| 217 |
+
|
| 218 |
+
file_list.process_template_line('exclude *.py')
|
| 219 |
+
assert file_list.files == ['b.txt', mlp('d/c.py')]
|
| 220 |
+
self.assertNoWarnings(caplog)
|
| 221 |
+
|
| 222 |
+
file_list.process_template_line('exclude *.rb')
|
| 223 |
+
assert file_list.files == ['b.txt', mlp('d/c.py')]
|
| 224 |
+
self.assertWarnings(caplog)
|
| 225 |
+
|
| 226 |
+
# global-include
|
| 227 |
+
file_list = FileList()
|
| 228 |
+
file_list.set_allfiles(['a.py', 'b.txt', mlp('d/c.py')])
|
| 229 |
+
|
| 230 |
+
file_list.process_template_line('global-include *.py')
|
| 231 |
+
assert file_list.files == ['a.py', mlp('d/c.py')]
|
| 232 |
+
self.assertNoWarnings(caplog)
|
| 233 |
+
|
| 234 |
+
file_list.process_template_line('global-include *.rb')
|
| 235 |
+
assert file_list.files == ['a.py', mlp('d/c.py')]
|
| 236 |
+
self.assertWarnings(caplog)
|
| 237 |
+
|
| 238 |
+
# global-exclude
|
| 239 |
+
file_list = FileList()
|
| 240 |
+
file_list.files = ['a.py', 'b.txt', mlp('d/c.py')]
|
| 241 |
+
|
| 242 |
+
file_list.process_template_line('global-exclude *.py')
|
| 243 |
+
assert file_list.files == ['b.txt']
|
| 244 |
+
self.assertNoWarnings(caplog)
|
| 245 |
+
|
| 246 |
+
file_list.process_template_line('global-exclude *.rb')
|
| 247 |
+
assert file_list.files == ['b.txt']
|
| 248 |
+
self.assertWarnings(caplog)
|
| 249 |
+
|
| 250 |
+
# recursive-include
|
| 251 |
+
file_list = FileList()
|
| 252 |
+
file_list.set_allfiles(['a.py', mlp('d/b.py'), mlp('d/c.txt'), mlp('d/d/e.py')])
|
| 253 |
+
|
| 254 |
+
file_list.process_template_line('recursive-include d *.py')
|
| 255 |
+
assert file_list.files == [mlp('d/b.py'), mlp('d/d/e.py')]
|
| 256 |
+
self.assertNoWarnings(caplog)
|
| 257 |
+
|
| 258 |
+
file_list.process_template_line('recursive-include e *.py')
|
| 259 |
+
assert file_list.files == [mlp('d/b.py'), mlp('d/d/e.py')]
|
| 260 |
+
self.assertWarnings(caplog)
|
| 261 |
+
|
| 262 |
+
# recursive-exclude
|
| 263 |
+
file_list = FileList()
|
| 264 |
+
file_list.files = ['a.py', mlp('d/b.py'), mlp('d/c.txt'), mlp('d/d/e.py')]
|
| 265 |
+
|
| 266 |
+
file_list.process_template_line('recursive-exclude d *.py')
|
| 267 |
+
assert file_list.files == ['a.py', mlp('d/c.txt')]
|
| 268 |
+
self.assertNoWarnings(caplog)
|
| 269 |
+
|
| 270 |
+
file_list.process_template_line('recursive-exclude e *.py')
|
| 271 |
+
assert file_list.files == ['a.py', mlp('d/c.txt')]
|
| 272 |
+
self.assertWarnings(caplog)
|
| 273 |
+
|
| 274 |
+
# graft
|
| 275 |
+
file_list = FileList()
|
| 276 |
+
file_list.set_allfiles(['a.py', mlp('d/b.py'), mlp('d/d/e.py'), mlp('f/f.py')])
|
| 277 |
+
|
| 278 |
+
file_list.process_template_line('graft d')
|
| 279 |
+
assert file_list.files == [mlp('d/b.py'), mlp('d/d/e.py')]
|
| 280 |
+
self.assertNoWarnings(caplog)
|
| 281 |
+
|
| 282 |
+
file_list.process_template_line('graft e')
|
| 283 |
+
assert file_list.files == [mlp('d/b.py'), mlp('d/d/e.py')]
|
| 284 |
+
self.assertWarnings(caplog)
|
| 285 |
+
|
| 286 |
+
# prune
|
| 287 |
+
file_list = FileList()
|
| 288 |
+
file_list.files = ['a.py', mlp('d/b.py'), mlp('d/d/e.py'), mlp('f/f.py')]
|
| 289 |
+
|
| 290 |
+
file_list.process_template_line('prune d')
|
| 291 |
+
assert file_list.files == ['a.py', mlp('f/f.py')]
|
| 292 |
+
self.assertNoWarnings(caplog)
|
| 293 |
+
|
| 294 |
+
file_list.process_template_line('prune e')
|
| 295 |
+
assert file_list.files == ['a.py', mlp('f/f.py')]
|
| 296 |
+
self.assertWarnings(caplog)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
class TestFindAll:
|
| 300 |
+
@os_helper.skip_unless_symlink
|
| 301 |
+
def test_missing_symlink(self, temp_cwd):
|
| 302 |
+
os.symlink('foo', 'bar')
|
| 303 |
+
assert filelist.findall() == []
|
| 304 |
+
|
| 305 |
+
def test_basic_discovery(self, temp_cwd):
|
| 306 |
+
"""
|
| 307 |
+
When findall is called with no parameters or with
|
| 308 |
+
'.' as the parameter, the dot should be omitted from
|
| 309 |
+
the results.
|
| 310 |
+
"""
|
| 311 |
+
jaraco.path.build({'foo': {'file1.txt': ''}, 'bar': {'file2.txt': ''}})
|
| 312 |
+
file1 = os.path.join('foo', 'file1.txt')
|
| 313 |
+
file2 = os.path.join('bar', 'file2.txt')
|
| 314 |
+
expected = [file2, file1]
|
| 315 |
+
assert sorted(filelist.findall()) == expected
|
| 316 |
+
|
| 317 |
+
def test_non_local_discovery(self, tmp_path):
|
| 318 |
+
"""
|
| 319 |
+
When findall is called with another path, the full
|
| 320 |
+
path name should be returned.
|
| 321 |
+
"""
|
| 322 |
+
jaraco.path.build({'file1.txt': ''}, tmp_path)
|
| 323 |
+
expected = [str(tmp_path / 'file1.txt')]
|
| 324 |
+
assert filelist.findall(tmp_path) == expected
|
| 325 |
+
|
| 326 |
+
@os_helper.skip_unless_symlink
|
| 327 |
+
def test_symlink_loop(self, tmp_path):
|
| 328 |
+
jaraco.path.build(
|
| 329 |
+
{
|
| 330 |
+
'link-to-parent': jaraco.path.Symlink('.'),
|
| 331 |
+
'somefile': '',
|
| 332 |
+
},
|
| 333 |
+
tmp_path,
|
| 334 |
+
)
|
| 335 |
+
files = filelist.findall(tmp_path)
|
| 336 |
+
assert len(files) == 1
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install.py
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.install."""
|
| 2 |
+
|
| 3 |
+
import logging
|
| 4 |
+
import os
|
| 5 |
+
import pathlib
|
| 6 |
+
import site
|
| 7 |
+
import sys
|
| 8 |
+
from distutils import sysconfig
|
| 9 |
+
from distutils.command import install as install_module
|
| 10 |
+
from distutils.command.build_ext import build_ext
|
| 11 |
+
from distutils.command.install import INSTALL_SCHEMES, install
|
| 12 |
+
from distutils.core import Distribution
|
| 13 |
+
from distutils.errors import DistutilsOptionError
|
| 14 |
+
from distutils.extension import Extension
|
| 15 |
+
from distutils.tests import missing_compiler_executable, support
|
| 16 |
+
from distutils.util import is_mingw
|
| 17 |
+
|
| 18 |
+
import pytest
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def _make_ext_name(modname):
|
| 22 |
+
return modname + sysconfig.get_config_var('EXT_SUFFIX')
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
@support.combine_markers
|
| 26 |
+
@pytest.mark.usefixtures('save_env')
|
| 27 |
+
class TestInstall(
|
| 28 |
+
support.TempdirManager,
|
| 29 |
+
):
|
| 30 |
+
@pytest.mark.xfail(
|
| 31 |
+
'platform.system() == "Windows" and sys.version_info > (3, 11)',
|
| 32 |
+
reason="pypa/distutils#148",
|
| 33 |
+
)
|
| 34 |
+
def test_home_installation_scheme(self):
|
| 35 |
+
# This ensure two things:
|
| 36 |
+
# - that --home generates the desired set of directory names
|
| 37 |
+
# - test --home is supported on all platforms
|
| 38 |
+
builddir = self.mkdtemp()
|
| 39 |
+
destination = os.path.join(builddir, "installation")
|
| 40 |
+
|
| 41 |
+
dist = Distribution({"name": "foopkg"})
|
| 42 |
+
# script_name need not exist, it just need to be initialized
|
| 43 |
+
dist.script_name = os.path.join(builddir, "setup.py")
|
| 44 |
+
dist.command_obj["build"] = support.DummyCommand(
|
| 45 |
+
build_base=builddir,
|
| 46 |
+
build_lib=os.path.join(builddir, "lib"),
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
cmd = install(dist)
|
| 50 |
+
cmd.home = destination
|
| 51 |
+
cmd.ensure_finalized()
|
| 52 |
+
|
| 53 |
+
assert cmd.install_base == destination
|
| 54 |
+
assert cmd.install_platbase == destination
|
| 55 |
+
|
| 56 |
+
def check_path(got, expected):
|
| 57 |
+
got = os.path.normpath(got)
|
| 58 |
+
expected = os.path.normpath(expected)
|
| 59 |
+
assert got == expected
|
| 60 |
+
|
| 61 |
+
impl_name = sys.implementation.name.replace("cpython", "python")
|
| 62 |
+
libdir = os.path.join(destination, "lib", impl_name)
|
| 63 |
+
check_path(cmd.install_lib, libdir)
|
| 64 |
+
_platlibdir = getattr(sys, "platlibdir", "lib")
|
| 65 |
+
platlibdir = os.path.join(destination, _platlibdir, impl_name)
|
| 66 |
+
check_path(cmd.install_platlib, platlibdir)
|
| 67 |
+
check_path(cmd.install_purelib, libdir)
|
| 68 |
+
check_path(
|
| 69 |
+
cmd.install_headers,
|
| 70 |
+
os.path.join(destination, "include", impl_name, "foopkg"),
|
| 71 |
+
)
|
| 72 |
+
check_path(cmd.install_scripts, os.path.join(destination, "bin"))
|
| 73 |
+
check_path(cmd.install_data, destination)
|
| 74 |
+
|
| 75 |
+
def test_user_site(self, monkeypatch):
|
| 76 |
+
# test install with --user
|
| 77 |
+
# preparing the environment for the test
|
| 78 |
+
self.tmpdir = self.mkdtemp()
|
| 79 |
+
orig_site = site.USER_SITE
|
| 80 |
+
orig_base = site.USER_BASE
|
| 81 |
+
monkeypatch.setattr(site, 'USER_BASE', os.path.join(self.tmpdir, 'B'))
|
| 82 |
+
monkeypatch.setattr(site, 'USER_SITE', os.path.join(self.tmpdir, 'S'))
|
| 83 |
+
monkeypatch.setattr(install_module, 'USER_BASE', site.USER_BASE)
|
| 84 |
+
monkeypatch.setattr(install_module, 'USER_SITE', site.USER_SITE)
|
| 85 |
+
|
| 86 |
+
def _expanduser(path):
|
| 87 |
+
if path.startswith('~'):
|
| 88 |
+
return os.path.normpath(self.tmpdir + path[1:])
|
| 89 |
+
return path
|
| 90 |
+
|
| 91 |
+
monkeypatch.setattr(os.path, 'expanduser', _expanduser)
|
| 92 |
+
|
| 93 |
+
for key in ('nt_user', 'posix_user'):
|
| 94 |
+
assert key in INSTALL_SCHEMES
|
| 95 |
+
|
| 96 |
+
dist = Distribution({'name': 'xx'})
|
| 97 |
+
cmd = install(dist)
|
| 98 |
+
|
| 99 |
+
# making sure the user option is there
|
| 100 |
+
options = [name for name, short, label in cmd.user_options]
|
| 101 |
+
assert 'user' in options
|
| 102 |
+
|
| 103 |
+
# setting a value
|
| 104 |
+
cmd.user = True
|
| 105 |
+
|
| 106 |
+
# user base and site shouldn't be created yet
|
| 107 |
+
assert not os.path.exists(site.USER_BASE)
|
| 108 |
+
assert not os.path.exists(site.USER_SITE)
|
| 109 |
+
|
| 110 |
+
# let's run finalize
|
| 111 |
+
cmd.ensure_finalized()
|
| 112 |
+
|
| 113 |
+
# now they should
|
| 114 |
+
assert os.path.exists(site.USER_BASE)
|
| 115 |
+
assert os.path.exists(site.USER_SITE)
|
| 116 |
+
|
| 117 |
+
assert 'userbase' in cmd.config_vars
|
| 118 |
+
assert 'usersite' in cmd.config_vars
|
| 119 |
+
|
| 120 |
+
actual_headers = os.path.relpath(cmd.install_headers, site.USER_BASE)
|
| 121 |
+
if os.name == 'nt' and not is_mingw():
|
| 122 |
+
site_path = os.path.relpath(os.path.dirname(orig_site), orig_base)
|
| 123 |
+
include = os.path.join(site_path, 'Include')
|
| 124 |
+
else:
|
| 125 |
+
include = sysconfig.get_python_inc(0, '')
|
| 126 |
+
expect_headers = os.path.join(include, 'xx')
|
| 127 |
+
|
| 128 |
+
assert os.path.normcase(actual_headers) == os.path.normcase(expect_headers)
|
| 129 |
+
|
| 130 |
+
def test_handle_extra_path(self):
|
| 131 |
+
dist = Distribution({'name': 'xx', 'extra_path': 'path,dirs'})
|
| 132 |
+
cmd = install(dist)
|
| 133 |
+
|
| 134 |
+
# two elements
|
| 135 |
+
cmd.handle_extra_path()
|
| 136 |
+
assert cmd.extra_path == ['path', 'dirs']
|
| 137 |
+
assert cmd.extra_dirs == 'dirs'
|
| 138 |
+
assert cmd.path_file == 'path'
|
| 139 |
+
|
| 140 |
+
# one element
|
| 141 |
+
cmd.extra_path = ['path']
|
| 142 |
+
cmd.handle_extra_path()
|
| 143 |
+
assert cmd.extra_path == ['path']
|
| 144 |
+
assert cmd.extra_dirs == 'path'
|
| 145 |
+
assert cmd.path_file == 'path'
|
| 146 |
+
|
| 147 |
+
# none
|
| 148 |
+
dist.extra_path = cmd.extra_path = None
|
| 149 |
+
cmd.handle_extra_path()
|
| 150 |
+
assert cmd.extra_path is None
|
| 151 |
+
assert cmd.extra_dirs == ''
|
| 152 |
+
assert cmd.path_file is None
|
| 153 |
+
|
| 154 |
+
# three elements (no way !)
|
| 155 |
+
cmd.extra_path = 'path,dirs,again'
|
| 156 |
+
with pytest.raises(DistutilsOptionError):
|
| 157 |
+
cmd.handle_extra_path()
|
| 158 |
+
|
| 159 |
+
def test_finalize_options(self):
|
| 160 |
+
dist = Distribution({'name': 'xx'})
|
| 161 |
+
cmd = install(dist)
|
| 162 |
+
|
| 163 |
+
# must supply either prefix/exec-prefix/home or
|
| 164 |
+
# install-base/install-platbase -- not both
|
| 165 |
+
cmd.prefix = 'prefix'
|
| 166 |
+
cmd.install_base = 'base'
|
| 167 |
+
with pytest.raises(DistutilsOptionError):
|
| 168 |
+
cmd.finalize_options()
|
| 169 |
+
|
| 170 |
+
# must supply either home or prefix/exec-prefix -- not both
|
| 171 |
+
cmd.install_base = None
|
| 172 |
+
cmd.home = 'home'
|
| 173 |
+
with pytest.raises(DistutilsOptionError):
|
| 174 |
+
cmd.finalize_options()
|
| 175 |
+
|
| 176 |
+
# can't combine user with prefix/exec_prefix/home or
|
| 177 |
+
# install_(plat)base
|
| 178 |
+
cmd.prefix = None
|
| 179 |
+
cmd.user = 'user'
|
| 180 |
+
with pytest.raises(DistutilsOptionError):
|
| 181 |
+
cmd.finalize_options()
|
| 182 |
+
|
| 183 |
+
def test_record(self):
|
| 184 |
+
install_dir = self.mkdtemp()
|
| 185 |
+
project_dir, dist = self.create_dist(py_modules=['hello'], scripts=['sayhi'])
|
| 186 |
+
os.chdir(project_dir)
|
| 187 |
+
self.write_file('hello.py', "def main(): print('o hai')")
|
| 188 |
+
self.write_file('sayhi', 'from hello import main; main()')
|
| 189 |
+
|
| 190 |
+
cmd = install(dist)
|
| 191 |
+
dist.command_obj['install'] = cmd
|
| 192 |
+
cmd.root = install_dir
|
| 193 |
+
cmd.record = os.path.join(project_dir, 'filelist')
|
| 194 |
+
cmd.ensure_finalized()
|
| 195 |
+
cmd.run()
|
| 196 |
+
|
| 197 |
+
content = pathlib.Path(cmd.record).read_text(encoding='utf-8')
|
| 198 |
+
|
| 199 |
+
found = [pathlib.Path(line).name for line in content.splitlines()]
|
| 200 |
+
expected = [
|
| 201 |
+
'hello.py',
|
| 202 |
+
f'hello.{sys.implementation.cache_tag}.pyc',
|
| 203 |
+
'sayhi',
|
| 204 |
+
'UNKNOWN-0.0.0-py{}.{}.egg-info'.format(*sys.version_info[:2]),
|
| 205 |
+
]
|
| 206 |
+
assert found == expected
|
| 207 |
+
|
| 208 |
+
def test_record_extensions(self):
|
| 209 |
+
cmd = missing_compiler_executable()
|
| 210 |
+
if cmd is not None:
|
| 211 |
+
pytest.skip(f'The {cmd!r} command is not found')
|
| 212 |
+
install_dir = self.mkdtemp()
|
| 213 |
+
project_dir, dist = self.create_dist(
|
| 214 |
+
ext_modules=[Extension('xx', ['xxmodule.c'])]
|
| 215 |
+
)
|
| 216 |
+
os.chdir(project_dir)
|
| 217 |
+
support.copy_xxmodule_c(project_dir)
|
| 218 |
+
|
| 219 |
+
buildextcmd = build_ext(dist)
|
| 220 |
+
support.fixup_build_ext(buildextcmd)
|
| 221 |
+
buildextcmd.ensure_finalized()
|
| 222 |
+
|
| 223 |
+
cmd = install(dist)
|
| 224 |
+
dist.command_obj['install'] = cmd
|
| 225 |
+
dist.command_obj['build_ext'] = buildextcmd
|
| 226 |
+
cmd.root = install_dir
|
| 227 |
+
cmd.record = os.path.join(project_dir, 'filelist')
|
| 228 |
+
cmd.ensure_finalized()
|
| 229 |
+
cmd.run()
|
| 230 |
+
|
| 231 |
+
content = pathlib.Path(cmd.record).read_text(encoding='utf-8')
|
| 232 |
+
|
| 233 |
+
found = [pathlib.Path(line).name for line in content.splitlines()]
|
| 234 |
+
expected = [
|
| 235 |
+
_make_ext_name('xx'),
|
| 236 |
+
'UNKNOWN-0.0.0-py{}.{}.egg-info'.format(*sys.version_info[:2]),
|
| 237 |
+
]
|
| 238 |
+
assert found == expected
|
| 239 |
+
|
| 240 |
+
def test_debug_mode(self, caplog, monkeypatch):
|
| 241 |
+
# this covers the code called when DEBUG is set
|
| 242 |
+
monkeypatch.setattr(install_module, 'DEBUG', True)
|
| 243 |
+
caplog.set_level(logging.DEBUG)
|
| 244 |
+
self.test_record()
|
| 245 |
+
assert any(rec for rec in caplog.records if rec.levelno == logging.DEBUG)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_data.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.install_data."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import pathlib
|
| 5 |
+
from distutils.command.install_data import install_data
|
| 6 |
+
from distutils.tests import support
|
| 7 |
+
|
| 8 |
+
import pytest
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@pytest.mark.usefixtures('save_env')
|
| 12 |
+
class TestInstallData(
|
| 13 |
+
support.TempdirManager,
|
| 14 |
+
):
|
| 15 |
+
def test_simple_run(self):
|
| 16 |
+
pkg_dir, dist = self.create_dist()
|
| 17 |
+
cmd = install_data(dist)
|
| 18 |
+
cmd.install_dir = inst = os.path.join(pkg_dir, 'inst')
|
| 19 |
+
|
| 20 |
+
# data_files can contain
|
| 21 |
+
# - simple files
|
| 22 |
+
# - a Path object
|
| 23 |
+
# - a tuple with a path, and a list of file
|
| 24 |
+
one = os.path.join(pkg_dir, 'one')
|
| 25 |
+
self.write_file(one, 'xxx')
|
| 26 |
+
inst2 = os.path.join(pkg_dir, 'inst2')
|
| 27 |
+
two = os.path.join(pkg_dir, 'two')
|
| 28 |
+
self.write_file(two, 'xxx')
|
| 29 |
+
three = pathlib.Path(pkg_dir) / 'three'
|
| 30 |
+
self.write_file(three, 'xxx')
|
| 31 |
+
|
| 32 |
+
cmd.data_files = [one, (inst2, [two]), three]
|
| 33 |
+
assert cmd.get_inputs() == [one, (inst2, [two]), three]
|
| 34 |
+
|
| 35 |
+
# let's run the command
|
| 36 |
+
cmd.ensure_finalized()
|
| 37 |
+
cmd.run()
|
| 38 |
+
|
| 39 |
+
# let's check the result
|
| 40 |
+
assert len(cmd.get_outputs()) == 3
|
| 41 |
+
rthree = os.path.split(one)[-1]
|
| 42 |
+
assert os.path.exists(os.path.join(inst, rthree))
|
| 43 |
+
rtwo = os.path.split(two)[-1]
|
| 44 |
+
assert os.path.exists(os.path.join(inst2, rtwo))
|
| 45 |
+
rone = os.path.split(one)[-1]
|
| 46 |
+
assert os.path.exists(os.path.join(inst, rone))
|
| 47 |
+
cmd.outfiles = []
|
| 48 |
+
|
| 49 |
+
# let's try with warn_dir one
|
| 50 |
+
cmd.warn_dir = True
|
| 51 |
+
cmd.ensure_finalized()
|
| 52 |
+
cmd.run()
|
| 53 |
+
|
| 54 |
+
# let's check the result
|
| 55 |
+
assert len(cmd.get_outputs()) == 3
|
| 56 |
+
assert os.path.exists(os.path.join(inst, rthree))
|
| 57 |
+
assert os.path.exists(os.path.join(inst2, rtwo))
|
| 58 |
+
assert os.path.exists(os.path.join(inst, rone))
|
| 59 |
+
cmd.outfiles = []
|
| 60 |
+
|
| 61 |
+
# now using root and empty dir
|
| 62 |
+
cmd.root = os.path.join(pkg_dir, 'root')
|
| 63 |
+
inst5 = os.path.join(pkg_dir, 'inst5')
|
| 64 |
+
four = os.path.join(cmd.install_dir, 'four')
|
| 65 |
+
self.write_file(four, 'xx')
|
| 66 |
+
cmd.data_files = [one, (inst2, [two]), three, ('inst5', [four]), (inst5, [])]
|
| 67 |
+
cmd.ensure_finalized()
|
| 68 |
+
cmd.run()
|
| 69 |
+
|
| 70 |
+
# let's check the result
|
| 71 |
+
assert len(cmd.get_outputs()) == 5
|
| 72 |
+
assert os.path.exists(os.path.join(inst, rthree))
|
| 73 |
+
assert os.path.exists(os.path.join(inst2, rtwo))
|
| 74 |
+
assert os.path.exists(os.path.join(inst, rone))
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_headers.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.install_headers."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
from distutils.command.install_headers import install_headers
|
| 5 |
+
from distutils.tests import support
|
| 6 |
+
|
| 7 |
+
import pytest
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
@pytest.mark.usefixtures('save_env')
|
| 11 |
+
class TestInstallHeaders(
|
| 12 |
+
support.TempdirManager,
|
| 13 |
+
):
|
| 14 |
+
def test_simple_run(self):
|
| 15 |
+
# we have two headers
|
| 16 |
+
header_list = self.mkdtemp()
|
| 17 |
+
header1 = os.path.join(header_list, 'header1')
|
| 18 |
+
header2 = os.path.join(header_list, 'header2')
|
| 19 |
+
self.write_file(header1)
|
| 20 |
+
self.write_file(header2)
|
| 21 |
+
headers = [header1, header2]
|
| 22 |
+
|
| 23 |
+
pkg_dir, dist = self.create_dist(headers=headers)
|
| 24 |
+
cmd = install_headers(dist)
|
| 25 |
+
assert cmd.get_inputs() == headers
|
| 26 |
+
|
| 27 |
+
# let's run the command
|
| 28 |
+
cmd.install_dir = os.path.join(pkg_dir, 'inst')
|
| 29 |
+
cmd.ensure_finalized()
|
| 30 |
+
cmd.run()
|
| 31 |
+
|
| 32 |
+
# let's check the results
|
| 33 |
+
assert len(cmd.get_outputs()) == 2
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_lib.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.install_data."""
|
| 2 |
+
|
| 3 |
+
import importlib.util
|
| 4 |
+
import os
|
| 5 |
+
import sys
|
| 6 |
+
from distutils.command.install_lib import install_lib
|
| 7 |
+
from distutils.errors import DistutilsOptionError
|
| 8 |
+
from distutils.extension import Extension
|
| 9 |
+
from distutils.tests import support
|
| 10 |
+
|
| 11 |
+
import pytest
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@support.combine_markers
|
| 15 |
+
@pytest.mark.usefixtures('save_env')
|
| 16 |
+
class TestInstallLib(
|
| 17 |
+
support.TempdirManager,
|
| 18 |
+
):
|
| 19 |
+
def test_finalize_options(self):
|
| 20 |
+
dist = self.create_dist()[1]
|
| 21 |
+
cmd = install_lib(dist)
|
| 22 |
+
|
| 23 |
+
cmd.finalize_options()
|
| 24 |
+
assert cmd.compile == 1
|
| 25 |
+
assert cmd.optimize == 0
|
| 26 |
+
|
| 27 |
+
# optimize must be 0, 1, or 2
|
| 28 |
+
cmd.optimize = 'foo'
|
| 29 |
+
with pytest.raises(DistutilsOptionError):
|
| 30 |
+
cmd.finalize_options()
|
| 31 |
+
cmd.optimize = '4'
|
| 32 |
+
with pytest.raises(DistutilsOptionError):
|
| 33 |
+
cmd.finalize_options()
|
| 34 |
+
|
| 35 |
+
cmd.optimize = '2'
|
| 36 |
+
cmd.finalize_options()
|
| 37 |
+
assert cmd.optimize == 2
|
| 38 |
+
|
| 39 |
+
@pytest.mark.skipif('sys.dont_write_bytecode')
|
| 40 |
+
def test_byte_compile(self):
|
| 41 |
+
project_dir, dist = self.create_dist()
|
| 42 |
+
os.chdir(project_dir)
|
| 43 |
+
cmd = install_lib(dist)
|
| 44 |
+
cmd.compile = cmd.optimize = 1
|
| 45 |
+
|
| 46 |
+
f = os.path.join(project_dir, 'foo.py')
|
| 47 |
+
self.write_file(f, '# python file')
|
| 48 |
+
cmd.byte_compile([f])
|
| 49 |
+
pyc_file = importlib.util.cache_from_source('foo.py', optimization='')
|
| 50 |
+
pyc_opt_file = importlib.util.cache_from_source(
|
| 51 |
+
'foo.py', optimization=cmd.optimize
|
| 52 |
+
)
|
| 53 |
+
assert os.path.exists(pyc_file)
|
| 54 |
+
assert os.path.exists(pyc_opt_file)
|
| 55 |
+
|
| 56 |
+
def test_get_outputs(self):
|
| 57 |
+
project_dir, dist = self.create_dist()
|
| 58 |
+
os.chdir(project_dir)
|
| 59 |
+
os.mkdir('spam')
|
| 60 |
+
cmd = install_lib(dist)
|
| 61 |
+
|
| 62 |
+
# setting up a dist environment
|
| 63 |
+
cmd.compile = cmd.optimize = 1
|
| 64 |
+
cmd.install_dir = self.mkdtemp()
|
| 65 |
+
f = os.path.join(project_dir, 'spam', '__init__.py')
|
| 66 |
+
self.write_file(f, '# python package')
|
| 67 |
+
cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
|
| 68 |
+
cmd.distribution.packages = ['spam']
|
| 69 |
+
cmd.distribution.script_name = 'setup.py'
|
| 70 |
+
|
| 71 |
+
# get_outputs should return 4 elements: spam/__init__.py and .pyc,
|
| 72 |
+
# foo.import-tag-abiflags.so / foo.pyd
|
| 73 |
+
outputs = cmd.get_outputs()
|
| 74 |
+
assert len(outputs) == 4, outputs
|
| 75 |
+
|
| 76 |
+
def test_get_inputs(self):
|
| 77 |
+
project_dir, dist = self.create_dist()
|
| 78 |
+
os.chdir(project_dir)
|
| 79 |
+
os.mkdir('spam')
|
| 80 |
+
cmd = install_lib(dist)
|
| 81 |
+
|
| 82 |
+
# setting up a dist environment
|
| 83 |
+
cmd.compile = cmd.optimize = 1
|
| 84 |
+
cmd.install_dir = self.mkdtemp()
|
| 85 |
+
f = os.path.join(project_dir, 'spam', '__init__.py')
|
| 86 |
+
self.write_file(f, '# python package')
|
| 87 |
+
cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
|
| 88 |
+
cmd.distribution.packages = ['spam']
|
| 89 |
+
cmd.distribution.script_name = 'setup.py'
|
| 90 |
+
|
| 91 |
+
# get_inputs should return 2 elements: spam/__init__.py and
|
| 92 |
+
# foo.import-tag-abiflags.so / foo.pyd
|
| 93 |
+
inputs = cmd.get_inputs()
|
| 94 |
+
assert len(inputs) == 2, inputs
|
| 95 |
+
|
| 96 |
+
def test_dont_write_bytecode(self, caplog):
|
| 97 |
+
# makes sure byte_compile is not used
|
| 98 |
+
dist = self.create_dist()[1]
|
| 99 |
+
cmd = install_lib(dist)
|
| 100 |
+
cmd.compile = True
|
| 101 |
+
cmd.optimize = 1
|
| 102 |
+
|
| 103 |
+
old_dont_write_bytecode = sys.dont_write_bytecode
|
| 104 |
+
sys.dont_write_bytecode = True
|
| 105 |
+
try:
|
| 106 |
+
cmd.byte_compile([])
|
| 107 |
+
finally:
|
| 108 |
+
sys.dont_write_bytecode = old_dont_write_bytecode
|
| 109 |
+
|
| 110 |
+
assert 'byte-compiling is disabled' in caplog.messages[0]
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_install_scripts.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.install_scripts."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
from distutils.command.install_scripts import install_scripts
|
| 5 |
+
from distutils.core import Distribution
|
| 6 |
+
from distutils.tests import support
|
| 7 |
+
|
| 8 |
+
from . import test_build_scripts
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class TestInstallScripts(support.TempdirManager):
|
| 12 |
+
def test_default_settings(self):
|
| 13 |
+
dist = Distribution()
|
| 14 |
+
dist.command_obj["build"] = support.DummyCommand(build_scripts="/foo/bar")
|
| 15 |
+
dist.command_obj["install"] = support.DummyCommand(
|
| 16 |
+
install_scripts="/splat/funk",
|
| 17 |
+
force=True,
|
| 18 |
+
skip_build=True,
|
| 19 |
+
)
|
| 20 |
+
cmd = install_scripts(dist)
|
| 21 |
+
assert not cmd.force
|
| 22 |
+
assert not cmd.skip_build
|
| 23 |
+
assert cmd.build_dir is None
|
| 24 |
+
assert cmd.install_dir is None
|
| 25 |
+
|
| 26 |
+
cmd.finalize_options()
|
| 27 |
+
|
| 28 |
+
assert cmd.force
|
| 29 |
+
assert cmd.skip_build
|
| 30 |
+
assert cmd.build_dir == "/foo/bar"
|
| 31 |
+
assert cmd.install_dir == "/splat/funk"
|
| 32 |
+
|
| 33 |
+
def test_installation(self):
|
| 34 |
+
source = self.mkdtemp()
|
| 35 |
+
|
| 36 |
+
expected = test_build_scripts.TestBuildScripts.write_sample_scripts(source)
|
| 37 |
+
|
| 38 |
+
target = self.mkdtemp()
|
| 39 |
+
dist = Distribution()
|
| 40 |
+
dist.command_obj["build"] = support.DummyCommand(build_scripts=source)
|
| 41 |
+
dist.command_obj["install"] = support.DummyCommand(
|
| 42 |
+
install_scripts=target,
|
| 43 |
+
force=True,
|
| 44 |
+
skip_build=True,
|
| 45 |
+
)
|
| 46 |
+
cmd = install_scripts(dist)
|
| 47 |
+
cmd.finalize_options()
|
| 48 |
+
cmd.run()
|
| 49 |
+
|
| 50 |
+
installed = os.listdir(target)
|
| 51 |
+
for name in expected:
|
| 52 |
+
assert name in installed
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_log.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.log"""
|
| 2 |
+
|
| 3 |
+
import logging
|
| 4 |
+
from distutils._log import log
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class TestLog:
|
| 8 |
+
def test_non_ascii(self, caplog):
|
| 9 |
+
caplog.set_level(logging.DEBUG)
|
| 10 |
+
log.debug('Dεbug\tMėssãge')
|
| 11 |
+
log.fatal('Fαtal\tÈrrōr')
|
| 12 |
+
assert caplog.messages == ['Dεbug\tMėssãge', 'Fαtal\tÈrrōr']
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_modified.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils._modified."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import types
|
| 5 |
+
from distutils._modified import newer, newer_group, newer_pairwise, newer_pairwise_group
|
| 6 |
+
from distutils.errors import DistutilsFileError
|
| 7 |
+
from distutils.tests import support
|
| 8 |
+
|
| 9 |
+
import pytest
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class TestDepUtil(support.TempdirManager):
|
| 13 |
+
def test_newer(self):
|
| 14 |
+
tmpdir = self.mkdtemp()
|
| 15 |
+
new_file = os.path.join(tmpdir, 'new')
|
| 16 |
+
old_file = os.path.abspath(__file__)
|
| 17 |
+
|
| 18 |
+
# Raise DistutilsFileError if 'new_file' does not exist.
|
| 19 |
+
with pytest.raises(DistutilsFileError):
|
| 20 |
+
newer(new_file, old_file)
|
| 21 |
+
|
| 22 |
+
# Return true if 'new_file' exists and is more recently modified than
|
| 23 |
+
# 'old_file', or if 'new_file' exists and 'old_file' doesn't.
|
| 24 |
+
self.write_file(new_file)
|
| 25 |
+
assert newer(new_file, 'I_dont_exist')
|
| 26 |
+
assert newer(new_file, old_file)
|
| 27 |
+
|
| 28 |
+
# Return false if both exist and 'old_file' is the same age or younger
|
| 29 |
+
# than 'new_file'.
|
| 30 |
+
assert not newer(old_file, new_file)
|
| 31 |
+
|
| 32 |
+
def _setup_1234(self):
|
| 33 |
+
tmpdir = self.mkdtemp()
|
| 34 |
+
sources = os.path.join(tmpdir, 'sources')
|
| 35 |
+
targets = os.path.join(tmpdir, 'targets')
|
| 36 |
+
os.mkdir(sources)
|
| 37 |
+
os.mkdir(targets)
|
| 38 |
+
one = os.path.join(sources, 'one')
|
| 39 |
+
two = os.path.join(sources, 'two')
|
| 40 |
+
three = os.path.abspath(__file__) # I am the old file
|
| 41 |
+
four = os.path.join(targets, 'four')
|
| 42 |
+
self.write_file(one)
|
| 43 |
+
self.write_file(two)
|
| 44 |
+
self.write_file(four)
|
| 45 |
+
return one, two, three, four
|
| 46 |
+
|
| 47 |
+
def test_newer_pairwise(self):
|
| 48 |
+
one, two, three, four = self._setup_1234()
|
| 49 |
+
|
| 50 |
+
assert newer_pairwise([one, two], [three, four]) == ([one], [three])
|
| 51 |
+
|
| 52 |
+
def test_newer_pairwise_mismatch(self):
|
| 53 |
+
one, two, three, four = self._setup_1234()
|
| 54 |
+
|
| 55 |
+
with pytest.raises(ValueError):
|
| 56 |
+
newer_pairwise([one], [three, four])
|
| 57 |
+
|
| 58 |
+
with pytest.raises(ValueError):
|
| 59 |
+
newer_pairwise([one, two], [three])
|
| 60 |
+
|
| 61 |
+
def test_newer_pairwise_empty(self):
|
| 62 |
+
assert newer_pairwise([], []) == ([], [])
|
| 63 |
+
|
| 64 |
+
def test_newer_pairwise_fresh(self):
|
| 65 |
+
one, two, three, four = self._setup_1234()
|
| 66 |
+
|
| 67 |
+
assert newer_pairwise([one, three], [two, four]) == ([], [])
|
| 68 |
+
|
| 69 |
+
def test_newer_group(self):
|
| 70 |
+
tmpdir = self.mkdtemp()
|
| 71 |
+
sources = os.path.join(tmpdir, 'sources')
|
| 72 |
+
os.mkdir(sources)
|
| 73 |
+
one = os.path.join(sources, 'one')
|
| 74 |
+
two = os.path.join(sources, 'two')
|
| 75 |
+
three = os.path.join(sources, 'three')
|
| 76 |
+
old_file = os.path.abspath(__file__)
|
| 77 |
+
|
| 78 |
+
# return true if 'old_file' is out-of-date with respect to any file
|
| 79 |
+
# listed in 'sources'.
|
| 80 |
+
self.write_file(one)
|
| 81 |
+
self.write_file(two)
|
| 82 |
+
self.write_file(three)
|
| 83 |
+
assert newer_group([one, two, three], old_file)
|
| 84 |
+
assert not newer_group([one, two, old_file], three)
|
| 85 |
+
|
| 86 |
+
# missing handling
|
| 87 |
+
os.remove(one)
|
| 88 |
+
with pytest.raises(OSError):
|
| 89 |
+
newer_group([one, two, old_file], three)
|
| 90 |
+
|
| 91 |
+
assert not newer_group([one, two, old_file], three, missing='ignore')
|
| 92 |
+
|
| 93 |
+
assert newer_group([one, two, old_file], three, missing='newer')
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
@pytest.fixture
|
| 97 |
+
def groups_target(tmp_path):
|
| 98 |
+
"""
|
| 99 |
+
Set up some older sources, a target, and newer sources.
|
| 100 |
+
|
| 101 |
+
Returns a simple namespace with these values.
|
| 102 |
+
"""
|
| 103 |
+
filenames = ['older.c', 'older.h', 'target.o', 'newer.c', 'newer.h']
|
| 104 |
+
paths = [tmp_path / name for name in filenames]
|
| 105 |
+
|
| 106 |
+
for mtime, path in enumerate(paths):
|
| 107 |
+
path.write_text('', encoding='utf-8')
|
| 108 |
+
|
| 109 |
+
# make sure modification times are sequential
|
| 110 |
+
os.utime(path, (mtime, mtime))
|
| 111 |
+
|
| 112 |
+
return types.SimpleNamespace(older=paths[:2], target=paths[2], newer=paths[3:])
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
def test_newer_pairwise_group(groups_target):
|
| 116 |
+
older = newer_pairwise_group([groups_target.older], [groups_target.target])
|
| 117 |
+
newer = newer_pairwise_group([groups_target.newer], [groups_target.target])
|
| 118 |
+
assert older == ([], [])
|
| 119 |
+
assert newer == ([groups_target.newer], [groups_target.target])
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def test_newer_group_no_sources_no_target(tmp_path):
|
| 123 |
+
"""
|
| 124 |
+
Consider no sources and no target "newer".
|
| 125 |
+
"""
|
| 126 |
+
assert newer_group([], str(tmp_path / 'does-not-exist'))
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_sdist.py
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.command.sdist."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import pathlib
|
| 5 |
+
import shutil # noqa: F401
|
| 6 |
+
import tarfile
|
| 7 |
+
import zipfile
|
| 8 |
+
from distutils.archive_util import ARCHIVE_FORMATS
|
| 9 |
+
from distutils.command.sdist import sdist, show_formats
|
| 10 |
+
from distutils.core import Distribution
|
| 11 |
+
from distutils.errors import DistutilsOptionError
|
| 12 |
+
from distutils.filelist import FileList
|
| 13 |
+
from os.path import join
|
| 14 |
+
from textwrap import dedent
|
| 15 |
+
|
| 16 |
+
import jaraco.path
|
| 17 |
+
import path
|
| 18 |
+
import pytest
|
| 19 |
+
from more_itertools import ilen
|
| 20 |
+
|
| 21 |
+
from . import support
|
| 22 |
+
from .unix_compat import grp, pwd, require_uid_0, require_unix_id
|
| 23 |
+
|
| 24 |
+
SETUP_PY = """
|
| 25 |
+
from distutils.core import setup
|
| 26 |
+
import somecode
|
| 27 |
+
|
| 28 |
+
setup(name='fake')
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
MANIFEST = """\
|
| 32 |
+
# file GENERATED by distutils, do NOT edit
|
| 33 |
+
README
|
| 34 |
+
buildout.cfg
|
| 35 |
+
inroot.txt
|
| 36 |
+
setup.py
|
| 37 |
+
data%(sep)sdata.dt
|
| 38 |
+
scripts%(sep)sscript.py
|
| 39 |
+
some%(sep)sfile.txt
|
| 40 |
+
some%(sep)sother_file.txt
|
| 41 |
+
somecode%(sep)s__init__.py
|
| 42 |
+
somecode%(sep)sdoc.dat
|
| 43 |
+
somecode%(sep)sdoc.txt
|
| 44 |
+
"""
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
@pytest.fixture(autouse=True)
|
| 48 |
+
def project_dir(request, distutils_managed_tempdir):
|
| 49 |
+
self = request.instance
|
| 50 |
+
self.tmp_dir = self.mkdtemp()
|
| 51 |
+
jaraco.path.build(
|
| 52 |
+
{
|
| 53 |
+
'somecode': {
|
| 54 |
+
'__init__.py': '#',
|
| 55 |
+
},
|
| 56 |
+
'README': 'xxx',
|
| 57 |
+
'setup.py': SETUP_PY,
|
| 58 |
+
},
|
| 59 |
+
self.tmp_dir,
|
| 60 |
+
)
|
| 61 |
+
with path.Path(self.tmp_dir):
|
| 62 |
+
yield
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def clean_lines(filepath):
|
| 66 |
+
with pathlib.Path(filepath).open(encoding='utf-8') as f:
|
| 67 |
+
yield from filter(None, map(str.strip, f))
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
class TestSDist(support.TempdirManager):
|
| 71 |
+
def get_cmd(self, metadata=None):
|
| 72 |
+
"""Returns a cmd"""
|
| 73 |
+
if metadata is None:
|
| 74 |
+
metadata = {
|
| 75 |
+
'name': 'ns.fake--pkg',
|
| 76 |
+
'version': '1.0',
|
| 77 |
+
'url': 'xxx',
|
| 78 |
+
'author': 'xxx',
|
| 79 |
+
'author_email': 'xxx',
|
| 80 |
+
}
|
| 81 |
+
dist = Distribution(metadata)
|
| 82 |
+
dist.script_name = 'setup.py'
|
| 83 |
+
dist.packages = ['somecode']
|
| 84 |
+
dist.include_package_data = True
|
| 85 |
+
cmd = sdist(dist)
|
| 86 |
+
cmd.dist_dir = 'dist'
|
| 87 |
+
return dist, cmd
|
| 88 |
+
|
| 89 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 90 |
+
def test_prune_file_list(self):
|
| 91 |
+
# this test creates a project with some VCS dirs and an NFS rename
|
| 92 |
+
# file, then launches sdist to check they get pruned on all systems
|
| 93 |
+
|
| 94 |
+
# creating VCS directories with some files in them
|
| 95 |
+
os.mkdir(join(self.tmp_dir, 'somecode', '.svn'))
|
| 96 |
+
self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx')
|
| 97 |
+
|
| 98 |
+
os.mkdir(join(self.tmp_dir, 'somecode', '.hg'))
|
| 99 |
+
self.write_file((self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx')
|
| 100 |
+
|
| 101 |
+
os.mkdir(join(self.tmp_dir, 'somecode', '.git'))
|
| 102 |
+
self.write_file((self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx')
|
| 103 |
+
|
| 104 |
+
self.write_file((self.tmp_dir, 'somecode', '.nfs0001'), 'xxx')
|
| 105 |
+
|
| 106 |
+
# now building a sdist
|
| 107 |
+
dist, cmd = self.get_cmd()
|
| 108 |
+
|
| 109 |
+
# zip is available universally
|
| 110 |
+
# (tar might not be installed under win32)
|
| 111 |
+
cmd.formats = ['zip']
|
| 112 |
+
|
| 113 |
+
cmd.ensure_finalized()
|
| 114 |
+
cmd.run()
|
| 115 |
+
|
| 116 |
+
# now let's check what we have
|
| 117 |
+
dist_folder = join(self.tmp_dir, 'dist')
|
| 118 |
+
files = os.listdir(dist_folder)
|
| 119 |
+
assert files == ['ns_fake_pkg-1.0.zip']
|
| 120 |
+
|
| 121 |
+
zip_file = zipfile.ZipFile(join(dist_folder, 'ns_fake_pkg-1.0.zip'))
|
| 122 |
+
try:
|
| 123 |
+
content = zip_file.namelist()
|
| 124 |
+
finally:
|
| 125 |
+
zip_file.close()
|
| 126 |
+
|
| 127 |
+
# making sure everything has been pruned correctly
|
| 128 |
+
expected = [
|
| 129 |
+
'',
|
| 130 |
+
'PKG-INFO',
|
| 131 |
+
'README',
|
| 132 |
+
'setup.py',
|
| 133 |
+
'somecode/',
|
| 134 |
+
'somecode/__init__.py',
|
| 135 |
+
]
|
| 136 |
+
assert sorted(content) == ['ns_fake_pkg-1.0/' + x for x in expected]
|
| 137 |
+
|
| 138 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 139 |
+
@pytest.mark.skipif("not shutil.which('tar')")
|
| 140 |
+
@pytest.mark.skipif("not shutil.which('gzip')")
|
| 141 |
+
def test_make_distribution(self):
|
| 142 |
+
# now building a sdist
|
| 143 |
+
dist, cmd = self.get_cmd()
|
| 144 |
+
|
| 145 |
+
# creating a gztar then a tar
|
| 146 |
+
cmd.formats = ['gztar', 'tar']
|
| 147 |
+
cmd.ensure_finalized()
|
| 148 |
+
cmd.run()
|
| 149 |
+
|
| 150 |
+
# making sure we have two files
|
| 151 |
+
dist_folder = join(self.tmp_dir, 'dist')
|
| 152 |
+
result = os.listdir(dist_folder)
|
| 153 |
+
result.sort()
|
| 154 |
+
assert result == ['ns_fake_pkg-1.0.tar', 'ns_fake_pkg-1.0.tar.gz']
|
| 155 |
+
|
| 156 |
+
os.remove(join(dist_folder, 'ns_fake_pkg-1.0.tar'))
|
| 157 |
+
os.remove(join(dist_folder, 'ns_fake_pkg-1.0.tar.gz'))
|
| 158 |
+
|
| 159 |
+
# now trying a tar then a gztar
|
| 160 |
+
cmd.formats = ['tar', 'gztar']
|
| 161 |
+
|
| 162 |
+
cmd.ensure_finalized()
|
| 163 |
+
cmd.run()
|
| 164 |
+
|
| 165 |
+
result = os.listdir(dist_folder)
|
| 166 |
+
result.sort()
|
| 167 |
+
assert result == ['ns_fake_pkg-1.0.tar', 'ns_fake_pkg-1.0.tar.gz']
|
| 168 |
+
|
| 169 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 170 |
+
def test_add_defaults(self):
|
| 171 |
+
# https://bugs.python.org/issue2279
|
| 172 |
+
|
| 173 |
+
# add_default should also include
|
| 174 |
+
# data_files and package_data
|
| 175 |
+
dist, cmd = self.get_cmd()
|
| 176 |
+
|
| 177 |
+
# filling data_files by pointing files
|
| 178 |
+
# in package_data
|
| 179 |
+
dist.package_data = {'': ['*.cfg', '*.dat'], 'somecode': ['*.txt']}
|
| 180 |
+
self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#')
|
| 181 |
+
self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#')
|
| 182 |
+
|
| 183 |
+
# adding some data in data_files
|
| 184 |
+
data_dir = join(self.tmp_dir, 'data')
|
| 185 |
+
os.mkdir(data_dir)
|
| 186 |
+
self.write_file((data_dir, 'data.dt'), '#')
|
| 187 |
+
some_dir = join(self.tmp_dir, 'some')
|
| 188 |
+
os.mkdir(some_dir)
|
| 189 |
+
# make sure VCS directories are pruned (#14004)
|
| 190 |
+
hg_dir = join(self.tmp_dir, '.hg')
|
| 191 |
+
os.mkdir(hg_dir)
|
| 192 |
+
self.write_file((hg_dir, 'last-message.txt'), '#')
|
| 193 |
+
# a buggy regex used to prevent this from working on windows (#6884)
|
| 194 |
+
self.write_file((self.tmp_dir, 'buildout.cfg'), '#')
|
| 195 |
+
self.write_file((self.tmp_dir, 'inroot.txt'), '#')
|
| 196 |
+
self.write_file((some_dir, 'file.txt'), '#')
|
| 197 |
+
self.write_file((some_dir, 'other_file.txt'), '#')
|
| 198 |
+
|
| 199 |
+
dist.data_files = [
|
| 200 |
+
('data', ['data/data.dt', 'buildout.cfg', 'inroot.txt', 'notexisting']),
|
| 201 |
+
'some/file.txt',
|
| 202 |
+
'some/other_file.txt',
|
| 203 |
+
]
|
| 204 |
+
|
| 205 |
+
# adding a script
|
| 206 |
+
script_dir = join(self.tmp_dir, 'scripts')
|
| 207 |
+
os.mkdir(script_dir)
|
| 208 |
+
self.write_file((script_dir, 'script.py'), '#')
|
| 209 |
+
dist.scripts = [join('scripts', 'script.py')]
|
| 210 |
+
|
| 211 |
+
cmd.formats = ['zip']
|
| 212 |
+
cmd.use_defaults = True
|
| 213 |
+
|
| 214 |
+
cmd.ensure_finalized()
|
| 215 |
+
cmd.run()
|
| 216 |
+
|
| 217 |
+
# now let's check what we have
|
| 218 |
+
dist_folder = join(self.tmp_dir, 'dist')
|
| 219 |
+
files = os.listdir(dist_folder)
|
| 220 |
+
assert files == ['ns_fake_pkg-1.0.zip']
|
| 221 |
+
|
| 222 |
+
zip_file = zipfile.ZipFile(join(dist_folder, 'ns_fake_pkg-1.0.zip'))
|
| 223 |
+
try:
|
| 224 |
+
content = zip_file.namelist()
|
| 225 |
+
finally:
|
| 226 |
+
zip_file.close()
|
| 227 |
+
|
| 228 |
+
# making sure everything was added
|
| 229 |
+
expected = [
|
| 230 |
+
'',
|
| 231 |
+
'PKG-INFO',
|
| 232 |
+
'README',
|
| 233 |
+
'buildout.cfg',
|
| 234 |
+
'data/',
|
| 235 |
+
'data/data.dt',
|
| 236 |
+
'inroot.txt',
|
| 237 |
+
'scripts/',
|
| 238 |
+
'scripts/script.py',
|
| 239 |
+
'setup.py',
|
| 240 |
+
'some/',
|
| 241 |
+
'some/file.txt',
|
| 242 |
+
'some/other_file.txt',
|
| 243 |
+
'somecode/',
|
| 244 |
+
'somecode/__init__.py',
|
| 245 |
+
'somecode/doc.dat',
|
| 246 |
+
'somecode/doc.txt',
|
| 247 |
+
]
|
| 248 |
+
assert sorted(content) == ['ns_fake_pkg-1.0/' + x for x in expected]
|
| 249 |
+
|
| 250 |
+
# checking the MANIFEST
|
| 251 |
+
manifest = pathlib.Path(self.tmp_dir, 'MANIFEST').read_text(encoding='utf-8')
|
| 252 |
+
assert manifest == MANIFEST % {'sep': os.sep}
|
| 253 |
+
|
| 254 |
+
@staticmethod
|
| 255 |
+
def warnings(messages, prefix='warning: '):
|
| 256 |
+
return [msg for msg in messages if msg.startswith(prefix)]
|
| 257 |
+
|
| 258 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 259 |
+
def test_metadata_check_option(self, caplog):
|
| 260 |
+
# testing the `medata-check` option
|
| 261 |
+
dist, cmd = self.get_cmd(metadata={})
|
| 262 |
+
|
| 263 |
+
# this should raise some warnings !
|
| 264 |
+
# with the `check` subcommand
|
| 265 |
+
cmd.ensure_finalized()
|
| 266 |
+
cmd.run()
|
| 267 |
+
assert len(self.warnings(caplog.messages, 'warning: check: ')) == 1
|
| 268 |
+
|
| 269 |
+
# trying with a complete set of metadata
|
| 270 |
+
caplog.clear()
|
| 271 |
+
dist, cmd = self.get_cmd()
|
| 272 |
+
cmd.ensure_finalized()
|
| 273 |
+
cmd.metadata_check = False
|
| 274 |
+
cmd.run()
|
| 275 |
+
assert len(self.warnings(caplog.messages, 'warning: check: ')) == 0
|
| 276 |
+
|
| 277 |
+
def test_show_formats(self, capsys):
|
| 278 |
+
show_formats()
|
| 279 |
+
|
| 280 |
+
# the output should be a header line + one line per format
|
| 281 |
+
num_formats = len(ARCHIVE_FORMATS.keys())
|
| 282 |
+
output = [
|
| 283 |
+
line
|
| 284 |
+
for line in capsys.readouterr().out.split('\n')
|
| 285 |
+
if line.strip().startswith('--formats=')
|
| 286 |
+
]
|
| 287 |
+
assert len(output) == num_formats
|
| 288 |
+
|
| 289 |
+
def test_finalize_options(self):
|
| 290 |
+
dist, cmd = self.get_cmd()
|
| 291 |
+
cmd.finalize_options()
|
| 292 |
+
|
| 293 |
+
# default options set by finalize
|
| 294 |
+
assert cmd.manifest == 'MANIFEST'
|
| 295 |
+
assert cmd.template == 'MANIFEST.in'
|
| 296 |
+
assert cmd.dist_dir == 'dist'
|
| 297 |
+
|
| 298 |
+
# formats has to be a string splitable on (' ', ',') or
|
| 299 |
+
# a stringlist
|
| 300 |
+
cmd.formats = 1
|
| 301 |
+
with pytest.raises(DistutilsOptionError):
|
| 302 |
+
cmd.finalize_options()
|
| 303 |
+
cmd.formats = ['zip']
|
| 304 |
+
cmd.finalize_options()
|
| 305 |
+
|
| 306 |
+
# formats has to be known
|
| 307 |
+
cmd.formats = 'supazipa'
|
| 308 |
+
with pytest.raises(DistutilsOptionError):
|
| 309 |
+
cmd.finalize_options()
|
| 310 |
+
|
| 311 |
+
# the following tests make sure there is a nice error message instead
|
| 312 |
+
# of a traceback when parsing an invalid manifest template
|
| 313 |
+
|
| 314 |
+
def _check_template(self, content, caplog):
|
| 315 |
+
dist, cmd = self.get_cmd()
|
| 316 |
+
os.chdir(self.tmp_dir)
|
| 317 |
+
self.write_file('MANIFEST.in', content)
|
| 318 |
+
cmd.ensure_finalized()
|
| 319 |
+
cmd.filelist = FileList()
|
| 320 |
+
cmd.read_template()
|
| 321 |
+
assert len(self.warnings(caplog.messages)) == 1
|
| 322 |
+
|
| 323 |
+
def test_invalid_template_unknown_command(self, caplog):
|
| 324 |
+
self._check_template('taunt knights *', caplog)
|
| 325 |
+
|
| 326 |
+
def test_invalid_template_wrong_arguments(self, caplog):
|
| 327 |
+
# this manifest command takes one argument
|
| 328 |
+
self._check_template('prune', caplog)
|
| 329 |
+
|
| 330 |
+
@pytest.mark.skipif("platform.system() != 'Windows'")
|
| 331 |
+
def test_invalid_template_wrong_path(self, caplog):
|
| 332 |
+
# on Windows, trailing slashes are not allowed
|
| 333 |
+
# this used to crash instead of raising a warning: #8286
|
| 334 |
+
self._check_template('include examples/', caplog)
|
| 335 |
+
|
| 336 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 337 |
+
def test_get_file_list(self):
|
| 338 |
+
# make sure MANIFEST is recalculated
|
| 339 |
+
dist, cmd = self.get_cmd()
|
| 340 |
+
|
| 341 |
+
# filling data_files by pointing files in package_data
|
| 342 |
+
dist.package_data = {'somecode': ['*.txt']}
|
| 343 |
+
self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#')
|
| 344 |
+
cmd.formats = ['gztar']
|
| 345 |
+
cmd.ensure_finalized()
|
| 346 |
+
cmd.run()
|
| 347 |
+
|
| 348 |
+
assert ilen(clean_lines(cmd.manifest)) == 5
|
| 349 |
+
|
| 350 |
+
# adding a file
|
| 351 |
+
self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
|
| 352 |
+
|
| 353 |
+
# make sure build_py is reinitialized, like a fresh run
|
| 354 |
+
build_py = dist.get_command_obj('build_py')
|
| 355 |
+
build_py.finalized = False
|
| 356 |
+
build_py.ensure_finalized()
|
| 357 |
+
|
| 358 |
+
cmd.run()
|
| 359 |
+
|
| 360 |
+
manifest2 = list(clean_lines(cmd.manifest))
|
| 361 |
+
|
| 362 |
+
# do we have the new file in MANIFEST ?
|
| 363 |
+
assert len(manifest2) == 6
|
| 364 |
+
assert 'doc2.txt' in manifest2[-1]
|
| 365 |
+
|
| 366 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 367 |
+
def test_manifest_marker(self):
|
| 368 |
+
# check that autogenerated MANIFESTs have a marker
|
| 369 |
+
dist, cmd = self.get_cmd()
|
| 370 |
+
cmd.ensure_finalized()
|
| 371 |
+
cmd.run()
|
| 372 |
+
|
| 373 |
+
assert (
|
| 374 |
+
next(clean_lines(cmd.manifest))
|
| 375 |
+
== '# file GENERATED by distutils, do NOT edit'
|
| 376 |
+
)
|
| 377 |
+
|
| 378 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 379 |
+
def test_manifest_comments(self):
|
| 380 |
+
# make sure comments don't cause exceptions or wrong includes
|
| 381 |
+
contents = dedent(
|
| 382 |
+
"""\
|
| 383 |
+
# bad.py
|
| 384 |
+
#bad.py
|
| 385 |
+
good.py
|
| 386 |
+
"""
|
| 387 |
+
)
|
| 388 |
+
dist, cmd = self.get_cmd()
|
| 389 |
+
cmd.ensure_finalized()
|
| 390 |
+
self.write_file((self.tmp_dir, cmd.manifest), contents)
|
| 391 |
+
self.write_file((self.tmp_dir, 'good.py'), '# pick me!')
|
| 392 |
+
self.write_file((self.tmp_dir, 'bad.py'), "# don't pick me!")
|
| 393 |
+
self.write_file((self.tmp_dir, '#bad.py'), "# don't pick me!")
|
| 394 |
+
cmd.run()
|
| 395 |
+
assert cmd.filelist.files == ['good.py']
|
| 396 |
+
|
| 397 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 398 |
+
def test_manual_manifest(self):
|
| 399 |
+
# check that a MANIFEST without a marker is left alone
|
| 400 |
+
dist, cmd = self.get_cmd()
|
| 401 |
+
cmd.formats = ['gztar']
|
| 402 |
+
cmd.ensure_finalized()
|
| 403 |
+
self.write_file((self.tmp_dir, cmd.manifest), 'README.manual')
|
| 404 |
+
self.write_file(
|
| 405 |
+
(self.tmp_dir, 'README.manual'),
|
| 406 |
+
'This project maintains its MANIFEST file itself.',
|
| 407 |
+
)
|
| 408 |
+
cmd.run()
|
| 409 |
+
assert cmd.filelist.files == ['README.manual']
|
| 410 |
+
|
| 411 |
+
assert list(clean_lines(cmd.manifest)) == ['README.manual']
|
| 412 |
+
|
| 413 |
+
archive_name = join(self.tmp_dir, 'dist', 'ns_fake_pkg-1.0.tar.gz')
|
| 414 |
+
archive = tarfile.open(archive_name)
|
| 415 |
+
try:
|
| 416 |
+
filenames = [tarinfo.name for tarinfo in archive]
|
| 417 |
+
finally:
|
| 418 |
+
archive.close()
|
| 419 |
+
assert sorted(filenames) == [
|
| 420 |
+
'ns_fake_pkg-1.0',
|
| 421 |
+
'ns_fake_pkg-1.0/PKG-INFO',
|
| 422 |
+
'ns_fake_pkg-1.0/README.manual',
|
| 423 |
+
]
|
| 424 |
+
|
| 425 |
+
@pytest.mark.usefixtures('needs_zlib')
|
| 426 |
+
@require_unix_id
|
| 427 |
+
@require_uid_0
|
| 428 |
+
@pytest.mark.skipif("not shutil.which('tar')")
|
| 429 |
+
@pytest.mark.skipif("not shutil.which('gzip')")
|
| 430 |
+
def test_make_distribution_owner_group(self):
|
| 431 |
+
# now building a sdist
|
| 432 |
+
dist, cmd = self.get_cmd()
|
| 433 |
+
|
| 434 |
+
# creating a gztar and specifying the owner+group
|
| 435 |
+
cmd.formats = ['gztar']
|
| 436 |
+
cmd.owner = pwd.getpwuid(0)[0]
|
| 437 |
+
cmd.group = grp.getgrgid(0)[0]
|
| 438 |
+
cmd.ensure_finalized()
|
| 439 |
+
cmd.run()
|
| 440 |
+
|
| 441 |
+
# making sure we have the good rights
|
| 442 |
+
archive_name = join(self.tmp_dir, 'dist', 'ns_fake_pkg-1.0.tar.gz')
|
| 443 |
+
archive = tarfile.open(archive_name)
|
| 444 |
+
try:
|
| 445 |
+
for member in archive.getmembers():
|
| 446 |
+
assert member.uid == 0
|
| 447 |
+
assert member.gid == 0
|
| 448 |
+
finally:
|
| 449 |
+
archive.close()
|
| 450 |
+
|
| 451 |
+
# building a sdist again
|
| 452 |
+
dist, cmd = self.get_cmd()
|
| 453 |
+
|
| 454 |
+
# creating a gztar
|
| 455 |
+
cmd.formats = ['gztar']
|
| 456 |
+
cmd.ensure_finalized()
|
| 457 |
+
cmd.run()
|
| 458 |
+
|
| 459 |
+
# making sure we have the good rights
|
| 460 |
+
archive_name = join(self.tmp_dir, 'dist', 'ns_fake_pkg-1.0.tar.gz')
|
| 461 |
+
archive = tarfile.open(archive_name)
|
| 462 |
+
|
| 463 |
+
# note that we are not testing the group ownership here
|
| 464 |
+
# because, depending on the platforms and the container
|
| 465 |
+
# rights (see #7408)
|
| 466 |
+
try:
|
| 467 |
+
for member in archive.getmembers():
|
| 468 |
+
assert member.uid == os.getuid()
|
| 469 |
+
finally:
|
| 470 |
+
archive.close()
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_spawn.py
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.spawn."""
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import stat
|
| 5 |
+
import sys
|
| 6 |
+
import unittest.mock as mock
|
| 7 |
+
from distutils.errors import DistutilsExecError
|
| 8 |
+
from distutils.spawn import find_executable, spawn
|
| 9 |
+
from distutils.tests import support
|
| 10 |
+
|
| 11 |
+
import path
|
| 12 |
+
import pytest
|
| 13 |
+
from test.support import unix_shell
|
| 14 |
+
|
| 15 |
+
from .compat import py39 as os_helper
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class TestSpawn(support.TempdirManager):
|
| 19 |
+
@pytest.mark.skipif("os.name not in ('nt', 'posix')")
|
| 20 |
+
def test_spawn(self):
|
| 21 |
+
tmpdir = self.mkdtemp()
|
| 22 |
+
|
| 23 |
+
# creating something executable
|
| 24 |
+
# through the shell that returns 1
|
| 25 |
+
if sys.platform != 'win32':
|
| 26 |
+
exe = os.path.join(tmpdir, 'foo.sh')
|
| 27 |
+
self.write_file(exe, f'#!{unix_shell}\nexit 1')
|
| 28 |
+
else:
|
| 29 |
+
exe = os.path.join(tmpdir, 'foo.bat')
|
| 30 |
+
self.write_file(exe, 'exit 1')
|
| 31 |
+
|
| 32 |
+
os.chmod(exe, 0o777)
|
| 33 |
+
with pytest.raises(DistutilsExecError):
|
| 34 |
+
spawn([exe])
|
| 35 |
+
|
| 36 |
+
# now something that works
|
| 37 |
+
if sys.platform != 'win32':
|
| 38 |
+
exe = os.path.join(tmpdir, 'foo.sh')
|
| 39 |
+
self.write_file(exe, f'#!{unix_shell}\nexit 0')
|
| 40 |
+
else:
|
| 41 |
+
exe = os.path.join(tmpdir, 'foo.bat')
|
| 42 |
+
self.write_file(exe, 'exit 0')
|
| 43 |
+
|
| 44 |
+
os.chmod(exe, 0o777)
|
| 45 |
+
spawn([exe]) # should work without any error
|
| 46 |
+
|
| 47 |
+
def test_find_executable(self, tmp_path):
|
| 48 |
+
program_path = self._make_executable(tmp_path, '.exe')
|
| 49 |
+
program = program_path.name
|
| 50 |
+
program_noeext = program_path.with_suffix('').name
|
| 51 |
+
filename = str(program_path)
|
| 52 |
+
tmp_dir = path.Path(tmp_path)
|
| 53 |
+
|
| 54 |
+
# test path parameter
|
| 55 |
+
rv = find_executable(program, path=tmp_dir)
|
| 56 |
+
assert rv == filename
|
| 57 |
+
|
| 58 |
+
if sys.platform == 'win32':
|
| 59 |
+
# test without ".exe" extension
|
| 60 |
+
rv = find_executable(program_noeext, path=tmp_dir)
|
| 61 |
+
assert rv == filename
|
| 62 |
+
|
| 63 |
+
# test find in the current directory
|
| 64 |
+
with tmp_dir:
|
| 65 |
+
rv = find_executable(program)
|
| 66 |
+
assert rv == program
|
| 67 |
+
|
| 68 |
+
# test non-existent program
|
| 69 |
+
dont_exist_program = "dontexist_" + program
|
| 70 |
+
rv = find_executable(dont_exist_program, path=tmp_dir)
|
| 71 |
+
assert rv is None
|
| 72 |
+
|
| 73 |
+
# PATH='': no match, except in the current directory
|
| 74 |
+
with os_helper.EnvironmentVarGuard() as env:
|
| 75 |
+
env['PATH'] = ''
|
| 76 |
+
with (
|
| 77 |
+
mock.patch(
|
| 78 |
+
'distutils.spawn.os.confstr', return_value=tmp_dir, create=True
|
| 79 |
+
),
|
| 80 |
+
mock.patch('distutils.spawn.os.defpath', tmp_dir),
|
| 81 |
+
):
|
| 82 |
+
rv = find_executable(program)
|
| 83 |
+
assert rv is None
|
| 84 |
+
|
| 85 |
+
# look in current directory
|
| 86 |
+
with tmp_dir:
|
| 87 |
+
rv = find_executable(program)
|
| 88 |
+
assert rv == program
|
| 89 |
+
|
| 90 |
+
# PATH=':': explicitly looks in the current directory
|
| 91 |
+
with os_helper.EnvironmentVarGuard() as env:
|
| 92 |
+
env['PATH'] = os.pathsep
|
| 93 |
+
with (
|
| 94 |
+
mock.patch('distutils.spawn.os.confstr', return_value='', create=True),
|
| 95 |
+
mock.patch('distutils.spawn.os.defpath', ''),
|
| 96 |
+
):
|
| 97 |
+
rv = find_executable(program)
|
| 98 |
+
assert rv is None
|
| 99 |
+
|
| 100 |
+
# look in current directory
|
| 101 |
+
with tmp_dir:
|
| 102 |
+
rv = find_executable(program)
|
| 103 |
+
assert rv == program
|
| 104 |
+
|
| 105 |
+
# missing PATH: test os.confstr("CS_PATH") and os.defpath
|
| 106 |
+
with os_helper.EnvironmentVarGuard() as env:
|
| 107 |
+
env.pop('PATH', None)
|
| 108 |
+
|
| 109 |
+
# without confstr
|
| 110 |
+
with (
|
| 111 |
+
mock.patch(
|
| 112 |
+
'distutils.spawn.os.confstr', side_effect=ValueError, create=True
|
| 113 |
+
),
|
| 114 |
+
mock.patch('distutils.spawn.os.defpath', tmp_dir),
|
| 115 |
+
):
|
| 116 |
+
rv = find_executable(program)
|
| 117 |
+
assert rv == filename
|
| 118 |
+
|
| 119 |
+
# with confstr
|
| 120 |
+
with (
|
| 121 |
+
mock.patch(
|
| 122 |
+
'distutils.spawn.os.confstr', return_value=tmp_dir, create=True
|
| 123 |
+
),
|
| 124 |
+
mock.patch('distutils.spawn.os.defpath', ''),
|
| 125 |
+
):
|
| 126 |
+
rv = find_executable(program)
|
| 127 |
+
assert rv == filename
|
| 128 |
+
|
| 129 |
+
@staticmethod
|
| 130 |
+
def _make_executable(tmp_path, ext):
|
| 131 |
+
# Give the temporary program a suffix regardless of platform.
|
| 132 |
+
# It's needed on Windows and not harmful on others.
|
| 133 |
+
program = tmp_path.joinpath('program').with_suffix(ext)
|
| 134 |
+
program.write_text("", encoding='utf-8')
|
| 135 |
+
program.chmod(stat.S_IXUSR)
|
| 136 |
+
return program
|
| 137 |
+
|
| 138 |
+
def test_spawn_missing_exe(self):
|
| 139 |
+
with pytest.raises(DistutilsExecError) as ctx:
|
| 140 |
+
spawn(['does-not-exist'])
|
| 141 |
+
assert "command 'does-not-exist' failed" in str(ctx.value)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_sysconfig.py
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.sysconfig."""
|
| 2 |
+
|
| 3 |
+
import contextlib
|
| 4 |
+
import distutils
|
| 5 |
+
import os
|
| 6 |
+
import pathlib
|
| 7 |
+
import subprocess
|
| 8 |
+
import sys
|
| 9 |
+
from distutils import sysconfig
|
| 10 |
+
from distutils.ccompiler import new_compiler # noqa: F401
|
| 11 |
+
from distutils.unixccompiler import UnixCCompiler
|
| 12 |
+
|
| 13 |
+
import jaraco.envs
|
| 14 |
+
import path
|
| 15 |
+
import pytest
|
| 16 |
+
from jaraco.text import trim
|
| 17 |
+
from test.support import swap_item
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def _gen_makefile(root, contents):
|
| 21 |
+
jaraco.path.build({'Makefile': trim(contents)}, root)
|
| 22 |
+
return root / 'Makefile'
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
@pytest.mark.usefixtures('save_env')
|
| 26 |
+
class TestSysconfig:
|
| 27 |
+
def test_get_config_h_filename(self):
|
| 28 |
+
config_h = sysconfig.get_config_h_filename()
|
| 29 |
+
assert os.path.isfile(config_h)
|
| 30 |
+
|
| 31 |
+
@pytest.mark.skipif("platform.system() == 'Windows'")
|
| 32 |
+
@pytest.mark.skipif("sys.implementation.name != 'cpython'")
|
| 33 |
+
def test_get_makefile_filename(self):
|
| 34 |
+
makefile = sysconfig.get_makefile_filename()
|
| 35 |
+
assert os.path.isfile(makefile)
|
| 36 |
+
|
| 37 |
+
def test_get_python_lib(self, tmp_path):
|
| 38 |
+
assert sysconfig.get_python_lib() != sysconfig.get_python_lib(prefix=tmp_path)
|
| 39 |
+
|
| 40 |
+
def test_get_config_vars(self):
|
| 41 |
+
cvars = sysconfig.get_config_vars()
|
| 42 |
+
assert isinstance(cvars, dict)
|
| 43 |
+
assert cvars
|
| 44 |
+
|
| 45 |
+
@pytest.mark.skipif('sysconfig.IS_PYPY')
|
| 46 |
+
@pytest.mark.skipif('sysconfig.python_build')
|
| 47 |
+
@pytest.mark.xfail('platform.system() == "Windows"')
|
| 48 |
+
def test_srcdir_simple(self):
|
| 49 |
+
# See #15364.
|
| 50 |
+
srcdir = pathlib.Path(sysconfig.get_config_var('srcdir'))
|
| 51 |
+
|
| 52 |
+
assert srcdir.absolute()
|
| 53 |
+
assert srcdir.is_dir()
|
| 54 |
+
|
| 55 |
+
makefile = pathlib.Path(sysconfig.get_makefile_filename())
|
| 56 |
+
assert makefile.parent.samefile(srcdir)
|
| 57 |
+
|
| 58 |
+
@pytest.mark.skipif('sysconfig.IS_PYPY')
|
| 59 |
+
@pytest.mark.skipif('not sysconfig.python_build')
|
| 60 |
+
def test_srcdir_python_build(self):
|
| 61 |
+
# See #15364.
|
| 62 |
+
srcdir = pathlib.Path(sysconfig.get_config_var('srcdir'))
|
| 63 |
+
|
| 64 |
+
# The python executable has not been installed so srcdir
|
| 65 |
+
# should be a full source checkout.
|
| 66 |
+
Python_h = srcdir.joinpath('Include', 'Python.h')
|
| 67 |
+
assert Python_h.is_file()
|
| 68 |
+
assert sysconfig._is_python_source_dir(srcdir)
|
| 69 |
+
assert sysconfig._is_python_source_dir(str(srcdir))
|
| 70 |
+
|
| 71 |
+
def test_srcdir_independent_of_cwd(self):
|
| 72 |
+
"""
|
| 73 |
+
srcdir should be independent of the current working directory
|
| 74 |
+
"""
|
| 75 |
+
# See #15364.
|
| 76 |
+
srcdir = sysconfig.get_config_var('srcdir')
|
| 77 |
+
with path.Path('..'):
|
| 78 |
+
srcdir2 = sysconfig.get_config_var('srcdir')
|
| 79 |
+
assert srcdir == srcdir2
|
| 80 |
+
|
| 81 |
+
def customize_compiler(self):
|
| 82 |
+
# make sure AR gets caught
|
| 83 |
+
class compiler:
|
| 84 |
+
compiler_type = 'unix'
|
| 85 |
+
executables = UnixCCompiler.executables
|
| 86 |
+
|
| 87 |
+
def __init__(self):
|
| 88 |
+
self.exes = {}
|
| 89 |
+
|
| 90 |
+
def set_executables(self, **kw):
|
| 91 |
+
for k, v in kw.items():
|
| 92 |
+
self.exes[k] = v
|
| 93 |
+
|
| 94 |
+
sysconfig_vars = {
|
| 95 |
+
'AR': 'sc_ar',
|
| 96 |
+
'CC': 'sc_cc',
|
| 97 |
+
'CXX': 'sc_cxx',
|
| 98 |
+
'ARFLAGS': '--sc-arflags',
|
| 99 |
+
'CFLAGS': '--sc-cflags',
|
| 100 |
+
'CCSHARED': '--sc-ccshared',
|
| 101 |
+
'LDSHARED': 'sc_ldshared',
|
| 102 |
+
'SHLIB_SUFFIX': 'sc_shutil_suffix',
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
comp = compiler()
|
| 106 |
+
with contextlib.ExitStack() as cm:
|
| 107 |
+
for key, value in sysconfig_vars.items():
|
| 108 |
+
cm.enter_context(swap_item(sysconfig._config_vars, key, value))
|
| 109 |
+
sysconfig.customize_compiler(comp)
|
| 110 |
+
|
| 111 |
+
return comp
|
| 112 |
+
|
| 113 |
+
@pytest.mark.skipif("not isinstance(new_compiler(), UnixCCompiler)")
|
| 114 |
+
@pytest.mark.usefixtures('disable_macos_customization')
|
| 115 |
+
def test_customize_compiler(self):
|
| 116 |
+
# Make sure that sysconfig._config_vars is initialized
|
| 117 |
+
sysconfig.get_config_vars()
|
| 118 |
+
|
| 119 |
+
os.environ['AR'] = 'env_ar'
|
| 120 |
+
os.environ['CC'] = 'env_cc'
|
| 121 |
+
os.environ['CPP'] = 'env_cpp'
|
| 122 |
+
os.environ['CXX'] = 'env_cxx --env-cxx-flags'
|
| 123 |
+
os.environ['LDSHARED'] = 'env_ldshared'
|
| 124 |
+
os.environ['LDFLAGS'] = '--env-ldflags'
|
| 125 |
+
os.environ['ARFLAGS'] = '--env-arflags'
|
| 126 |
+
os.environ['CFLAGS'] = '--env-cflags'
|
| 127 |
+
os.environ['CPPFLAGS'] = '--env-cppflags'
|
| 128 |
+
os.environ['RANLIB'] = 'env_ranlib'
|
| 129 |
+
|
| 130 |
+
comp = self.customize_compiler()
|
| 131 |
+
assert comp.exes['archiver'] == 'env_ar --env-arflags'
|
| 132 |
+
assert comp.exes['preprocessor'] == 'env_cpp --env-cppflags'
|
| 133 |
+
assert comp.exes['compiler'] == 'env_cc --env-cflags --env-cppflags'
|
| 134 |
+
assert comp.exes['compiler_so'] == (
|
| 135 |
+
'env_cc --env-cflags --env-cppflags --sc-ccshared'
|
| 136 |
+
)
|
| 137 |
+
assert (
|
| 138 |
+
comp.exes['compiler_cxx']
|
| 139 |
+
== 'env_cxx --env-cxx-flags --sc-cflags --env-cppflags'
|
| 140 |
+
)
|
| 141 |
+
assert comp.exes['linker_exe'] == 'env_cc'
|
| 142 |
+
assert comp.exes['linker_so'] == (
|
| 143 |
+
'env_ldshared --env-ldflags --env-cflags --env-cppflags'
|
| 144 |
+
)
|
| 145 |
+
assert comp.shared_lib_extension == 'sc_shutil_suffix'
|
| 146 |
+
|
| 147 |
+
if sys.platform == "darwin":
|
| 148 |
+
assert comp.exes['ranlib'] == 'env_ranlib'
|
| 149 |
+
else:
|
| 150 |
+
assert 'ranlib' not in comp.exes
|
| 151 |
+
|
| 152 |
+
del os.environ['AR']
|
| 153 |
+
del os.environ['CC']
|
| 154 |
+
del os.environ['CPP']
|
| 155 |
+
del os.environ['CXX']
|
| 156 |
+
del os.environ['LDSHARED']
|
| 157 |
+
del os.environ['LDFLAGS']
|
| 158 |
+
del os.environ['ARFLAGS']
|
| 159 |
+
del os.environ['CFLAGS']
|
| 160 |
+
del os.environ['CPPFLAGS']
|
| 161 |
+
del os.environ['RANLIB']
|
| 162 |
+
|
| 163 |
+
comp = self.customize_compiler()
|
| 164 |
+
assert comp.exes['archiver'] == 'sc_ar --sc-arflags'
|
| 165 |
+
assert comp.exes['preprocessor'] == 'sc_cc -E'
|
| 166 |
+
assert comp.exes['compiler'] == 'sc_cc --sc-cflags'
|
| 167 |
+
assert comp.exes['compiler_so'] == 'sc_cc --sc-cflags --sc-ccshared'
|
| 168 |
+
assert comp.exes['compiler_cxx'] == 'sc_cxx --sc-cflags'
|
| 169 |
+
assert comp.exes['linker_exe'] == 'sc_cc'
|
| 170 |
+
assert comp.exes['linker_so'] == 'sc_ldshared'
|
| 171 |
+
assert comp.shared_lib_extension == 'sc_shutil_suffix'
|
| 172 |
+
assert 'ranlib' not in comp.exes
|
| 173 |
+
|
| 174 |
+
def test_parse_makefile_base(self, tmp_path):
|
| 175 |
+
makefile = _gen_makefile(
|
| 176 |
+
tmp_path,
|
| 177 |
+
"""
|
| 178 |
+
CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'
|
| 179 |
+
VAR=$OTHER
|
| 180 |
+
OTHER=foo
|
| 181 |
+
""",
|
| 182 |
+
)
|
| 183 |
+
d = sysconfig.parse_makefile(makefile)
|
| 184 |
+
assert d == {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'", 'OTHER': 'foo'}
|
| 185 |
+
|
| 186 |
+
def test_parse_makefile_literal_dollar(self, tmp_path):
|
| 187 |
+
makefile = _gen_makefile(
|
| 188 |
+
tmp_path,
|
| 189 |
+
"""
|
| 190 |
+
CONFIG_ARGS= '--arg1=optarg1' 'ENV=\\$$LIB'
|
| 191 |
+
VAR=$OTHER
|
| 192 |
+
OTHER=foo
|
| 193 |
+
""",
|
| 194 |
+
)
|
| 195 |
+
d = sysconfig.parse_makefile(makefile)
|
| 196 |
+
assert d == {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'", 'OTHER': 'foo'}
|
| 197 |
+
|
| 198 |
+
def test_sysconfig_module(self):
|
| 199 |
+
import sysconfig as global_sysconfig
|
| 200 |
+
|
| 201 |
+
assert global_sysconfig.get_config_var('CFLAGS') == sysconfig.get_config_var(
|
| 202 |
+
'CFLAGS'
|
| 203 |
+
)
|
| 204 |
+
assert global_sysconfig.get_config_var('LDFLAGS') == sysconfig.get_config_var(
|
| 205 |
+
'LDFLAGS'
|
| 206 |
+
)
|
| 207 |
+
|
| 208 |
+
# On macOS, binary installers support extension module building on
|
| 209 |
+
# various levels of the operating system with differing Xcode
|
| 210 |
+
# configurations, requiring customization of some of the
|
| 211 |
+
# compiler configuration directives to suit the environment on
|
| 212 |
+
# the installed machine. Some of these customizations may require
|
| 213 |
+
# running external programs and are thus deferred until needed by
|
| 214 |
+
# the first extension module build. Only
|
| 215 |
+
# the Distutils version of sysconfig is used for extension module
|
| 216 |
+
# builds, which happens earlier in the Distutils tests. This may
|
| 217 |
+
# cause the following tests to fail since no tests have caused
|
| 218 |
+
# the global version of sysconfig to call the customization yet.
|
| 219 |
+
# The solution for now is to simply skip this test in this case.
|
| 220 |
+
# The longer-term solution is to only have one version of sysconfig.
|
| 221 |
+
@pytest.mark.skipif("sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER')")
|
| 222 |
+
def test_sysconfig_compiler_vars(self):
|
| 223 |
+
import sysconfig as global_sysconfig
|
| 224 |
+
|
| 225 |
+
if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'):
|
| 226 |
+
pytest.skip('compiler flags customized')
|
| 227 |
+
assert global_sysconfig.get_config_var('LDSHARED') == sysconfig.get_config_var(
|
| 228 |
+
'LDSHARED'
|
| 229 |
+
)
|
| 230 |
+
assert global_sysconfig.get_config_var('CC') == sysconfig.get_config_var('CC')
|
| 231 |
+
|
| 232 |
+
@pytest.mark.skipif("not sysconfig.get_config_var('EXT_SUFFIX')")
|
| 233 |
+
def test_SO_deprecation(self):
|
| 234 |
+
with pytest.warns(DeprecationWarning):
|
| 235 |
+
sysconfig.get_config_var('SO')
|
| 236 |
+
|
| 237 |
+
def test_customize_compiler_before_get_config_vars(self, tmp_path):
|
| 238 |
+
# Issue #21923: test that a Distribution compiler
|
| 239 |
+
# instance can be called without an explicit call to
|
| 240 |
+
# get_config_vars().
|
| 241 |
+
jaraco.path.build(
|
| 242 |
+
{
|
| 243 |
+
'file': trim("""
|
| 244 |
+
from distutils.core import Distribution
|
| 245 |
+
config = Distribution().get_command_obj('config')
|
| 246 |
+
# try_compile may pass or it may fail if no compiler
|
| 247 |
+
# is found but it should not raise an exception.
|
| 248 |
+
rc = config.try_compile('int x;')
|
| 249 |
+
""")
|
| 250 |
+
},
|
| 251 |
+
tmp_path,
|
| 252 |
+
)
|
| 253 |
+
p = subprocess.Popen(
|
| 254 |
+
[sys.executable, tmp_path / 'file'],
|
| 255 |
+
stdout=subprocess.PIPE,
|
| 256 |
+
stderr=subprocess.STDOUT,
|
| 257 |
+
universal_newlines=True,
|
| 258 |
+
encoding='utf-8',
|
| 259 |
+
)
|
| 260 |
+
outs, errs = p.communicate()
|
| 261 |
+
assert 0 == p.returncode, "Subprocess failed: " + outs
|
| 262 |
+
|
| 263 |
+
def test_parse_config_h(self):
|
| 264 |
+
config_h = sysconfig.get_config_h_filename()
|
| 265 |
+
input = {}
|
| 266 |
+
with open(config_h, encoding="utf-8") as f:
|
| 267 |
+
result = sysconfig.parse_config_h(f, g=input)
|
| 268 |
+
assert input is result
|
| 269 |
+
with open(config_h, encoding="utf-8") as f:
|
| 270 |
+
result = sysconfig.parse_config_h(f)
|
| 271 |
+
assert isinstance(result, dict)
|
| 272 |
+
|
| 273 |
+
@pytest.mark.skipif("platform.system() != 'Windows'")
|
| 274 |
+
@pytest.mark.skipif("sys.implementation.name != 'cpython'")
|
| 275 |
+
def test_win_ext_suffix(self):
|
| 276 |
+
assert sysconfig.get_config_var("EXT_SUFFIX").endswith(".pyd")
|
| 277 |
+
assert sysconfig.get_config_var("EXT_SUFFIX") != ".pyd"
|
| 278 |
+
|
| 279 |
+
@pytest.mark.skipif("platform.system() != 'Windows'")
|
| 280 |
+
@pytest.mark.skipif("sys.implementation.name != 'cpython'")
|
| 281 |
+
@pytest.mark.skipif(
|
| 282 |
+
'\\PCbuild\\'.casefold() not in sys.executable.casefold(),
|
| 283 |
+
reason='Need sys.executable to be in a source tree',
|
| 284 |
+
)
|
| 285 |
+
def test_win_build_venv_from_source_tree(self, tmp_path):
|
| 286 |
+
"""Ensure distutils.sysconfig detects venvs from source tree builds."""
|
| 287 |
+
env = jaraco.envs.VEnv()
|
| 288 |
+
env.create_opts = env.clean_opts
|
| 289 |
+
env.root = tmp_path
|
| 290 |
+
env.ensure_env()
|
| 291 |
+
cmd = [
|
| 292 |
+
env.exe(),
|
| 293 |
+
"-c",
|
| 294 |
+
"import distutils.sysconfig; print(distutils.sysconfig.python_build)",
|
| 295 |
+
]
|
| 296 |
+
distutils_path = os.path.dirname(os.path.dirname(distutils.__file__))
|
| 297 |
+
out = subprocess.check_output(
|
| 298 |
+
cmd, env={**os.environ, "PYTHONPATH": distutils_path}
|
| 299 |
+
)
|
| 300 |
+
assert out == "True"
|
| 301 |
+
|
| 302 |
+
def test_get_python_inc_missing_config_dir(self, monkeypatch):
|
| 303 |
+
"""
|
| 304 |
+
In portable Python installations, the sysconfig will be broken,
|
| 305 |
+
pointing to the directories where the installation was built and
|
| 306 |
+
not where it currently is. In this case, ensure that the missing
|
| 307 |
+
directory isn't used for get_python_inc.
|
| 308 |
+
|
| 309 |
+
See pypa/distutils#178.
|
| 310 |
+
"""
|
| 311 |
+
|
| 312 |
+
def override(name):
|
| 313 |
+
if name == 'INCLUDEPY':
|
| 314 |
+
return '/does-not-exist'
|
| 315 |
+
return sysconfig.get_config_var(name)
|
| 316 |
+
|
| 317 |
+
monkeypatch.setattr(sysconfig, 'get_config_var', override)
|
| 318 |
+
|
| 319 |
+
assert os.path.exists(sysconfig.get_python_inc())
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_text_file.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.text_file."""
|
| 2 |
+
|
| 3 |
+
from distutils.tests import support
|
| 4 |
+
from distutils.text_file import TextFile
|
| 5 |
+
|
| 6 |
+
import jaraco.path
|
| 7 |
+
import path
|
| 8 |
+
|
| 9 |
+
TEST_DATA = """# test file
|
| 10 |
+
|
| 11 |
+
line 3 \\
|
| 12 |
+
# intervening comment
|
| 13 |
+
continues on next line
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class TestTextFile(support.TempdirManager):
|
| 18 |
+
def test_class(self):
|
| 19 |
+
# old tests moved from text_file.__main__
|
| 20 |
+
# so they are really called by the buildbots
|
| 21 |
+
|
| 22 |
+
# result 1: no fancy options
|
| 23 |
+
result1 = [
|
| 24 |
+
'# test file\n',
|
| 25 |
+
'\n',
|
| 26 |
+
'line 3 \\\n',
|
| 27 |
+
'# intervening comment\n',
|
| 28 |
+
' continues on next line\n',
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
# result 2: just strip comments
|
| 32 |
+
result2 = ["\n", "line 3 \\\n", " continues on next line\n"]
|
| 33 |
+
|
| 34 |
+
# result 3: just strip blank lines
|
| 35 |
+
result3 = [
|
| 36 |
+
"# test file\n",
|
| 37 |
+
"line 3 \\\n",
|
| 38 |
+
"# intervening comment\n",
|
| 39 |
+
" continues on next line\n",
|
| 40 |
+
]
|
| 41 |
+
|
| 42 |
+
# result 4: default, strip comments, blank lines,
|
| 43 |
+
# and trailing whitespace
|
| 44 |
+
result4 = ["line 3 \\", " continues on next line"]
|
| 45 |
+
|
| 46 |
+
# result 5: strip comments and blanks, plus join lines (but don't
|
| 47 |
+
# "collapse" joined lines
|
| 48 |
+
result5 = ["line 3 continues on next line"]
|
| 49 |
+
|
| 50 |
+
# result 6: strip comments and blanks, plus join lines (and
|
| 51 |
+
# "collapse" joined lines
|
| 52 |
+
result6 = ["line 3 continues on next line"]
|
| 53 |
+
|
| 54 |
+
def test_input(count, description, file, expected_result):
|
| 55 |
+
result = file.readlines()
|
| 56 |
+
assert result == expected_result
|
| 57 |
+
|
| 58 |
+
tmp_path = path.Path(self.mkdtemp())
|
| 59 |
+
filename = tmp_path / 'test.txt'
|
| 60 |
+
jaraco.path.build({filename.name: TEST_DATA}, tmp_path)
|
| 61 |
+
|
| 62 |
+
in_file = TextFile(
|
| 63 |
+
filename,
|
| 64 |
+
strip_comments=False,
|
| 65 |
+
skip_blanks=False,
|
| 66 |
+
lstrip_ws=False,
|
| 67 |
+
rstrip_ws=False,
|
| 68 |
+
)
|
| 69 |
+
try:
|
| 70 |
+
test_input(1, "no processing", in_file, result1)
|
| 71 |
+
finally:
|
| 72 |
+
in_file.close()
|
| 73 |
+
|
| 74 |
+
in_file = TextFile(
|
| 75 |
+
filename,
|
| 76 |
+
strip_comments=True,
|
| 77 |
+
skip_blanks=False,
|
| 78 |
+
lstrip_ws=False,
|
| 79 |
+
rstrip_ws=False,
|
| 80 |
+
)
|
| 81 |
+
try:
|
| 82 |
+
test_input(2, "strip comments", in_file, result2)
|
| 83 |
+
finally:
|
| 84 |
+
in_file.close()
|
| 85 |
+
|
| 86 |
+
in_file = TextFile(
|
| 87 |
+
filename,
|
| 88 |
+
strip_comments=False,
|
| 89 |
+
skip_blanks=True,
|
| 90 |
+
lstrip_ws=False,
|
| 91 |
+
rstrip_ws=False,
|
| 92 |
+
)
|
| 93 |
+
try:
|
| 94 |
+
test_input(3, "strip blanks", in_file, result3)
|
| 95 |
+
finally:
|
| 96 |
+
in_file.close()
|
| 97 |
+
|
| 98 |
+
in_file = TextFile(filename)
|
| 99 |
+
try:
|
| 100 |
+
test_input(4, "default processing", in_file, result4)
|
| 101 |
+
finally:
|
| 102 |
+
in_file.close()
|
| 103 |
+
|
| 104 |
+
in_file = TextFile(
|
| 105 |
+
filename,
|
| 106 |
+
strip_comments=True,
|
| 107 |
+
skip_blanks=True,
|
| 108 |
+
join_lines=True,
|
| 109 |
+
rstrip_ws=True,
|
| 110 |
+
)
|
| 111 |
+
try:
|
| 112 |
+
test_input(5, "join lines without collapsing", in_file, result5)
|
| 113 |
+
finally:
|
| 114 |
+
in_file.close()
|
| 115 |
+
|
| 116 |
+
in_file = TextFile(
|
| 117 |
+
filename,
|
| 118 |
+
strip_comments=True,
|
| 119 |
+
skip_blanks=True,
|
| 120 |
+
join_lines=True,
|
| 121 |
+
rstrip_ws=True,
|
| 122 |
+
collapse_join=True,
|
| 123 |
+
)
|
| 124 |
+
try:
|
| 125 |
+
test_input(6, "join lines with collapsing", in_file, result6)
|
| 126 |
+
finally:
|
| 127 |
+
in_file.close()
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_util.py
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.util."""
|
| 2 |
+
|
| 3 |
+
import email
|
| 4 |
+
import email.generator
|
| 5 |
+
import email.policy
|
| 6 |
+
import io
|
| 7 |
+
import os
|
| 8 |
+
import pathlib
|
| 9 |
+
import sys
|
| 10 |
+
import sysconfig as stdlib_sysconfig
|
| 11 |
+
import unittest.mock as mock
|
| 12 |
+
from copy import copy
|
| 13 |
+
from distutils import sysconfig, util
|
| 14 |
+
from distutils.errors import DistutilsByteCompileError, DistutilsPlatformError
|
| 15 |
+
from distutils.util import (
|
| 16 |
+
byte_compile,
|
| 17 |
+
change_root,
|
| 18 |
+
check_environ,
|
| 19 |
+
convert_path,
|
| 20 |
+
get_host_platform,
|
| 21 |
+
get_platform,
|
| 22 |
+
grok_environment_error,
|
| 23 |
+
rfc822_escape,
|
| 24 |
+
split_quoted,
|
| 25 |
+
strtobool,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
import pytest
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@pytest.fixture(autouse=True)
|
| 32 |
+
def environment(monkeypatch):
|
| 33 |
+
monkeypatch.setattr(os, 'name', os.name)
|
| 34 |
+
monkeypatch.setattr(sys, 'platform', sys.platform)
|
| 35 |
+
monkeypatch.setattr(sys, 'version', sys.version)
|
| 36 |
+
monkeypatch.setattr(os, 'sep', os.sep)
|
| 37 |
+
monkeypatch.setattr(os.path, 'join', os.path.join)
|
| 38 |
+
monkeypatch.setattr(os.path, 'isabs', os.path.isabs)
|
| 39 |
+
monkeypatch.setattr(os.path, 'splitdrive', os.path.splitdrive)
|
| 40 |
+
monkeypatch.setattr(sysconfig, '_config_vars', copy(sysconfig._config_vars))
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
@pytest.mark.usefixtures('save_env')
|
| 44 |
+
class TestUtil:
|
| 45 |
+
def test_get_host_platform(self):
|
| 46 |
+
with mock.patch('os.name', 'nt'):
|
| 47 |
+
with mock.patch('sys.version', '... [... (ARM64)]'):
|
| 48 |
+
assert get_host_platform() == 'win-arm64'
|
| 49 |
+
with mock.patch('sys.version', '... [... (ARM)]'):
|
| 50 |
+
assert get_host_platform() == 'win-arm32'
|
| 51 |
+
|
| 52 |
+
with mock.patch('sys.version_info', (3, 9, 0, 'final', 0)):
|
| 53 |
+
assert get_host_platform() == stdlib_sysconfig.get_platform()
|
| 54 |
+
|
| 55 |
+
def test_get_platform(self):
|
| 56 |
+
with mock.patch('os.name', 'nt'):
|
| 57 |
+
with mock.patch.dict('os.environ', {'VSCMD_ARG_TGT_ARCH': 'x86'}):
|
| 58 |
+
assert get_platform() == 'win32'
|
| 59 |
+
with mock.patch.dict('os.environ', {'VSCMD_ARG_TGT_ARCH': 'x64'}):
|
| 60 |
+
assert get_platform() == 'win-amd64'
|
| 61 |
+
with mock.patch.dict('os.environ', {'VSCMD_ARG_TGT_ARCH': 'arm'}):
|
| 62 |
+
assert get_platform() == 'win-arm32'
|
| 63 |
+
with mock.patch.dict('os.environ', {'VSCMD_ARG_TGT_ARCH': 'arm64'}):
|
| 64 |
+
assert get_platform() == 'win-arm64'
|
| 65 |
+
|
| 66 |
+
def test_convert_path(self):
|
| 67 |
+
expected = os.sep.join(('', 'home', 'to', 'my', 'stuff'))
|
| 68 |
+
assert convert_path('/home/to/my/stuff') == expected
|
| 69 |
+
assert convert_path(pathlib.Path('/home/to/my/stuff')) == expected
|
| 70 |
+
assert convert_path('.') == os.curdir
|
| 71 |
+
|
| 72 |
+
def test_change_root(self):
|
| 73 |
+
# linux/mac
|
| 74 |
+
os.name = 'posix'
|
| 75 |
+
|
| 76 |
+
def _isabs(path):
|
| 77 |
+
return path[0] == '/'
|
| 78 |
+
|
| 79 |
+
os.path.isabs = _isabs
|
| 80 |
+
|
| 81 |
+
def _join(*path):
|
| 82 |
+
return '/'.join(path)
|
| 83 |
+
|
| 84 |
+
os.path.join = _join
|
| 85 |
+
|
| 86 |
+
assert change_root('/root', '/old/its/here') == '/root/old/its/here'
|
| 87 |
+
assert change_root('/root', 'its/here') == '/root/its/here'
|
| 88 |
+
|
| 89 |
+
# windows
|
| 90 |
+
os.name = 'nt'
|
| 91 |
+
os.sep = '\\'
|
| 92 |
+
|
| 93 |
+
def _isabs(path):
|
| 94 |
+
return path.startswith('c:\\')
|
| 95 |
+
|
| 96 |
+
os.path.isabs = _isabs
|
| 97 |
+
|
| 98 |
+
def _splitdrive(path):
|
| 99 |
+
if path.startswith('c:'):
|
| 100 |
+
return ('', path.replace('c:', ''))
|
| 101 |
+
return ('', path)
|
| 102 |
+
|
| 103 |
+
os.path.splitdrive = _splitdrive
|
| 104 |
+
|
| 105 |
+
def _join(*path):
|
| 106 |
+
return '\\'.join(path)
|
| 107 |
+
|
| 108 |
+
os.path.join = _join
|
| 109 |
+
|
| 110 |
+
assert (
|
| 111 |
+
change_root('c:\\root', 'c:\\old\\its\\here') == 'c:\\root\\old\\its\\here'
|
| 112 |
+
)
|
| 113 |
+
assert change_root('c:\\root', 'its\\here') == 'c:\\root\\its\\here'
|
| 114 |
+
|
| 115 |
+
# BugsBunny os (it's a great os)
|
| 116 |
+
os.name = 'BugsBunny'
|
| 117 |
+
with pytest.raises(DistutilsPlatformError):
|
| 118 |
+
change_root('c:\\root', 'its\\here')
|
| 119 |
+
|
| 120 |
+
# XXX platforms to be covered: mac
|
| 121 |
+
|
| 122 |
+
def test_check_environ(self):
|
| 123 |
+
util.check_environ.cache_clear()
|
| 124 |
+
os.environ.pop('HOME', None)
|
| 125 |
+
|
| 126 |
+
check_environ()
|
| 127 |
+
|
| 128 |
+
assert os.environ['PLAT'] == get_platform()
|
| 129 |
+
|
| 130 |
+
@pytest.mark.skipif("os.name != 'posix'")
|
| 131 |
+
def test_check_environ_getpwuid(self):
|
| 132 |
+
util.check_environ.cache_clear()
|
| 133 |
+
os.environ.pop('HOME', None)
|
| 134 |
+
|
| 135 |
+
import pwd
|
| 136 |
+
|
| 137 |
+
# only set pw_dir field, other fields are not used
|
| 138 |
+
result = pwd.struct_passwd((
|
| 139 |
+
None,
|
| 140 |
+
None,
|
| 141 |
+
None,
|
| 142 |
+
None,
|
| 143 |
+
None,
|
| 144 |
+
'/home/distutils',
|
| 145 |
+
None,
|
| 146 |
+
))
|
| 147 |
+
with mock.patch.object(pwd, 'getpwuid', return_value=result):
|
| 148 |
+
check_environ()
|
| 149 |
+
assert os.environ['HOME'] == '/home/distutils'
|
| 150 |
+
|
| 151 |
+
util.check_environ.cache_clear()
|
| 152 |
+
os.environ.pop('HOME', None)
|
| 153 |
+
|
| 154 |
+
# bpo-10496: Catch pwd.getpwuid() error
|
| 155 |
+
with mock.patch.object(pwd, 'getpwuid', side_effect=KeyError):
|
| 156 |
+
check_environ()
|
| 157 |
+
assert 'HOME' not in os.environ
|
| 158 |
+
|
| 159 |
+
def test_split_quoted(self):
|
| 160 |
+
assert split_quoted('""one"" "two" \'three\' \\four') == [
|
| 161 |
+
'one',
|
| 162 |
+
'two',
|
| 163 |
+
'three',
|
| 164 |
+
'four',
|
| 165 |
+
]
|
| 166 |
+
|
| 167 |
+
def test_strtobool(self):
|
| 168 |
+
yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1')
|
| 169 |
+
no = ('n', 'no', 'f', 'false', 'off', '0', 'Off', 'No', 'N')
|
| 170 |
+
|
| 171 |
+
for y in yes:
|
| 172 |
+
assert strtobool(y)
|
| 173 |
+
|
| 174 |
+
for n in no:
|
| 175 |
+
assert not strtobool(n)
|
| 176 |
+
|
| 177 |
+
indent = 8 * ' '
|
| 178 |
+
|
| 179 |
+
@pytest.mark.parametrize(
|
| 180 |
+
"given,wanted",
|
| 181 |
+
[
|
| 182 |
+
# 0x0b, 0x0c, ..., etc are also considered a line break by Python
|
| 183 |
+
("hello\x0b\nworld\n", f"hello\x0b{indent}\n{indent}world\n{indent}"),
|
| 184 |
+
("hello\x1eworld", f"hello\x1e{indent}world"),
|
| 185 |
+
("", ""),
|
| 186 |
+
(
|
| 187 |
+
"I am a\npoor\nlonesome\nheader\n",
|
| 188 |
+
f"I am a\n{indent}poor\n{indent}lonesome\n{indent}header\n{indent}",
|
| 189 |
+
),
|
| 190 |
+
],
|
| 191 |
+
)
|
| 192 |
+
def test_rfc822_escape(self, given, wanted):
|
| 193 |
+
"""
|
| 194 |
+
We want to ensure a multi-line header parses correctly.
|
| 195 |
+
|
| 196 |
+
For interoperability, the escaped value should also "round-trip" over
|
| 197 |
+
`email.generator.Generator.flatten` and `email.message_from_*`
|
| 198 |
+
(see pypa/setuptools#4033).
|
| 199 |
+
|
| 200 |
+
The main issue is that internally `email.policy.EmailPolicy` uses
|
| 201 |
+
`splitlines` which will split on some control chars. If all the new lines
|
| 202 |
+
are not prefixed with spaces, the parser will interrupt reading
|
| 203 |
+
the current header and produce an incomplete value, while
|
| 204 |
+
incorrectly interpreting the rest of the headers as part of the payload.
|
| 205 |
+
"""
|
| 206 |
+
res = rfc822_escape(given)
|
| 207 |
+
|
| 208 |
+
policy = email.policy.EmailPolicy(
|
| 209 |
+
utf8=True,
|
| 210 |
+
mangle_from_=False,
|
| 211 |
+
max_line_length=0,
|
| 212 |
+
)
|
| 213 |
+
with io.StringIO() as buffer:
|
| 214 |
+
raw = f"header: {res}\nother-header: 42\n\npayload\n"
|
| 215 |
+
orig = email.message_from_string(raw)
|
| 216 |
+
email.generator.Generator(buffer, policy=policy).flatten(orig)
|
| 217 |
+
buffer.seek(0)
|
| 218 |
+
regen = email.message_from_file(buffer)
|
| 219 |
+
|
| 220 |
+
for msg in (orig, regen):
|
| 221 |
+
assert msg.get_payload() == "payload\n"
|
| 222 |
+
assert msg["other-header"] == "42"
|
| 223 |
+
# Generator may replace control chars with `\n`
|
| 224 |
+
assert set(msg["header"].splitlines()) == set(res.splitlines())
|
| 225 |
+
|
| 226 |
+
assert res == wanted
|
| 227 |
+
|
| 228 |
+
def test_dont_write_bytecode(self):
|
| 229 |
+
# makes sure byte_compile raise a DistutilsError
|
| 230 |
+
# if sys.dont_write_bytecode is True
|
| 231 |
+
old_dont_write_bytecode = sys.dont_write_bytecode
|
| 232 |
+
sys.dont_write_bytecode = True
|
| 233 |
+
try:
|
| 234 |
+
with pytest.raises(DistutilsByteCompileError):
|
| 235 |
+
byte_compile([])
|
| 236 |
+
finally:
|
| 237 |
+
sys.dont_write_bytecode = old_dont_write_bytecode
|
| 238 |
+
|
| 239 |
+
def test_grok_environment_error(self):
|
| 240 |
+
# test obsolete function to ensure backward compat (#4931)
|
| 241 |
+
exc = OSError("Unable to find batch file")
|
| 242 |
+
msg = grok_environment_error(exc)
|
| 243 |
+
assert msg == "error: Unable to find batch file"
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_version.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Tests for distutils.version."""
|
| 2 |
+
|
| 3 |
+
import distutils
|
| 4 |
+
from distutils.version import LooseVersion, StrictVersion
|
| 5 |
+
|
| 6 |
+
import pytest
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
@pytest.fixture(autouse=True)
|
| 10 |
+
def suppress_deprecation():
|
| 11 |
+
with distutils.version.suppress_known_deprecation():
|
| 12 |
+
yield
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class TestVersion:
|
| 16 |
+
def test_prerelease(self):
|
| 17 |
+
version = StrictVersion('1.2.3a1')
|
| 18 |
+
assert version.version == (1, 2, 3)
|
| 19 |
+
assert version.prerelease == ('a', 1)
|
| 20 |
+
assert str(version) == '1.2.3a1'
|
| 21 |
+
|
| 22 |
+
version = StrictVersion('1.2.0')
|
| 23 |
+
assert str(version) == '1.2'
|
| 24 |
+
|
| 25 |
+
def test_cmp_strict(self):
|
| 26 |
+
versions = (
|
| 27 |
+
('1.5.1', '1.5.2b2', -1),
|
| 28 |
+
('161', '3.10a', ValueError),
|
| 29 |
+
('8.02', '8.02', 0),
|
| 30 |
+
('3.4j', '1996.07.12', ValueError),
|
| 31 |
+
('3.2.pl0', '3.1.1.6', ValueError),
|
| 32 |
+
('2g6', '11g', ValueError),
|
| 33 |
+
('0.9', '2.2', -1),
|
| 34 |
+
('1.2.1', '1.2', 1),
|
| 35 |
+
('1.1', '1.2.2', -1),
|
| 36 |
+
('1.2', '1.1', 1),
|
| 37 |
+
('1.2.1', '1.2.2', -1),
|
| 38 |
+
('1.2.2', '1.2', 1),
|
| 39 |
+
('1.2', '1.2.2', -1),
|
| 40 |
+
('0.4.0', '0.4', 0),
|
| 41 |
+
('1.13++', '5.5.kw', ValueError),
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
for v1, v2, wanted in versions:
|
| 45 |
+
try:
|
| 46 |
+
res = StrictVersion(v1)._cmp(StrictVersion(v2))
|
| 47 |
+
except ValueError:
|
| 48 |
+
if wanted is ValueError:
|
| 49 |
+
continue
|
| 50 |
+
else:
|
| 51 |
+
raise AssertionError(f"cmp({v1}, {v2}) shouldn't raise ValueError")
|
| 52 |
+
assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}'
|
| 53 |
+
res = StrictVersion(v1)._cmp(v2)
|
| 54 |
+
assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}'
|
| 55 |
+
res = StrictVersion(v1)._cmp(object())
|
| 56 |
+
assert res is NotImplemented, (
|
| 57 |
+
f'cmp({v1}, {v2}) should be NotImplemented, got {res}'
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
def test_cmp(self):
|
| 61 |
+
versions = (
|
| 62 |
+
('1.5.1', '1.5.2b2', -1),
|
| 63 |
+
('161', '3.10a', 1),
|
| 64 |
+
('8.02', '8.02', 0),
|
| 65 |
+
('3.4j', '1996.07.12', -1),
|
| 66 |
+
('3.2.pl0', '3.1.1.6', 1),
|
| 67 |
+
('2g6', '11g', -1),
|
| 68 |
+
('0.960923', '2.2beta29', -1),
|
| 69 |
+
('1.13++', '5.5.kw', -1),
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
for v1, v2, wanted in versions:
|
| 73 |
+
res = LooseVersion(v1)._cmp(LooseVersion(v2))
|
| 74 |
+
assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}'
|
| 75 |
+
res = LooseVersion(v1)._cmp(v2)
|
| 76 |
+
assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}'
|
| 77 |
+
res = LooseVersion(v1)._cmp(object())
|
| 78 |
+
assert res is NotImplemented, (
|
| 79 |
+
f'cmp({v1}, {v2}) should be NotImplemented, got {res}'
|
| 80 |
+
)
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_versionpredicate.py
ADDED
|
File without changes
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/tests/unix_compat.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
|
| 3 |
+
try:
|
| 4 |
+
import grp
|
| 5 |
+
import pwd
|
| 6 |
+
except ImportError:
|
| 7 |
+
grp = pwd = None
|
| 8 |
+
|
| 9 |
+
import pytest
|
| 10 |
+
|
| 11 |
+
UNIX_ID_SUPPORT = grp and pwd
|
| 12 |
+
UID_0_SUPPORT = UNIX_ID_SUPPORT and sys.platform != "cygwin"
|
| 13 |
+
|
| 14 |
+
require_unix_id = pytest.mark.skipif(
|
| 15 |
+
not UNIX_ID_SUPPORT, reason="Requires grp and pwd support"
|
| 16 |
+
)
|
| 17 |
+
require_uid_0 = pytest.mark.skipif(not UID_0_SUPPORT, reason="Requires UID 0 support")
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/text_file.py
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""text_file
|
| 2 |
+
|
| 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)
|
.venv/lib/python3.12/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')
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/util.py
ADDED
|
@@ -0,0 +1,518 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
dry_run: bool = False,
|
| 317 |
+
) -> None:
|
| 318 |
+
"""
|
| 319 |
+
Perform some action that affects the outside world (e.g. by
|
| 320 |
+
writing to the filesystem). Such actions are special because they
|
| 321 |
+
are disabled by the 'dry_run' flag. This method handles that
|
| 322 |
+
complication; simply supply the
|
| 323 |
+
function to call and an argument tuple for it (to embody the
|
| 324 |
+
"external action" being performed) and an optional message to
|
| 325 |
+
emit.
|
| 326 |
+
"""
|
| 327 |
+
if msg is None:
|
| 328 |
+
msg = f"{func.__name__}{args!r}"
|
| 329 |
+
if msg[-2:] == ',)': # correct for singleton tuple
|
| 330 |
+
msg = msg[0:-2] + ')'
|
| 331 |
+
|
| 332 |
+
log.info(msg)
|
| 333 |
+
if not dry_run:
|
| 334 |
+
func(*args)
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
def strtobool(val: str) -> bool:
|
| 338 |
+
"""Convert a string representation of truth to true (1) or false (0).
|
| 339 |
+
|
| 340 |
+
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
|
| 341 |
+
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
|
| 342 |
+
'val' is anything else.
|
| 343 |
+
"""
|
| 344 |
+
val = val.lower()
|
| 345 |
+
if val in ('y', 'yes', 't', 'true', 'on', '1'):
|
| 346 |
+
return True
|
| 347 |
+
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
|
| 348 |
+
return False
|
| 349 |
+
else:
|
| 350 |
+
raise ValueError(f"invalid truth value {val!r}")
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
def byte_compile( # noqa: C901
|
| 354 |
+
py_files: Iterable[str],
|
| 355 |
+
optimize: int = 0,
|
| 356 |
+
force: bool = False,
|
| 357 |
+
prefix: str | None = None,
|
| 358 |
+
base_dir: str | None = None,
|
| 359 |
+
verbose: bool = True,
|
| 360 |
+
dry_run: bool = False,
|
| 361 |
+
direct: bool | None = None,
|
| 362 |
+
) -> None:
|
| 363 |
+
"""Byte-compile a collection of Python source files to .pyc
|
| 364 |
+
files in a __pycache__ subdirectory. 'py_files' is a list
|
| 365 |
+
of files to compile; any files that don't end in ".py" are silently
|
| 366 |
+
skipped. 'optimize' must be one of the following:
|
| 367 |
+
0 - don't optimize
|
| 368 |
+
1 - normal optimization (like "python -O")
|
| 369 |
+
2 - extra optimization (like "python -OO")
|
| 370 |
+
If 'force' is true, all files are recompiled regardless of
|
| 371 |
+
timestamps.
|
| 372 |
+
|
| 373 |
+
The source filename encoded in each bytecode file defaults to the
|
| 374 |
+
filenames listed in 'py_files'; you can modify these with 'prefix' and
|
| 375 |
+
'basedir'. 'prefix' is a string that will be stripped off of each
|
| 376 |
+
source filename, and 'base_dir' is a directory name that will be
|
| 377 |
+
prepended (after 'prefix' is stripped). You can supply either or both
|
| 378 |
+
(or neither) of 'prefix' and 'base_dir', as you wish.
|
| 379 |
+
|
| 380 |
+
If 'dry_run' is true, doesn't actually do anything that would
|
| 381 |
+
affect the filesystem.
|
| 382 |
+
|
| 383 |
+
Byte-compilation is either done directly in this interpreter process
|
| 384 |
+
with the standard py_compile module, or indirectly by writing a
|
| 385 |
+
temporary script and executing it. Normally, you should let
|
| 386 |
+
'byte_compile()' figure out to use direct compilation or not (see
|
| 387 |
+
the source for details). The 'direct' flag is used by the script
|
| 388 |
+
generated in indirect mode; unless you know what you're doing, leave
|
| 389 |
+
it set to None.
|
| 390 |
+
"""
|
| 391 |
+
|
| 392 |
+
# nothing is done if sys.dont_write_bytecode is True
|
| 393 |
+
if sys.dont_write_bytecode:
|
| 394 |
+
raise DistutilsByteCompileError('byte-compiling is disabled.')
|
| 395 |
+
|
| 396 |
+
# First, if the caller didn't force us into direct or indirect mode,
|
| 397 |
+
# figure out which mode we should be in. We take a conservative
|
| 398 |
+
# approach: choose direct mode *only* if the current interpreter is
|
| 399 |
+
# in debug mode and optimize is 0. If we're not in debug mode (-O
|
| 400 |
+
# or -OO), we don't know which level of optimization this
|
| 401 |
+
# interpreter is running with, so we can't do direct
|
| 402 |
+
# byte-compilation and be certain that it's the right thing. Thus,
|
| 403 |
+
# always compile indirectly if the current interpreter is in either
|
| 404 |
+
# optimize mode, or if either optimization level was requested by
|
| 405 |
+
# the caller.
|
| 406 |
+
if direct is None:
|
| 407 |
+
direct = __debug__ and optimize == 0
|
| 408 |
+
|
| 409 |
+
# "Indirect" byte-compilation: write a temporary script and then
|
| 410 |
+
# run it with the appropriate flags.
|
| 411 |
+
if not direct:
|
| 412 |
+
(script_fd, script_name) = tempfile.mkstemp(".py")
|
| 413 |
+
log.info("writing byte-compilation script '%s'", script_name)
|
| 414 |
+
if not dry_run:
|
| 415 |
+
script = os.fdopen(script_fd, "w", encoding='utf-8')
|
| 416 |
+
|
| 417 |
+
with script:
|
| 418 |
+
script.write(
|
| 419 |
+
"""\
|
| 420 |
+
from distutils.util import byte_compile
|
| 421 |
+
files = [
|
| 422 |
+
"""
|
| 423 |
+
)
|
| 424 |
+
|
| 425 |
+
# XXX would be nice to write absolute filenames, just for
|
| 426 |
+
# safety's sake (script should be more robust in the face of
|
| 427 |
+
# chdir'ing before running it). But this requires abspath'ing
|
| 428 |
+
# 'prefix' as well, and that breaks the hack in build_lib's
|
| 429 |
+
# 'byte_compile()' method that carefully tacks on a trailing
|
| 430 |
+
# slash (os.sep really) to make sure the prefix here is "just
|
| 431 |
+
# right". This whole prefix business is rather delicate -- the
|
| 432 |
+
# problem is that it's really a directory, but I'm treating it
|
| 433 |
+
# as a dumb string, so trailing slashes and so forth matter.
|
| 434 |
+
|
| 435 |
+
script.write(",\n".join(map(repr, py_files)) + "]\n")
|
| 436 |
+
script.write(
|
| 437 |
+
f"""
|
| 438 |
+
byte_compile(files, optimize={optimize!r}, force={force!r},
|
| 439 |
+
prefix={prefix!r}, base_dir={base_dir!r},
|
| 440 |
+
verbose={verbose!r}, dry_run=False,
|
| 441 |
+
direct=True)
|
| 442 |
+
"""
|
| 443 |
+
)
|
| 444 |
+
|
| 445 |
+
cmd = [sys.executable]
|
| 446 |
+
cmd.extend(subprocess._optim_args_from_interpreter_flags())
|
| 447 |
+
cmd.append(script_name)
|
| 448 |
+
spawn(cmd, dry_run=dry_run)
|
| 449 |
+
execute(os.remove, (script_name,), f"removing {script_name}", dry_run=dry_run)
|
| 450 |
+
|
| 451 |
+
# "Direct" byte-compilation: use the py_compile module to compile
|
| 452 |
+
# right here, right now. Note that the script generated in indirect
|
| 453 |
+
# mode simply calls 'byte_compile()' in direct mode, a weird sort of
|
| 454 |
+
# cross-process recursion. Hey, it works!
|
| 455 |
+
else:
|
| 456 |
+
from py_compile import compile
|
| 457 |
+
|
| 458 |
+
for file in py_files:
|
| 459 |
+
if file[-3:] != ".py":
|
| 460 |
+
# This lets us be lazy and not filter filenames in
|
| 461 |
+
# the "install_lib" command.
|
| 462 |
+
continue
|
| 463 |
+
|
| 464 |
+
# Terminology from the py_compile module:
|
| 465 |
+
# cfile - byte-compiled file
|
| 466 |
+
# dfile - purported source filename (same as 'file' by default)
|
| 467 |
+
if optimize >= 0:
|
| 468 |
+
opt = '' if optimize == 0 else optimize
|
| 469 |
+
cfile = importlib.util.cache_from_source(file, optimization=opt)
|
| 470 |
+
else:
|
| 471 |
+
cfile = importlib.util.cache_from_source(file)
|
| 472 |
+
dfile = file
|
| 473 |
+
if prefix:
|
| 474 |
+
if file[: len(prefix)] != prefix:
|
| 475 |
+
raise ValueError(
|
| 476 |
+
f"invalid prefix: filename {file!r} doesn't start with {prefix!r}"
|
| 477 |
+
)
|
| 478 |
+
dfile = dfile[len(prefix) :]
|
| 479 |
+
if base_dir:
|
| 480 |
+
dfile = os.path.join(base_dir, dfile)
|
| 481 |
+
|
| 482 |
+
cfile_base = os.path.basename(cfile)
|
| 483 |
+
if direct:
|
| 484 |
+
if force or newer(file, cfile):
|
| 485 |
+
log.info("byte-compiling %s to %s", file, cfile_base)
|
| 486 |
+
if not dry_run:
|
| 487 |
+
compile(file, cfile, dfile)
|
| 488 |
+
else:
|
| 489 |
+
log.debug("skipping byte-compilation of %s to %s", file, cfile_base)
|
| 490 |
+
|
| 491 |
+
|
| 492 |
+
def rfc822_escape(header: str) -> str:
|
| 493 |
+
"""Return a version of the string escaped for inclusion in an
|
| 494 |
+
RFC-822 header, by ensuring there are 8 spaces space after each newline.
|
| 495 |
+
"""
|
| 496 |
+
indent = 8 * " "
|
| 497 |
+
lines = header.splitlines(keepends=True)
|
| 498 |
+
|
| 499 |
+
# Emulate the behaviour of `str.split`
|
| 500 |
+
# (the terminal line break in `splitlines` does not result in an extra line):
|
| 501 |
+
ends_in_newline = lines and lines[-1].splitlines()[0] != lines[-1]
|
| 502 |
+
suffix = indent if ends_in_newline else ""
|
| 503 |
+
|
| 504 |
+
return indent.join(lines) + suffix
|
| 505 |
+
|
| 506 |
+
|
| 507 |
+
def is_mingw() -> bool:
|
| 508 |
+
"""Returns True if the current platform is mingw.
|
| 509 |
+
|
| 510 |
+
Python compiled with Mingw-w64 has sys.platform == 'win32' and
|
| 511 |
+
get_platform() starts with 'mingw'.
|
| 512 |
+
"""
|
| 513 |
+
return sys.platform == 'win32' and get_platform().startswith('mingw')
|
| 514 |
+
|
| 515 |
+
|
| 516 |
+
def is_freethreaded():
|
| 517 |
+
"""Return True if the Python interpreter is built with free threading support."""
|
| 518 |
+
return bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/version.py
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
.venv/lib/python3.12/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
|
.venv/lib/python3.12/site-packages/setuptools/_distutils/zosccompiler.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .compilers.C import zos
|
| 2 |
+
|
| 3 |
+
zOSCCompiler = zos.Compiler
|
.venv/lib/python3.12/site-packages/setuptools/_entry_points.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
try:
|
| 20 |
+
ep.extras
|
| 21 |
+
except (AttributeError, AssertionError) as ex:
|
| 22 |
+
# Why both? See https://github.com/python/importlib_metadata/issues/488
|
| 23 |
+
msg = (
|
| 24 |
+
f"Problems to parse {ep}.\nPlease ensure entry-point follows the spec: "
|
| 25 |
+
"https://packaging.python.org/en/latest/specifications/entry-points/"
|
| 26 |
+
)
|
| 27 |
+
raise OptionError(msg) from ex
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def load_group(value, group):
|
| 31 |
+
"""
|
| 32 |
+
Given a value of an entry point or series of entry points,
|
| 33 |
+
return each as an EntryPoint.
|
| 34 |
+
"""
|
| 35 |
+
# normalize to a single sequence of lines
|
| 36 |
+
lines = yield_lines(value)
|
| 37 |
+
text = f'[{group}]\n' + '\n'.join(lines)
|
| 38 |
+
return metadata.EntryPoints._from_text(text)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def by_group_and_name(ep):
|
| 42 |
+
return ep.group, ep.name
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def validate(eps: metadata.EntryPoints):
|
| 46 |
+
"""
|
| 47 |
+
Ensure entry points are unique by group and name and validate each.
|
| 48 |
+
"""
|
| 49 |
+
consume(map(ensure_valid, ensure_unique(eps, key=by_group_and_name)))
|
| 50 |
+
return eps
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
@functools.singledispatch
|
| 54 |
+
def load(eps):
|
| 55 |
+
"""
|
| 56 |
+
Given a Distribution.entry_points, produce EntryPoints.
|
| 57 |
+
"""
|
| 58 |
+
groups = itertools.chain.from_iterable(
|
| 59 |
+
load_group(value, group) for group, value in eps.items()
|
| 60 |
+
)
|
| 61 |
+
return validate(metadata.EntryPoints(groups))
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
@load.register(str)
|
| 65 |
+
def _(eps):
|
| 66 |
+
r"""
|
| 67 |
+
>>> ep, = load('[console_scripts]\nfoo=bar')
|
| 68 |
+
>>> ep.group
|
| 69 |
+
'console_scripts'
|
| 70 |
+
>>> ep.name
|
| 71 |
+
'foo'
|
| 72 |
+
>>> ep.value
|
| 73 |
+
'bar'
|
| 74 |
+
"""
|
| 75 |
+
return validate(metadata.EntryPoints(metadata.EntryPoints._from_text(eps)))
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
load.register(type(None), lambda x: x)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@pass_none
|
| 82 |
+
def render(eps: metadata.EntryPoints):
|
| 83 |
+
by_group = operator.attrgetter('group')
|
| 84 |
+
groups = itertools.groupby(sorted(eps, key=by_group), by_group)
|
| 85 |
+
|
| 86 |
+
return '\n'.join(f'[{group}]\n{render_items(items)}\n' for group, items in groups)
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
def render_items(eps):
|
| 90 |
+
return '\n'.join(f'{ep.name} = {ep.value}' for ep in sorted(eps))
|
.venv/lib/python3.12/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)
|
.venv/lib/python3.12/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
|
.venv/lib/python3.12/site-packages/setuptools/_itertools.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from more_itertools import consume # noqa: F401
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
# copied from jaraco.itertools 6.1
|
| 5 |
+
def ensure_unique(iterable, key=lambda x: x):
|
| 6 |
+
"""
|
| 7 |
+
Wrap an iterable to raise a ValueError if non-unique values are encountered.
|
| 8 |
+
|
| 9 |
+
>>> list(ensure_unique('abc'))
|
| 10 |
+
['a', 'b', 'c']
|
| 11 |
+
>>> consume(ensure_unique('abca'))
|
| 12 |
+
Traceback (most recent call last):
|
| 13 |
+
...
|
| 14 |
+
ValueError: Duplicate element 'a' encountered.
|
| 15 |
+
"""
|
| 16 |
+
seen = set()
|
| 17 |
+
seen_add = seen.add
|
| 18 |
+
for element in iterable:
|
| 19 |
+
k = key(element)
|
| 20 |
+
if k in seen:
|
| 21 |
+
raise ValueError(f"Duplicate element {element!r} encountered.")
|
| 22 |
+
seen_add(k)
|
| 23 |
+
yield element
|