Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2`jy7���SSKrSSKrSSKrSSKrSSKJr SSKJr SSKr	SSK3r4SSKJr SSK
Jr SSKJr SrS	rS5r\6R(R+SS\S
S9S5r\"S5SSSSSS.S.\"S5S.rSr\7R(R5S5S5r\"S5SSSSSS.SS0S.0SSS.\"S5S .rS!r"S"S#5rS&S$jrS%r g)'�N)�Path)�Mock)�SetuptoolsDeprecationWarning)�Distribution�)�DALSc	��[[SS/S/SS/0S95n[R"S5 UR	5 UR5 g)zv8Directories matching the glob in package_data should9not be included in the package data.10 11Regression test for #261.12�setup.py�build_py�zpath/*��script_name�script_args�packages�package_datazpath/subpathN)r�dict�os�makedirs�parse_command_line�run_commands��13tmpdir_cwd�dists  �PD:\code\apps\devtools\python\Lib\site-packages\setuptools/tests/test_build_py.py�%test_directories_in_package_data_globrsS����"�#���T��x�j�)�		14��D��K�K�����������c	�X�[[SS/S/SS/0S95n[R"S5 [	SS5R5 UR
5 UR5 [R"[R"S	5R5(dS155eg)zd16Files matching recursive globs (**) in package_data should17be included in the package data.18 19#180620r21rrzpath/**/datar
zpath/subpath/subsubpathzpath/subpath/subsubpath/data�wbz&build/lib/path/subpath/subsubpath/datazFile is not includedN)rrrr�open�closerr�stat�S_ISREG�st_moders  r�#test_recursive_in_package_data_globr$%s�����"�#���T��~�.�/�		22��D��K�K�)�*��	'��.�4�4�6����������<�<���� H�I�Q�Q�R�R����Rrc	���[[SS/S/SS/0S95n[R"S5 [	SS5R5 [	SS5R5 [R"S[R5 [R"S[R5 UR5 UR5 [R"S	5 g23)z�24Ensure read-only flag is not preserved in copy25for package modules and package data, as that26causes problems with deleting read-only files on27Windows.28 29#145130r31r�pkgzdata.datr
�pkg/__init__.pyrzpkg/data.dat�buildN)
rrrrrr �chmodr!�S_IREADrr�shutil�rmtreers  r�test_read_onlyr-?s�����"�#���W��*��.�		32��D��K�K����	�D�!�'�'�)�����$�$�&��H�H�
����-��H�H�^�T�\�\�*���������33�M�M�'�rzplatform.system() == "Windows"z-On Windows, files do not have executable bitsT)�reason�raises�strictc	��[[SS/S/SS/0S95n[R"S5 [	SS5R5 [	SS5R5 [R"SS	5 UR5 UR5 [R"S345R[R-(dS5eg)
zf35Ensure executable bit is preserved in copy for36package data, as users rely on it for scripts.37 38#204139r40rr&zrun-mer
r'rz41pkg/run-mei�zbuild/lib/pkg/run-mezScript is not executableN)rrrrrr r)rrr!r#�S_IEXECrs  r�test_executable_datar3Zs�����"�#���W��(��,�		42��D��K�K����	�D�!�'�'�)���t��"�"�$��H�H�\�5�!���������
�7�7�)�*�2�2�T�\�\�A��"��Arz�43        [metadata]44        name = mypkg45        version = 4246 47        [options]48        include_package_data = True49        packages = find:50 51        [options.packages.find]52        exclude = *.tests*53        r)�__init__.pyz
test_mypkg.pyz
test_file.txt)r4�resource_file.txt�testsz�54        global-include *.py *.txt55        global-exclude *.py[cod]56        prune dist57        prune build58        prune *.egg-info59        )z	setup.cfg�mypkg�MANIFEST.inc�<�[RR[5 [	SS05nUR5 UR
S5nSn[R"[US9 [R"S5S:Xa[R"SS	S60S9 UR5 UR5 SSS5 [!UR
S5R"5nUS-R%5(deUS
-R%5(deSH@n[R&"[(5 XE-R%5(aeSSS5 MB [R*"S5 g!,(df   N�=f!,(df   M{=f)Nr�	%PEP 517%rz9Python recognizes 'mypkg\.tests' as an importable package)�match�SETUPTOOLS_USE_DISTUTILS�stdlib�ignorez!'encoding' argument not specifiedzdistutils.text_file)�module�mypkg/__init__.pyzmypkg/resource_file.txt)zmypkg/tests/__init__.pyzmypkg/tests/test_mypkg.pyzmypkg/tests/test_file.txtzmypkg/testsz#3260)�jaraco�pathr(�EXAMPLE_WITH_MANIFESTr�parse_config_files�get_command_obj�pytest�warnsrr�getenv�warnings�filterwarnings�finalize_options�runr�	build_lib�existsr/�AssertionError�xfail)rrr�msg�	build_dir�fs      r�test_excluded_subpackagesrT�sO��61�K�K���+�,����4�5�D������#�#�J�/�H�62F�C�	���2�#�	>�63�9�9�/�0�H�<�
�#�#��3�,�
�	�!�!�#�����!64?�$�T�)�)�*�5�?�?�@�I��+�+�3�3�5�5�5�5��1�1�9�9�;�;�;�;����]�]�>�
*�"�
�-�-�/�/�/�/�/�+�
*�
��L�L���G65?�	>��<+�
*�s�-AE;�=F�;66F	�67F	z/ignore::setuptools.SetuptoolsDeprecationWarningc��[RR[5 [	SS05nUR5 UR(deURS5nURS5 [[UR5RS55nUR5(deURS5nUR5 URS5n[UR S9nUR#USU5 UR$R'SS	5 UR)U5 S	UlUR!5 UR-5 UR/5 UR$R'SS	5 UR)U5 XElUR!5 UR15 UR2(de[5S68UR755nU(de[9[UR:S55R=[>R@S5nX�;deg	)
zoWhen provided with the ``existing_egg_info_dir`` attribute, build_py should not69attempt to run egg_info again.70rr:�egg_infoz71*.egg-infor)�side_effectrL�72data_filesNc�B�UR[RS5$�N�/)�replacer�sep)�xs r�<lambda>�(test_existing_egg_info.<locals>.<lambda>�s��A�I�I�b�f�f�c�2rr@r[)!rArBr(rCrrD�include_package_datarE�run_command�nextr�egg_base�glob�is_dirrKrrL�setattr�__dict__�pop�reinitialize_command�existing_egg_info_dir�
assert_called�73reset_mock�assert_not_calledrX�map�get_outputs�strrMr\rr])	r�monkeypatchrrV�egg_info_dirr�egg_info_run�outputs�examples	         r�test_existing_egg_inforw�s����K�K���+�,����4�5�D������$�$�$�$��#�#�J�/�H����Z� ���X�.�.�/�4�4�\�B�C�L���� � � � ��#�#�J�/�H������#�#�J�/�H��H�L�L�1�L�����%��6�74
�����,��-����h�'�&*�H�"��L�L�N���� ����������,��-����h�'�&2�"��L�L�N��"�"�$�������2�H�4H�4H�4J�K�G��N�7��$�x�)�)�+>�?�@�H�H����QT�U�G����ra;75        [project]76        name = "mypkg"77        version = "42"78 79        [tool.setuptools]80        packages = ["mypkg", "mypkg.sub1", "mypkg.sub2", "mypkg.sub2.nested"]81 82        [tool.setuptools.package-dir]83        "" = "src"84        "mypkg.sub2" = "src/mypkg/_sub2"85        "mypkg.sub2.nested" = "other"86        r7)r4zmod1.pyzmod2.py)r4r5�sub1�_sub2)r4zmod3.pyzL87        global-include *.py *.txt88        global-exclude *.py[cod]89        )�pyproject.toml�src�otherr8c�4�[RR[5 [	SS05nUR5 UR
S5nSUlUR5 URR[RS5nUR5Vs1sH"oDR[RS5iM$ nnUUS3US3US3US	3US903US3US31:XdeUR5R5VVs0sHDupgUR[RS5UR[RS5_MF nnnUUS3S
US3SUS3SUS	3SUS913SUS3SUS3S0:Xdegs snfs snnf)Nrz%test%rTr[z/mypkg/__init__.pyz/mypkg/resource_file.txtz/mypkg/sub1/__init__.pyz/mypkg/sub1/mod1.pyz/mypkg/sub2/mod2.pyz/mypkg/sub2/nested/__init__.pyz/mypkg/sub2/nested/mod3.pyzsrc/mypkg/__init__.pyzsrc/mypkg/resource_file.txtzsrc/mypkg/sub1/__init__.pyzsrc/mypkg/sub1/mod1.pyzsrc/mypkg/_sub2/mod2.pyzother/__init__.pyz
other/mod3.py)rArBr(�EXAMPLE_ARBITRARY_MAPPINGrrDrE�
editable_mode�ensure_finalizedrMr\rr]rp�get_output_mapping�items)	rrrrMr^ru�k�v�mappings	         r�test_get_outputsr�/s���92�K�K���/�0����1�2�D������#�#�J�/�H�!�H�������"�"�*�*�2�6�6�3�7�I�/7�/C�/C�/E�F�/E�!�y�y�����%�/E�G�F���+�'�(��+�-�.��+�,�-��+�(�)��+�(�)��+�3�4��+�/�0������/�/�1�7�7�9��9�D�A�	93�	�	�"�&�&�#���	�	�"�&�&�#� 6�6�9�����+�'�(�*A��+�-�.�0M��+�,�-�/K��+�(�)�+C��+�(�)�+D��+�3�4�6I��+�/�0�/������G��s
�%)F�AFc�,�\rSrSr\"S5\"S5\"S5S.rSSSSS.0S	S941S.SSSSS
.00SS1S.SSS0SSS.01SkS.S.r\RRSS\R"S\RRSS9S9/5\RRS\R55S55r
\RRSS/5\RRS\R55S55rSrSrg )!�TestTypeInfoFilesiQzV95            [project]96            name = "foo"97            version = "1"98            z�99            [project]100            name = "foo"101            version = "1"102 103            [tool.setuptools]104            include-package-data = false105            z�106            [project]107            name = "foo"108            version = "1"109 110            [tool.setuptools]111            include-package-data = false112 113            [tool.setuptools.exclude-package-data]114            "*" = ["py.typed", "*.pyi"]115            )�default_pyproject�dont_include_package_data�exclude_type_info�foor)�bar.pyi�py.typedr4zfoo/bar.pyi�foo/py.typed)�directory_structure�expected_type_files�bar)r�zmod.pyizfoo/bar/mod.pyizfoo/bar/py.typedzfoo.pyi)�	namespace�__init__.pyir�>r��foo/__init__.pyi�foo/namespace/foo.pyi)�simple_namespace�nested_inside_namespace�namespace_nested_inside_regular�	pyprojectr�r�zpypa/setuptools#4350)r.)�marksrvc���0URUSESURU0EnURUSn[RR	U5 [5n[
U5nXW::deg�Nr�rzr�)�EXAMPLES�116PYPROJECTSrArBr(�get_finalized_build_pyrp��selfrr�rv�	structurer�rrus        r�#test_type_files_included_by_default�5TestTypeInfoFiles.test_type_files_included_by_default�sz��117��m�m�G�$�%:�;�118��d�o�o�i�8�119�	�#�m�m�G�4�5J�K�������)�$�)�+���h�'��"�-�-�-rr�c�120�0URUSESURU0EnURUSn[RR	U5 [5n[
U5nURU5(degr�)r�r�rArBr(r�rp�121isdisjointr�s        r�test_type_files_can_be_excluded�1TestTypeInfoFiles.test_type_files_can_be_excluded�s���122��m�m�G�$�%:�;�123��d�o�o�i�8�124�	�#�m�m�G�4�5J�K�������)�$�)�+���h�'��"�-�-�g�6�6�6�6rc��[S5SSS.S.nSS1n[RRU5 [	5n[U5nX5::deg)Nzl125                [project]126                name = "foo-stubs"127                version = "1"128                r)r�r�)rzz	foo-stubszfoo-stubs/__init__.pyizfoo-stubs/bar.pyi)rrArBr(r�rp)r�rr�r�rrus      r�test_stub_only_package�(TestTypeInfoFiles.test_stub_only_package�s^��"���+-��<�	129�	� 8�9L�M�������)�$�)�+���h�'��"�-�-�-r�N)�__name__�130__module__�__qualname__�__firstlineno__rr�r�rF�mark�parametrize�paramrP�keysr�r�r��__static_attributes__r�rrr�r�Qs~��!�
�131�&*�
�	&132�"�133
�134�%�J�H�!� "�#%��$�%2�>�#B�	135���$&�#%���$�%6�7I�#J�136$137��!�2�"�%'� "��$�$�,138�-&�H�P�[�[������L�L�+��k�k�'�'�/E�'�F�
�	139�	��[�[���Y��
�
��8�140.�9�	�141.��[�[���[�+>�*?�@��[�[���Y��
�
��8�1427�9�A�1437�.rr�c��[SU05nUR5 URS5nUR5 U$)Nrr)rrDrErK)rrrs   rr�r��s>�����4�5�D������#�#�J�/�H������Orc���[UR5nUR5Vs1sH@n[RRX!5R
[RS5iMB sn$s snfrZ)rrMrprrB�relpathr\r])rrRr^s   rrprp�s`���X�'�'�(�I��%�%�'��'�A�	������%�-�-�b�f�f�c�:�'����s�AA2)z%build_py-test%)!rr+r!rI�pathlibr�
unittest.mockr�jaraco.pathrArF�144setuptoolsr�setuptools.distr�textwraprrr$r-r�rPrOr3rCrTrJrwr~r�r�r�rpr�rr�<module>r�sU��	�
������
�3�(���(�4�6�����$�:���	���
��:�	�
������145���	��1!��H+�\�����M�N�3�O�3�n�	�� 	��!#�!���146�2��147148������	��C'��T�D.�.�D�r
codekingpro/portable-devtools · Team Ai