K ii PdZddlZddlZddlmZddlmZddlmZGddZ y) zinstall_scripts testsN)install_scripts) Distribution)contextsceZdZedddgidZdZdZdZdd Ze jje jd k(d dZe jje jd k7d dZe jje jd k(d dZe jje jd k7d dZy )TestInstallScriptsfooconsole_scriptsz foo=foo:fooz0.0)name entry_pointsversionz%/usr/dummy-test-path/local/bin/pythonz/usr/bin/env dummy-test-pythonz6C:\Dummy Test Path\Program Files\Python 3.6\python.exeNc&t|j}d|_t|}||_||j d}||_|jtj5|jdddy#1swYyxYw)Nzsetup.py build_scripts) rsettings script_namer install_dirget_finalized_command executableensure_finalizedrquietrun)selfrrdistcmdbss k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/tests/test_install_scripts.py_run_install_scriptsz'TestInstallScripts._run_install_scriptsszDMM*%d#%  !**?;B&BM  ^^   GGI   s -BBwin32znon-Windows only)reasonc~d|jd}|jd|j|j5|jt |t t |j ddd5}|j}dddddd|k(sJy#1swYxYw#1swYxYw) zt Ensure that shebang is not quoted on Unix when getting the Python exe from sys.executable. #! sys.executabler rutf-8encodingN)unix_exesetattras_cwdrstropenjoinreadlinertmpdir monkeypatchexpectedfactuals r!test_sys_executable_escaping_unixz4TestInstallScripts.test_sys_executable_escaping_unix#s  b),dmm< ]]_ &  % %c&k 2c&++e,-sWE & & &!!! & & & &$AB3>B'B3'B0 ,B33B<z Windows onlyc~d|jd}|jd|j|j5|jt |t t |j ddd5}|j}dddddd|k(sJy#1swYxYw#1swYxYw) z Ensure that shebang is quoted on Windows when getting the Python exe from sys.executable and it contains a space. #!"" r# foo-script.pyr$r%r&N) win32_exer)r*rr+r,r-r.r/s r"test_sys_executable_escaping_win32z5TestInstallScripts.test_sys_executable_escaping_win321s (,,dnn= ]]_ &  % %c&k 2c&++o67wO &ST & &!!! & & & &r6c\d|jd}|j5|jt||jt t|j ddd5}|j }dddddd|k(sJy#1swYxYw#1swYxYw)z Ensure that shebang on Unix is not quoted, even when a value with spaces is specified using --executable. r!r"r r$r%r&N)unix_spaces_exer*rr+r,r-r.rr0r2r3r4s r)test_executable_with_spaces_escaping_unixzB"B B""B+chd|jd}|j5|jt|d|jzdzt t|j ddd5}|j }dddddd|k(sJy#1swYxYw#1swYxYw) z Ensure that shebang on Windows is quoted when getting a path with spaces from --executable, that is itself properly quoted. r8r9"r:r$r%r&N)r;r*rr+r,r-r.r?s r"test_executable_arg_escaping_win32z5TestInstallScripts.test_executable_arg_escaping_win32Ms(, ]]_ &  % %c&k33G#3M Nc&++o67wO &ST & &!!! & & & &s$AB(3BB(B% !B((B1)N)__name__ __module__ __qualname__dictrr(r>r;rpytestmarkskipifsysplatformr5r<r@rCrrr s '-9H 7H6OLI  [[ /8JK "L " [[ /G "H " [[ /8JK "L " [[ /G "H "rNr) __doc__rKrH"setuptools.command.install_scriptsrsetuptools.distrrrrMrNrrSs# >(L"L"rN