SILENT KILLERPanel

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 ]

Files and Folders in: //opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/tests

NameTypeSizeLast ModifiedActions
__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.

Reading File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/tests/test_develop.py

"""develop tests"""

import os
import pathlib
import platform
import subprocess
import sys

import pytest

from setuptools._path import paths_on_pythonpath
from setuptools.command.develop import develop
from setuptools.dist import Distribution

from . import contexts, namespaces

SETUP_PY = """\
from setuptools import setup

setup(name='foo',
    packages=['foo'],
)
"""

INIT_PY = """print "foo"
"""


@pytest.fixture
def temp_user(monkeypatch):
    with contexts.tempdir() as user_base:
        with contexts.tempdir() as user_site:
            monkeypatch.setattr('site.USER_BASE', user_base)
            monkeypatch.setattr('site.USER_SITE', user_site)
            yield


@pytest.fixture
def test_env(tmpdir, temp_user):
    target = tmpdir
    foo = target.mkdir('foo')
    setup = target / 'setup.py'
    if setup.isfile():
        raise ValueError(dir(target))
    with setup.open('w') as f:
        f.write(SETUP_PY)
    init = foo / '__init__.py'
    with init.open('w') as f:
        f.write(INIT_PY)
    with target.as_cwd():
        yield target


class TestDevelop:
    in_virtualenv = hasattr(sys, 'real_prefix')
    in_venv = hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix

    def test_console_scripts(self, tmpdir):
        """
        Test that console scripts are installed and that they reference
        only the project by name and not the current version.
        """
        pytest.skip(
            "TODO: needs a fixture to cause 'develop' "
            "to be invoked without mutating environment."
        )
        settings = dict(
            name='foo',
            packages=['foo'],
            version='0.0',
            entry_points={
                'console_scripts': [
                    'foocmd = foo:foo',
                ],
            },
        )
        dist = Distribution(settings)
        dist.script_name = 'setup.py'
        cmd = develop(dist)
        cmd.ensure_finalized()
        cmd.install_dir = tmpdir
        cmd.run()
        # assert '0.0' not in foocmd_text

    @pytest.mark.xfail(reason="legacy behavior retained for compatibility #4167")
    def test_egg_link_filename(self):
        settings = dict(
            name='Foo $$$ Bar_baz-bing',
        )
        dist = Distribution(settings)
        cmd = develop(dist)
        cmd.ensure_finalized()
        link = pathlib.Path(cmd.egg_link)
        assert link.suffix == '.egg-link'
        assert link.stem == 'Foo_Bar_baz_bing'


class TestResolver:
    """
    TODO: These tests were written with a minimal understanding
    of what _resolve_setup_path is intending to do. Come up with
    more meaningful cases that look like real-world scenarios.
    """

    def test_resolve_setup_path_cwd(self):
        assert develop._resolve_setup_path('.', '.', '.') == '.'

    def test_resolve_setup_path_one_dir(self):
        assert develop._resolve_setup_path('pkgs', '.', 'pkgs') == '../'

    def test_resolve_setup_path_one_dir_trailing_slash(self):
        assert develop._resolve_setup_path('pkgs/', '.', 'pkgs') == '../'


class TestNamespaces:
    @staticmethod
    def install_develop(src_dir, target):
        develop_cmd = [
            sys.executable,
            'setup.py',
            'develop',
            '--install-dir',
            str(target),
        ]
        with src_dir.as_cwd():
            with paths_on_pythonpath([str(target)]):
                subprocess.check_call(develop_cmd)

    @pytest.mark.skipif(
        bool(os.environ.get("APPVEYOR")),
        reason="https://github.com/pypa/setuptools/issues/851",
    )
    @pytest.mark.skipif(
        platform.python_implementation() == 'PyPy',
        reason="https://github.com/pypa/setuptools/issues/1202",
    )
    def test_namespace_package_importable(self, tmpdir):
        """
        Installing two packages sharing the same namespace, one installed
        naturally using pip or `--single-version-externally-managed`
        and the other installed using `develop` should leave the namespace
        in tact and both packages reachable by import.
        """
        pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
        pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
        target = tmpdir / 'packages'
        # use pip to install to the target directory
        install_cmd = [
            sys.executable,
            '-m',
            'pip',
            'install',
            str(pkg_A),
            '-t',
            str(target),
        ]
        subprocess.check_call(install_cmd)
        self.install_develop(pkg_B, target)
        namespaces.make_site_dir(target)
        try_import = [
            sys.executable,
            '-c',
            'import myns.pkgA; import myns.pkgB',
        ]
        with paths_on_pythonpath([str(target)]):
            subprocess.check_call(try_import)

        # additionally ensure that pkg_resources import works
        pkg_resources_imp = [
            sys.executable,
            '-c',
            'import pkg_resources',
        ]
        with paths_on_pythonpath([str(target)]):
            subprocess.check_call(pkg_resources_imp)

SILENT KILLER Tool