Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2`j���~�SrSSKrSSKrSSKrSSKrSSKJrJr SSKJ	r	 SSK3Jr "SS5r"S	S45r
Srg)z%Tests for automatic package discovery�N)�find_namespace_packages�
find_packages)�FlatLayoutPackageFinder�)�	os_helperc���\rSrSrSrSrSrSSjrSSjrSr	S	r5S6rSrSr
S
r\R R#\R&"5(+SS9S5rSrSrSrSrSrSrSrg)�TestFindPackages�c�X�[R"5UlUR5 g�N)�tempfile�mkdtemp�dist_dir�_make_pkg_structure��self�methods  �UD:\code\apps\devtools\python\Lib\site-packages\setuptools/tests/test_find_packages.py�setup_method�TestFindPackages.setup_methods�� �(�(�*��
�� � �"�c�D�[R"UR5 gr)�shutil�rmtreerrs  r�teardown_method� TestFindPackages.teardown_methods���
�
�d�m�m�$rc��URSUR5UlURSUR5 URSUR5UlURSUR5 URSUR5UlURSUR75 URSUR5UlURSUR5UlURS	UR5 URS8UR5 URSUR5 g)
z�Make basic package structure.9 10dist/11    docs/12        conf.py13    pkg/14        __pycache__/15        nspkg/16            mod.py17        subpkg/18            assets/19                asset20            __init__.py21    setup.py22 23�docszconf.py�pkg�__pycache__�nspkgzmod.py�subpkg�assets�asset�__init__.pyzsetup.pyN)�_mkdirr�docs_dir�_touch�pkg_dir�24ns_pkg_dir�sub_pkg_dir�	asset_dir)rs rr�$TestFindPackages._make_pkg_structures���"���F�D�M�M�:��
����I�t�}�}�-��{�{�5�$�-�-�8������M�4�<�<�0��+�+�g�t�|�|�<������H�d�o�o�.��;�;�x����>������X�t�/?�/?�@������G�T�^�^�,����M�4�#3�#3�4����J��
�
�.rNc�~�U(a[RRX!5n[R"U5 U$r)�os�path�join�mkdir)rr0�25parent_dirs   rr&�TestFindPackages._mkdir4s'����7�7�<�<�26�1�D�27������rc��U(a[RRX!5n[US5R	5 U$)N�wb)r/r0r1�open�close)rr0�dir_s   rr(�TestFindPackages._touch:s/����7�7�<�<��+�D��T�4���� ��rc�z�URSUR5 [UR5nUSS/:Xdeg)Nr%r�28pkg.subpkg�r(r)rr�r�packagess  r�test_regular_package�%TestFindPackages.test_regular_package@s5�����M�4�<�<�0� ����/���E�<�0�0�0�0rc�v�URSUR5 [URSS9nUS/:Xdeg)Nr%)zpkg.*��excluderr=r>s  r�test_exclude�TestFindPackages.test_excludeEs4�����M�4�<�<�0� ����29�C���E�7�"�"�"rc��URSUR5 URSUR5 [URSS9nUS/:Xdeg)zG30Excluding a parent package should not exclude child packages as well.31r%)rrCr<N)r(r)r+rrr>s  r�test_exclude_recursive�'TestFindPackages.test_exclude_recursiveJsJ��	
���M�4�<�<�0����M�4�#3�#3�4� �����A���L�>�)�)�)rc���URSUR5 URSUR5nURSU5 [	URS/S9nUS/:Xdeg)z=32If include is specified, other packages should be excluded.33r%�	other_pkg)�includeN)r(r)r&rr)r�alt_dirr?s   r�test_include_excludes_other�,TestFindPackages.test_include_excludes_otherSsZ��	
���M�4�<�<�0��+�+�k�4�=�=�9�����M�7�+� �����
�F���K�=�(�(�(rc�:�[R"[RR	UR34S55 UR
SUR5nURSU5 URSU5 [UR355nSU;deg)N�pkg/subpkg/assetsz	some.datar%zfile.datz
pkg.some.data)36rrr/r0r1rr&r)r(r)r�data_dirr?s   r�test_dir_with_dot_is_skipped�-TestFindPackages.test_dir_with_dot_is_skipped]sn���
�
�b�g�g�l�l�4�=�=�2E�F�G��;�;�{�D�L�L�9�����M�8�,����J��)� ����/���h�.�.�.rc��URSUR5nURSU5nURSU5 [UR5nSU;deg)zS37Ensure that a package in a non-package such as build/pkg/__init__.py38is excluded.39�buildrr%z	build.pkgN)r&rr(r)r�	build_dir�
build_pkg_dirr?s    r�,test_dir_with_packages_in_subdir_is_excluded�=TestFindPackages.test_dir_with_packages_in_subdir_is_excludedesR��40�K�K�����7�	����E�9�5�
����M�=�1� ����/���(�*�*�*rzSymlink support required)�reasonc�D�URSUR5 [RR	UR41S5n[R"SU5 [RRU5(de[UR425nSU;deg)z�43A symbolically-linked directory should be treated like any other44directory when matched as a package.45 46Create a link from lpkg -> pkg.47r%�lpkgrN)	r(r)r/r0r1r�symlink�isdirr)r�48linked_pkgr?s   r�$test_symlinked_packages_are_included�5TestFindPackages.test_symlinked_packages_are_includedpsq��	
���M�4�<�<�0��W�W�\�\�$�-�-��8�49�50�51�52�5�*�%��w�w�}�}�Z�(�(�(�(� ����/����!�!�!rc�8�[U5[U5:Xdegr)�set)r�actual�expecteds   r�_assert_packages�!TestFindPackages._assert_packagess���6�{�c�(�m�+�+�+rc�Z�[URS/S/S9nURU/SQ5 g)Nzpkg*�pkg.subpkg.assets)rLrD�r�	pkg.nspkgr<�rrrgr>s  r�test_pep420_ns_package�'TestFindPackages.test_pep420_ns_package�s0��*��M�M�F�8�6I�5J�53��	
���h�(J�Krc�V�[URS/S9nURU/SQ5 g)NrjrC)rrrlr<rmr>s  r�"test_pep420_ns_package_no_includes�3TestFindPackages.test_pep420_ns_package_no_includes�s'��*�4�=�=�CV�BW�X�����h�(R�Src�X�[UR5n/SQnURX5 g)N)rrrlr<rjrm)rr?rfs   r�.test_pep420_ns_package_no_includes_or_excludes�?TestFindPackages.test_pep420_ns_package_no_includes_or_excludes�s#��*�4�=�=�9��R�����h�1rc��URSUR5 [URSS/S9nUR	U/SQ5 g)Nr%rrjrCrk)r(r)rrrgr>s  r�3test_regular_package_with_nested_pep420_ns_packages�DTestFindPackages.test_regular_package_with_nested_pep420_ns_packages�s@�����M�4�<�<�0�*��M�M�F�,?�#@�54��	
���h�(J�Krc��[R"UR5 [R"[RRURS55 [UR5nURU/SQ5 g)NrQrk)	rrr'r/r0r1rrrgr>s  r�*test_pep420_ns_package_no_non_package_dirs�;TestFindPackages.test_pep420_ns_package_no_non_package_dirs�sQ���
�
�d�m�m�$��
�
�b�g�g�l�l�4�=�=�2E�F�G�*�4�=�=�9�����h�(J�Kr)r,rr'r*r)r+r)�__name__�55__module__�__qualname__�__firstlineno__rrrr&r(r@rErHrNrSrY�pytest�mark�skipifr�can_symlinkrargrnrqrtrwrz�__static_attributes__�rrr	r	s���#�%�/�:��1�56#�57*�)�/�	+��[�[���I�1�1�3�3�<V��W�"�X�"�,�L�T�2�58L�Lrr	c	���\rSrSr/SQSS/4SS/SS/4/SQ/4/S	QS/4/S59QS/4/SQ/SQ4/S
Q/SQ4S.r\RRS\R55S5r	Sr60g)�TestFlatLayoutPackageFinder�)z.pkg/__init__.py�pkg/__init__.pyzpkg/nested/file.txtrz61pkg.nestedz_pkg/__init__.pyzpkg/_private/__init__.pyzpkg._private)zinvalid-pkg/__init__.pyzother.pkg/__init__.pyzyet,another/file.py)r�zdocs/conf.pyzdocs/readme.rst)r�ztests/test_pkg.pyztests/__init__.py)r�zexamples/__init__.pyzexamples/file.pyzexample/other_file.pyzpkg/example/__init__.pyzpkg/examples/__init__.py)rzpkg.exampleszpkg.example)zhtmlcov/index.htmlr�ztasks/__init__.pyztasks/subpackage/__init__.pyzfabfile/__init__.pyzfabfile/subpackage/__init__.pyzpkg/tasks/__init__.pyzpkg/fabfile/__init__.py)rz	pkg.taskszpkg.fabfile)zhidden-folderszprivate-packageszinvalid-namer�tests�examplesz
tool-specific�examplec��URUup4[X5 [R"[	U55n[U5[U5:Xdegr)�EXAMPLES�ensure_filesr�find�strrd)r�tmp_pathr��files�expected_packages�found_packagess      r�&test_unwanted_directories_not_included�BTestFlatLayoutPackageFinder.test_unwanted_directories_not_included�sH��#'�=�=��#9� ���X�%�0�5�5�c�(�m�D���>�"�c�*;�&<�<�<�<rr�N)r|r}r~rr�r�r��parametrize�keysr�r�r�rrr�r��s���
K�
�L�!�62�63 �!;�<�
�N�#�64�65
X��66�H�%��Q�I�
�G�67�68
�
3�69�70
�
0�
71�=,�H�\�[�[���Y��
�
��8�=�9�=rr�c�r�UH1nX-nURRSSS9 UR5 M3 g)NT)�parents�exist_ok)�parentr2�touch)�	root_pathr��filer0s    rr�r��s4������������$���6��72�73��r)�__doc__r/rr
r��74setuptoolsrr�setuptools.discoveryr�compat.py39rr	r�r�r�rr�<module>r�s<��+�	�
��
�=�8�"�ML�ML�`4=�4=�nr
codekingpro/portable-devtools · Team Ai