+
    SBij7                        ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIt	^ RI
t
^ RIHt ^ RIHt ^RIHt R tR tR	 t]
P(                  P+                  R
R]RR7      R 4       tR]! R4      RRRRRRRRRRRR//R]! R4      /tR t]
P(                  P5                  R4      R 4       tR]! R4      RRRRRRR RRR!R/R"R#R///R$RRR%R/R]! R&4      /tR' t ! R( R)4      tR,R* ltR+ t R# )-    N)Path)Mock)SetuptoolsDeprecationWarning)Distribution)DALSc           	         \        \        RR.R.RR./R7      4      p\        P                  ! R4       VP	                  4        VP                  4        R# )zv
Directories matching the glob in package_data should
not be included in the package data.

Regression test for #261.
setup.pybuild_py zpath/*script_namescript_argspackagespackage_datazpath/subpathN)r   dictosmakedirsparse_command_linerun_commands
tmpdir_cwddists   & C/usr/lib/python3.14/site-packages/setuptools/tests/test_build_py.py%test_directories_in_package_data_globr      sS     "#Txj)		
D KK    c           	     b   \        \        RR.R.RR./R7      4      p\        P                  ! R4       \	        RR4      P                  4        VP                  4        VP                  4        \        P                  ! \        P                  ! R	4      P                  4      '       g   Q R
4       hR# )zd
Files matching recursive globs (**) in package_data should
be included in the package data.

#1806
r	   r
   r   zpath/**/datar   zpath/subpath/subsubpathzpath/subpath/subsubpath/datawbz&build/lib/path/subpath/subsubpath/datazFile is not includedN)r   r   r   r   opencloser   r   statS_ISREGst_moder   s   & r   #test_recursive_in_package_data_globr#   %   s     "#T~./		
D KK)*	'.446<< HIQQRR Rr   c           	        \        \        RR.R.RR./R7      4      p\        P                  ! R4       \	        RR4      P                  4        \	        RR4      P                  4        \        P                  ! R\        P                  4       \        P                  ! R\        P                  4       VP                  4        VP                  4        \        P                  ! R	4       R
# )z
Ensure read-only flag is not preserved in copy
for package modules and package data, as that
causes problems with deleting read-only files on
Windows.

#1451
r	   r
   pkgzdata.datr   pkg/__init__.pyr   zpkg/data.datbuildN)r   r   r   r   r   r   chmodr    S_IREADr   r   shutilrmtreer   s   & r   test_read_onlyr,   ?   s     "#W*.		
D KK	D!'')$$&HH-HH^T\\*
MM'r   zplatform.system() == "Windows"z-On Windows, files do not have executable bitsT)reasonraisesstrictc           	        \        \        RR.R.RR./R7      4      p\        P                  ! R4       \	        RR4      P                  4        \	        RR4      P                  4        \        P                  ! RR	4       VP                  4        VP                  4        \        P                  ! R
4      P                  \        P                  ,          '       g   Q R4       hR# )zf
Ensure executable bit is preserved in copy for
package data, as users rely on it for scripts.

#2041
r	   r
   r%   zrun-mer   r&   r   z
pkg/run-mei  zbuild/lib/pkg/run-mezScript is not executableN)r   r   r   r   r   r   r(   r   r   r    r"   S_IEXECr   s   & r   test_executable_datar2   Z   s     "#W(,		
D KK	D!'')t""$HH\5!77)*22T\\AA "Ar   z	setup.cfgz
        [metadata]
        name = mypkg
        version = 42

        [options]
        include_package_data = True
        packages = find:

        [options.packages.find]
        exclude = *.tests*
        mypkg__init__.pyr   zresource_file.txttestsztest_mypkg.pyztest_file.txtzMANIFEST.inz
        global-include *.py *.txt
        global-exclude *.py[cod]
        prune dist
        prune build
        prune *.egg-info
        c                    \         P                  P                  \        4       \	        R R/4      pVP                  4        VP                  R4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P                  ! R4      R8X  d   \        P                  ! RRR	R
7       VP                  4        VP                  4        RRR4       \!        VP                  R4      P"                  4      pVR,          P%                  4       '       g   Q hVR,          P%                  4       '       g   Q hR FM  p\        P&                  ! \(        4      ;_uu_ 4        WE,          P%                  4       '       d   Q h RRR4       KO  	  \        P*                  ! R4       R#   + '       g   i     L; i  + '       g   i     K  ; i)r   	%PEP 517%r
   z9Python recognizes 'mypkg\.tests' as an importable package)matchSETUPTOOLS_USE_DISTUTILSstdlibignorez!'encoding' argument not specifiedzdistutils.text_file)moduleNmypkg/__init__.pyzmypkg/resource_file.txtz#3260)zmypkg/tests/__init__.pyzmypkg/tests/test_mypkg.pyzmypkg/tests/test_file.txtzmypkg/tests)jaracopathr'   EXAMPLE_WITH_MANIFESTr   parse_config_filesget_command_objpytestwarnsr   r   getenvwarningsfilterwarningsfinalize_optionsrunr   	build_libexistsr.   AssertionErrorxfail)r   r   r
   msg	build_dirfs   &     r   test_excluded_subpackagesrQ      sX   
KK+,45D##J/H
FC	2#	>	>
 99/0H< ##3, 	!!#! 
?$ T))*5??@I++3355551199;;;; ]]>** "--///// +* LLG 
?	>< +**s   8AF"F5"F2	5Gz/ignore::setuptools.SetuptoolsDeprecationWarningc                   \         P                  P                  \        4       \	        RR/4      pVP                  4        VP                  '       g   Q hVP                  R4      pVP                  R4       \        \        VP                  4      P                  R4      4      pVP                  4       '       g   Q hVP                  R4      pVP                  4        VP                  R4      p\        VP                   R7      pVP#                  VRV4       VP$                  P'                  RR	4       VP)                  V4       R	Vn        VP!                  4        VP-                  4        VP/                  4        VP$                  P'                  RR	4       VP)                  V4       WEn        VP!                  4        VP1                  4        VP2                  '       g   Q h\5        R
 VP7                  4       4      pV'       g   Q h\9        \        VP:                  R4      4      P=                  \>        P@                  R4      pW9   g   Q hR	# )zoWhen provided with the ``existing_egg_info_dir`` attribute, build_py should not
attempt to run egg_info again.
r   r7   egg_infoz
*.egg-infor
   )side_effectrI   
data_filesNc                 B    V P                  \        P                  R 4      # /)replacer   sep)xs   &r   <lambda>(test_existing_egg_info.<locals>.<lambda>   s    AIIbffc2r   r=   rX   )!r>   r?   r'   r@   r   rA   include_package_datarB   run_commandnextr   egg_baseglobis_dirrH   r   rI   setattr__dict__popreinitialize_commandexisting_egg_info_dirassert_called
reset_mockassert_not_calledrU   mapget_outputsstrrJ   rY   r   rZ   )	r   monkeypatchr   rS   egg_info_dirr
   egg_info_runoutputsexamples	   &&       r   test_existing_egg_infort      s    KK+,45D$$$$$##J/HZ X../44\BCL     ##J/H##J/HHLL1L%6
 ,-h' &*H"LLN  ,-h' &2"LLN""$ 2H4H4H4JKGN7$x))+>?@HHQTUGr   pyproject.tomla;  
        [project]
        name = "mypkg"
        version = "42"

        [tool.setuptools]
        packages = ["mypkg", "mypkg.sub1", "mypkg.sub2", "mypkg.sub2.nested"]

        [tool.setuptools.package-dir]
        "" = "src"
        "mypkg.sub2" = "src/mypkg/_sub2"
        "mypkg.sub2.nested" = "other"
        srcsub1zmod1.py_sub2zmod2.pyotherzmod3.pyzL
        global-include *.py *.txt
        global-exclude *.py[cod]
        c                 6   \         P                  P                  \        4       \	        R R/4      pVP                  4        VP                  R4      pRVn        VP                  4        VP                  P                  \        P                  R4      pVP                  4        Uu0 uF"  qDP                  \        P                  R4      kK$  	  ppVV R2V R2V R2V R2V R	2V R
2V R208X  g   Q hVP                  4       P                  4        UUu/ uFD  w  rgVP                  \        P                  R4      VP                  \        P                  R4      bKF  	  pppVV R2RV R2RV R2RV R2RV R	2RV R
2RV R2R/8X  g   Q hR# u upi u uppi )r   z%test%r
   TrX   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.pyzsrc/mypkg/__init__.pyzsrc/mypkg/resource_file.txtzsrc/mypkg/sub1/__init__.pyzsrc/mypkg/sub1/mod1.pyzsrc/mypkg/_sub2/mod2.pyzother/__init__.pyzother/mod3.pyN)r>   r?   r'   EXAMPLE_ARBITRARY_MAPPINGr   rA   rB   editable_modeensure_finalizedrJ   rY   r   rZ   rm   get_output_mappingitems)	r   r   r
   rJ   r[   rr   kvmappings	   &        r   test_get_outputsr   /  s   
KK/012D##J/H!H""**26637I/7/C/C/EF/E!yy%/EGF+'(+-.+,-+()+()+34+/0    //17799DA 	
		"&&#		"&&# 669   +'(*A+-.0M+,-/K+()+C+()+D+346I+/0/    Gs   %(FA
Fc                   \  a  ] tR tRt o R]! R4      R]! R4      R]! R4      /tRR	R
RRRRRR//RRR0/RR	R
RRRRR///RRR0/RR	R
RRR/RRRR//R0 R%m//t]P                  P                  RR]P                  ! R]P                  P                  RR7      R7      .4      ]P                  P                  R]P                  4       4      R  4       4       t]P                  P                  RR.4      ]P                  P                  R]P                  4       4      R! 4       4       tR" tR#tV tR$# )&TestTypeInfoFilesiQ  default_pyprojectzV
            [project]
            name = "foo"
            version = "1"
            dont_include_package_dataz
            [project]
            name = "foo"
            version = "1"

            [tool.setuptools]
            include-package-data = false
            exclude_type_infoz
            [project]
            name = "foo"
            version = "1"

            [tool.setuptools]
            include-package-data = false

            [tool.setuptools.exclude-package-data]
            "*" = ["py.typed", "*.pyi"]
            simple_namespacedirectory_structurefoobar.pyir   zpy.typedr4   expected_type_fileszfoo/bar.pyifoo/py.typednested_inside_namespacebarzmod.pyizfoo/bar/mod.pyizfoo/bar/py.typednamespace_nested_inside_regular	namespacezfoo.pyi__init__.pyi	pyprojectzpypa/setuptools#4350)r-   )marksrs   c                   / V P                   V,          R ,          CRV P                  V,          /CpV P                   V,          R,          p\        P                  P	                  V4       \        4       p\        V4      pWW8:  g   Q hR# r   ru   r   N)EXAMPLES
PYPROJECTSr>   r?   r'   get_finalized_build_pyrm   selfr   r   rs   	structurer   r
   rr   s   &&&&    r   #test_type_files_included_by_default5TestTypeInfoFiles.test_type_files_included_by_default  sz    
mmG$%:;
dooi8
	 #mmG45JK)$)+h'"---r   c                6   / V P                   V,          R ,          CRV P                  V,          /CpV P                   V,          R,          p\        P                  P	                  V4       \        4       p\        V4      pVP                  V4      '       g   Q hR# r   )r   r   r>   r?   r'   r   rm   
isdisjointr   s   &&&&    r   test_type_files_can_be_excluded1TestTypeInfoFiles.test_type_files_can_be_excluded  s    
mmG$%:;
dooi8
	 #mmG45JK)$)+h'"--g6666r   c                    R \        R4      RRRRR//pRR0p\        P                  P                  V4       \	        4       p\        V4      pW58:  g   Q hR# )	ru   zl
                [project]
                name = "foo-stubs"
                version = "1"
                z	foo-stubsr   r   r   zfoo-stubs/__init__.pyizfoo-stubs/bar.pyiN)r   r>   r?   r'   r   rm   )r   r   r   r   r
   rr   s   &&    r   test_stub_only_package(TestTypeInfoFiles.test_stub_only_package  sf    d ."i<	
	  89LM)$)+h'"---r    N>   r   foo/__init__.pyifoo/namespace/foo.pyi)__name__
__module____qualname____firstlineno__r   r   r   rC   markparametrizeparamrM   keysr   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r   Q  s    T
 	$T	&
 	T

%JD 	!r!2$ "M>#B	
 	"!"B!2$ "$57I#J
$
 	*!!2" #B$ " $,
-&HP [[LL+kk''/E'F	
	 [[Y8
. 9	
. [[[+>*?@[[Y8
7 9 A
7. .r   r   c                     \        R V /4      pVP                  4        VP                  R4      pVP                  4        V# )r   r
   )r   rA   rB   rH   )r   r   r
   s   &  r   r   r     s>    45D##J/HOr   c                     \        V P                  4      pV P                  4        Uu0 uF@  p\        P                  P                  W!4      P                  \        P                  R 4      kKB  	  up# u upi rW   )r   rJ   rm   r   r?   relpathrY   rZ   )r
   rO   r[   s   &  r   rm   rm     s`    X''(I %%''A 	%--bffc:'  s   AA1)z%build_py-test%)!r   r*   r    rF   pathlibr   unittest.mockr   jaraco.pathr>   rC   
setuptoolsr   setuptools.distr   textwrapr   r   r#   r,   r   rM   rL   r2   r@   rQ   rG   rt   r{   r   r   r   rm   r   r   r   <module>r      s   	        3 ( (46 $:	  : 	 rR2RR
 4	1! H+\ MN3 O3n d	 
2r2 2

 r2 4	C' TD. .Dr   