Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
fixtures.cpython-313.pyc179 linesDownload Raw Back to __pycache__
1�

2��j�/��f�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSK	r3SSKrSSKrSSK
Jr SSKJrJr SSKJr \R(S5r\R(S5r\R("S	S4S9S5r\R(S
5r\R(S5rSr\R("S5S9S5r\R("S6S9S5r\R(S5r\R(S5r\R(S5rSr SSjr!Sr"Sr#SS\!SSS4Sjr$\R(S5r%g) �N)�Path)�7safer_name�)�contexts�environment)�DALSc#�v# �[R"5nURSU5 [R"5nURSU5 [R"5 Sv� SSS5 SSS5 SSS5 g!,(df   N=f!,(df   N(=f!,(df   g=f7f)zU8Override site.USER_BASE and site.USER_SITE with temporary directories in9a context.10zsite.USER_BASEzsite.USER_SITEN)r�tempdir�setattr�save_user_site_setting)�monkeypatch�	user_base�	user_sites   �_D:\code\apps\devtools\python\user_packages\Python313\site-packages\setuptools/tests/fixtures.py�
user_overriders����11�	�	�	�y����,�i�8�
�
�
�
�9���� 0�)�<��0�0�2��3� �12�	�3�2�� �
��13�	�sL�B9�(B(�(B�(B�-B�5B(�=	B9�14B�B�15B%	�!B(�(16B6�2B9c#�h# �UR5nUv� SSS5 g!,(df   g=f7f�N)�as_cwd)�tmpdir�origs  r�17tmpdir_cwdr"s���	����D��18�19���s�2�!�	2�20/�2T�session)�autouse�scopec��URRRS5(dg[R"[215 [RRS5 SSS5 g!,(df   g=f)z�22Workaround pytest-dev/pytest-xdist#37623 24``pytest-xdist`` tends to inject '' into ``sys.path``,25which may break certain isolation expectations.26Remove the entry so the import27machinery behaves the same irrespective of xdist.28�xdistN�)	�config�
pluginmanager�29has_plugin�30contextlib�suppress�31ValueError�sys�path�remove)�requests r�workaround_xdist_376r((sL���>�>�'�'�2�2�7�;�;��	�	�	�Z�	(��������32)�	(�	(�s� A/�/33A=c��/SQn[R"U[U5S9 US-$![a [R34"S5 US-$f=f)z435Clone the 'sampleproject' and return a path to it.36)�git�clonez%https://github.com/pypa/sampleproject)�cwdzUnable to clone sampleproject�
sampleproject)�37subprocess�38check_call�str�	Exception�pytest�skip)�tmp_path�cmds  r�sample_projectr69sY��39D�C�5����c�s�8�}�5��o�%�%���5����3�4��o�%�%�5�s�)� A�Ac#�t# �[R"U5 Sv� SSS5 g!,(df   g=f7fr)r%r)r6s r�sample_project_cwdr8Fs���	
���>�	"�
�40#�	"�	"�s�8�'�	8�415�8c���[R"XS5n[URS5S5n[URS5S5nU(aU(aX44sSSS5 $[	UR42RS5R5(ae[R"[RSSS[U5[UR43R5/5 [	UR44RS5R5(ae[URS55[URS554sSSS5 $!,(df   g=f)N�45dist_buildz*.tar.gzz*.whlzbuild/lib/build�-m�buildz--outdir)
r�session_locked_tmp_dir�next�globrr�rootdir�existsr.�check_outputr$�46executabler0)�tmp_path_factoryr'�tmp�sdist�wheels     r�_build_distributionsrHTs��	�	(�	(��<�47�	��S�X�X�j�)�4�0���S�X�X�g�&��-���U��>�
48�49�����.�.�0A�B�I�I�K�K�K�K�����N�N������H�����&�&�'�
!50�	�����.�.�0A�B�I�I�K�K�K�K��C�H�H�Z�(�)�4�����0A�+B�B�/51�52�53�s�AE �)C-E � 54E.)rc���[R"S5nU(a=[RRU5(a[	U5R5$[
X5up4U$)N�PRE_BUILT_SETUPTOOLS_SDIST��os�getenvr%rAr�resolverH)rDr'�prebuiltrF�_s     r�setuptools_sdistrQosK���y�y�5�6�H��B�G�G�N�N�8�,�,��H�~�%�%�'�'�#�$4�>�H�E��L�c���[R"S5nU(a=[RRU5(a[	U5R5$[
X5up4U$)N�PRE_BUILT_SETUPTOOLS_WHEELrK)rDr'rOrPrGs     r�setuptools_wheelrUysK���y�y�5�6�H��B�G�G�N�N�8�,�,��H�~�%�%�'�'�#�$4�>�H�A��LrRc��[R"5n[R"US-5UlSS/Ul[
U5Ul[R"SS9 UR5sSSS5 $!,(df   g=f)z?Virtual env with the version of setuptools under test installed�venv�--no-setuptoolsz--wheel=bundleN)�55PYTHONPATH)56r�57VirtualEnvr%r�root�create_optsr0�reqr�create)r4rU�envs   rrWrW�sf���58 �59 �60"�C��y�y��F�*�+�C�H�(�*:�;�C�O��"�#�C�G�61�	�	��	.��z�z�|�62/�	.�	.�s�!A;�;63B	c��[R"5n[R"US-5UlSS/UlUR
5 U$)z7Virtual env without any version of setuptools installed�venv_without_setuptoolsrX�64--no-wheel�rrZr%rr[r\�65ensure_env�r4r_s  rrara�sC���66 �67 �68"�C��y�y��$=�=�>�C�H�(�,�7�C�O��N�N���JrRc��[R"5n[R"US-5Ul/SQUlUR
5 U$)z1Virtual env without any common packages installed�	bare_venv)rXz--no-piprbz	--no-seedrcres  rrgrg�s=���69 �70 �71"�C��y�y��K�/�0�C�H�P�C�O��N�N���JrRc��[U5S:�de[R"US5nUH�up4[R"URS55n[R"US9n[UR55Ul[[R"55UlURXeS9 M� SSS5 g!,(df   g=f)zy72Create a simple sdist tarball at dist_path, containing the files73listed in ``files`` as ``(filename, content)`` tuples.74rzw:gz�utf-8)�name)�fileobjN)
�len�tarfile�open�io�BytesIO�encode�TarInfo�getvalue�size�int�time�mtime�addfile)�	dist_path�files�dist�filename�content�75file_bytes�	file_infos       r�76make_sdistr��s����u�:��>��>�	���i��	(�D�!&��H����G�N�N�7�$;�<�J����X�6�I� ��!4�!4�!6�7�I�N�!�$�)�)�+�.�I�O��L�L��L�7�"'�77)�	(�	(�s�BC�78Cc��S[SU<SU<S354S/nU(a.URS[SUR5S3545 [X5 g	)79z�80Create a simple sdist tarball at dist_path, containing just a simple81setup.py.82 83If ``setuptools_wheel`` is passed, a ``pyproject.toml`` file will also84be generated and the passed value will be used as location for85setuptools (as build dependency).86�setup.pyz`                 import setuptools87                 setuptools.setup(88                     name=z,89                     version=z%90                 )91                 ��	setup.cfgr�pyproject.tomlzI                [build-system]92                requires = ["setuptools @ zK"]93                build-backend = "setuptools.build_meta"94                N)r�append�as_urir�)ry�distname�versionrUrzs     r�make_trivial_sdistr��s���
���$�,�'�%�[�)�	�
�	95�	�
�E� �
�����+�+;�+B�+B�+D�*E�F��
�	96�		��y� rRc���SU;deURS5nUSn[S[U5S-5Vs/sHnSRUSU5PM nn[	SU<SU<SU<SU<S	3	5nS97nSU4[98RRUS5U4/n	USSHFn99[100RR"U101RS5S/-6nU	RUS
45 MH [X	5 gs snf)z�102Make an sdist tarball with distname and version which also contains one103package with the same name as distname.  The top-level package is104designated a namespace package).105�.rrNzE        import setuptools106        setuptools.setup(107            name=z,108            version=z,109            packages=z",110            namespace_packages=[z]111        )112    z7__import__('pkg_resources').declare_namespace(__name__)r��__init__.pyr)	�split�rangerl�joinrrLr%r�r�)ryr�r��parts�	nspackage�idx�packages�setup_py�initrz�packager|s            r�make_nspkg_sdistr��s���(�?��?��N�N�3��E��a��I�16�q�#�e�*�q�.�1I�J�1I�#�����t���%�1I�H�J��
�����K� ��\�"!�!*�
�.�
	�113�H�E�D��(�
#�b�g�g�l�l�9�m�&L�d�%S�T�E��A�B�<���7�7�<�<�'�-�-��"4�
��"F�H��
���h��^�$� ��y� ��+Ks�C8c114�R�[US[S5RXUS94S/5 g)Nr�z�                import setuptools115                setuptools.setup(116                  name={name!r},117                  version={version!r},118                  python_requires={python_requires!r},119                )120                )rjr��python_requiresr�)r�r�format)ryr�r�r�s    r�make_python_requires_sdistr�121sD�������	��&�!�O���
�
�!	122�rR�foobarz0.1�c�N�[U5nSSUSU3/[RRU5/S.nU(aUR	U5 [RRUS5n	[R"U	5 U(a�/n123/nUHonURU5n
USR5;aUnOU124n[U
[[45(aSRU
5n
URUSU
35 Mq [S5RS	RU1255S	RU5S1269nOSn[[RRU	S5S
SS9nUR!U5 SSS5 Uc[S5n[[RRU	S5S
SS9nUR!XH-5 SSS5 [RRXSUS35nU"UX5 U	$!,(df   N�=f!,(df   NO=f)aCreates a source tree under path for a trivial test package that has a127single requirement in setup_requires--a tarball for that requirement is128also created and added to the dependency_links argument.129 130``distname`` and ``version`` refer to the name/version of the package that131the test package requires via ``setup_requires``.  The name of the test132package itself is just 'test_pkg'.133�test_pkgz0.0z==)rjr��setup_requires�dependency_linkszname version�;z: zg134            [metadata]135            {metadata}136            [options]137            {options}138            �139)�options�metadatarr��wri)�encodingNzI            import setuptools140            setuptools.setup(**%r)141        r��-z.tar.gz)rrLr%�abspath�updater��mkdir�popr��142isinstance�tuple�listr�rr�rn�write)r%r�r��make_package�setup_py_template�setup_attrs�
use_setup_cfg�normalized_distname�test_setup_attrsr�r�r�rj�value�section�test_setup_cfg_contents�f�foobar_paths                  r�create_setup_requires_packager�"s���$%�X�.����1�2�"�W�I�>�?��W�W�_�_�T�2�3�	�������,��w�w�|�|�D�*�-�H��H�H�X�������!�D�$�(�(��.�E��~�+�+�-�-�"��!���%�%���/�/��������N�N�d�V�2�e�W�-�.�"�#'�
�#143��&��I�I�g�&��Y�Y�x�(��144�	 �#%��	
�b�g�g�l�l�8�[�1�3��	I�Q�	���'�(�145J�� � �
�146��147�b�g�g�l�l�8�Z�0�#��	H�A�	���!�4�5�148I��'�'�,�,�t�'<�A�g�Y�g�%N�O�K���h�0��O�#149J�	I��150I�	H�s�(H�9H�151H�152H$c��[S5[S5[S5SSS.SS0S	.nUR/S153Q5 US-nUR5 [RRX4S9 UR
S
S5 U$)Nz�154            [build-system]155            requires = ["setuptools"]156            build-backend = "setuptools.build_meta"157            z�158            __import__('setuptools').setup(159                pbr=True,160                setup_requires=["pbr"],161            )162            z163            [metadata]164            name = mypkg165 166            [files]167            packages =168                mypkg169            rzprint('Hello world!'))r�zhello.pyztest.txtzAnother file in here.)r�r�r��mypkg�other)�pythonr;�pip�install�pbrr�)�prefix�PBR_VERSIONz0.42)r�runr��jaracor%r<�setenv)r4r
rWrzr�s     r�pbr_packager�os����
�170��
�171��
�	172��/�173��5�6�=
�E�@	�H�H�
6�7�
��
�F�174�L�L�N�175�K�K���e��+����}�f�-��MrRr)&r!rorLr.r$rmrv�pathlibr�jaraco.pathr�r%r2�setuptools._normalizationrrrr�textwrapr�fixturerrr(r6r8rHrQrUrWrargr�r�r�r�r�r�r�rRr�<module>r�s���	�	��176������
�0�#�����177��178�������179����I�.�
�/�
� ���	&��	&�������C�6���i� ��!�����i� ��!��������*������������8�"%!�P!!�H�4��#����J�Z���&��&rR
codekingpro/portable-devtools · Team Ai