Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > site-packages > setuptools > tests
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
compat | Directory | - | - | |
config | Directory | - | - | |
indexes | Directory | - | - | |
integration | Directory | - | - | |
__init__.py | File | 335 bytes | April 17 2025 13:10:58. | |
contexts.py | File | 3480 bytes | April 17 2025 13:10:58. | |
environment.py | File | 3102 bytes | April 17 2025 13:10:58. | |
fixtures.py | File | 5197 bytes | April 17 2025 13:10:58. | |
mod_with_constant.py | File | 22 bytes | April 17 2025 13:10:58. | |
namespaces.py | File | 2774 bytes | April 17 2025 13:10:58. | |
script-with-bom.py | File | 18 bytes | April 17 2025 13:10:58. | |
server.py | File | 2397 bytes | April 17 2025 13:10:58. | |
test_archive_util.py | File | 845 bytes | April 17 2025 13:10:58. | |
test_bdist_deprecations.py | File | 775 bytes | April 17 2025 13:10:58. | |
test_bdist_egg.py | File | 1957 bytes | April 17 2025 13:10:58. | |
test_bdist_wheel.py | File | 23083 bytes | April 17 2025 13:10:58. | |
test_build.py | File | 798 bytes | April 17 2025 13:10:58. | |
test_build_clib.py | File | 3123 bytes | April 17 2025 13:10:58. | |
test_build_ext.py | File | 10099 bytes | April 17 2025 13:10:58. | |
test_build_meta.py | File | 34118 bytes | April 17 2025 13:10:58. | |
test_build_py.py | File | 14186 bytes | April 17 2025 13:10:58. | |
test_config_discovery.py | File | 22580 bytes | April 17 2025 13:10:58. | |
test_core_metadata.py | File | 20881 bytes | April 17 2025 13:10:58. | |
test_depends.py | File | 424 bytes | April 17 2025 13:10:58. | |
test_develop.py | File | 5142 bytes | April 17 2025 13:10:58. | |
test_dist.py | File | 8901 bytes | April 17 2025 13:10:58. | |
test_dist_info.py | File | 7077 bytes | April 17 2025 13:10:58. | |
test_distutils_adoption.py | File | 5987 bytes | April 17 2025 13:10:58. | |
test_easy_install.py | File | 53534 bytes | April 17 2025 13:10:58. | |
test_editable_install.py | File | 43383 bytes | April 17 2025 13:10:58. | |
test_egg_info.py | File | 44866 bytes | April 17 2025 13:10:58. | |
test_extern.py | File | 296 bytes | April 17 2025 13:10:58. | |
test_find_packages.py | File | 7819 bytes | April 17 2025 13:10:58. | |
test_find_py_modules.py | File | 2404 bytes | April 17 2025 13:10:58. | |
test_glob.py | File | 887 bytes | April 17 2025 13:10:58. | |
test_install_scripts.py | File | 3433 bytes | April 17 2025 13:10:58. | |
test_logging.py | File | 2099 bytes | April 17 2025 13:10:58. | |
test_manifest.py | File | 18562 bytes | April 17 2025 13:10:58. | |
test_namespaces.py | File | 4515 bytes | April 17 2025 13:10:58. | |
test_packageindex.py | File | 8775 bytes | April 17 2025 13:10:58. | |
test_sandbox.py | File | 4330 bytes | April 17 2025 13:10:58. | |
test_sdist.py | File | 32872 bytes | April 17 2025 13:10:58. | |
test_setopt.py | File | 1365 bytes | April 17 2025 13:10:58. | |
test_setuptools.py | File | 9008 bytes | April 17 2025 13:10:58. | |
test_shutil_wrapper.py | File | 641 bytes | April 17 2025 13:10:58. | |
test_unicode_utils.py | File | 316 bytes | April 17 2025 13:10:58. | |
test_virtualenv.py | File | 3730 bytes | April 17 2025 13:10:58. | |
test_warnings.py | File | 3347 bytes | April 17 2025 13:10:58. | |
test_wheel.py | File | 19370 bytes | April 17 2025 13:10:58. | |
test_windows_wrappers.py | File | 7881 bytes | April 17 2025 13:10:58. | |
text.py | File | 123 bytes | April 17 2025 13:10:58. | |
textwrap.py | File | 98 bytes | April 17 2025 13:10:58. |
import contextlib import os import subprocess import sys from pathlib import Path import path import pytest from . import contexts, environment @pytest.fixture def user_override(monkeypatch): """ Override site.USER_BASE and site.USER_SITE with temporary directories in a context. """ with contexts.tempdir() as user_base: monkeypatch.setattr('site.USER_BASE', user_base) with contexts.tempdir() as user_site: monkeypatch.setattr('site.USER_SITE', user_site) with contexts.save_user_site_setting(): yield @pytest.fixture def tmpdir_cwd(tmpdir): with tmpdir.as_cwd() as orig: yield orig @pytest.fixture(autouse=True, scope="session") def workaround_xdist_376(request): """ Workaround pytest-dev/pytest-xdist#376 ``pytest-xdist`` tends to inject '' into ``sys.path``, which may break certain isolation expectations. Remove the entry so the import machinery behaves the same irrespective of xdist. """ if not request.config.pluginmanager.has_plugin('xdist'): return with contextlib.suppress(ValueError): sys.path.remove('') @pytest.fixture def sample_project(tmp_path): """ Clone the 'sampleproject' and return a path to it. """ cmd = ['git', 'clone', 'https://github.com/pypa/sampleproject'] try: subprocess.check_call(cmd, cwd=str(tmp_path)) except Exception: pytest.skip("Unable to clone sampleproject") return tmp_path / 'sampleproject' # sdist and wheel artifacts should be stable across a round of tests # so we can build them once per session and use the files as "readonly" # In the case of setuptools, building the wheel without sdist may cause # it to contain the `build` directory, and therefore create situations with # `setuptools/build/lib/build/lib/...`. To avoid that, build both artifacts at once. def _build_distributions(tmp_path_factory, request): with contexts.session_locked_tmp_dir( request, tmp_path_factory, "dist_build" ) as tmp: # pragma: no cover sdist = next(tmp.glob("*.tar.gz"), None) wheel = next(tmp.glob("*.whl"), None) if sdist and wheel: return (sdist, wheel) # Sanity check: should not create recursive setuptools/build/lib/build/lib/... assert not Path(request.config.rootdir, "build/lib/build").exists() subprocess.check_output([ sys.executable, "-m", "build", "--outdir", str(tmp), str(request.config.rootdir), ]) # Sanity check: should not create recursive setuptools/build/lib/build/lib/... assert not Path(request.config.rootdir, "build/lib/build").exists() return next(tmp.glob("*.tar.gz")), next(tmp.glob("*.whl")) @pytest.fixture(scope="session") def setuptools_sdist(tmp_path_factory, request): prebuilt = os.getenv("PRE_BUILT_SETUPTOOLS_SDIST") if prebuilt and os.path.exists(prebuilt): # pragma: no cover return Path(prebuilt).resolve() sdist, _ = _build_distributions(tmp_path_factory, request) return sdist @pytest.fixture(scope="session") def setuptools_wheel(tmp_path_factory, request): prebuilt = os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL") if prebuilt and os.path.exists(prebuilt): # pragma: no cover return Path(prebuilt).resolve() _, wheel = _build_distributions(tmp_path_factory, request) return wheel @pytest.fixture def venv(tmp_path, setuptools_wheel): """Virtual env with the version of setuptools under test installed""" env = environment.VirtualEnv() env.root = path.Path(tmp_path / 'venv') env.create_opts = ['--no-setuptools', '--wheel=bundle'] # TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel env.req = str(setuptools_wheel) # In some environments (eg. downstream distro packaging), # where tox isn't used to run tests and PYTHONPATH is set to point to # a specific setuptools codebase, PYTHONPATH will leak into the spawned # processes. # env.create() should install the just created setuptools # wheel, but it doesn't if it finds another existing matching setuptools # installation present on PYTHONPATH: # `setuptools is already installed with the same version as the provided # wheel. Use --force-reinstall to force an installation of the wheel.` # This prevents leaking PYTHONPATH to the created environment. with contexts.environment(PYTHONPATH=None): return env.create() @pytest.fixture def venv_without_setuptools(tmp_path): """Virtual env without any version of setuptools installed""" env = environment.VirtualEnv() env.root = path.Path(tmp_path / 'venv_without_setuptools') env.create_opts = ['--no-setuptools', '--no-wheel'] env.ensure_env() return env @pytest.fixture def bare_venv(tmp_path): """Virtual env without any common packages installed""" env = environment.VirtualEnv() env.root = path.Path(tmp_path / 'bare_venv') env.create_opts = ['--no-setuptools', '--no-pip', '--no-wheel', '--no-seed'] env.ensure_env() return env
SILENT KILLER Tool