1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
U
W±dˆ€ã@s|ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl m Z ddl mZddlmZmZmZmZddlmZddlmZddlmZddlmZerØdd    lmZmZm Z erîddl!m"m#Z$e %e&¡Z'd
d „Z(d d „Z)dd„Z*dd„Z+dd„Z,d)dd„Z-dd„Z.dd„Z/dd„Z0dd„Z1d*dd „Z2d!d"„Z3d+d#d$„Z4d%d&„Z5d,d'd(„Z6dS)-éN)Úcompat)Úlog)ÚEXTENSION_SUFFIXESÚ    is_cygwinÚ    is_darwinÚis_win©ÚCONF)Údylib)Úmatch_binding_redirect)Úmisc)Ú versioninfoÚ winmanifestÚ winresourcecCs||krt d|¡dSdS)z/
    Rebuild is required if values differ.
    úBuilding because %s changedTF)ÚloggerÚinfo)Ú    attr_nameÚ    old_valueÚ    new_valueÚ
last_build©rúQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/building/utils.pyÚ_check_guts_eq2s rcCs4|D]*\}}}t |¡|krt d|¡dSqdS)z›
    Rebuild is required if mtimes of files listed in old TOC are newer than last_build.
 
    Use this for calculated/analysed values read from cache.
    rTF)r Úmtimerr)rÚold_tocÚnew_tocrÚ    dest_nameÚsrc_nameÚtypecoderrrÚ_check_guts_toc_mtime<s
 r cCst||||ƒpt||||ƒS)zŸ
    Rebuild is required if either TOC content changed or mtimes of files listed in old TOC are newer than last_build.
 
    Use this for input parameters.
    )rr )rrrrrrrÚ_check_guts_tocIs ÿr!cCs†|dkr|||fS| |¡r&|||fS| dtj¡}tj |¡dtkr|tj |¡}d|ks`t‚|tj |¡t    |ƒd…}|||fS)z‰
    Take a TOC entry (dest_name, src_name, typecode) and adjust the dest_name for EXTENSION to include the full library
    suffix.
    Z    EXTENSIONÚ.éN)
ÚendswithÚreplaceÚosÚsepÚpathÚsplitextrÚbasenameÚAssertionErrorÚlen)rrrÚ    base_namerrrÚadd_suffix_to_extensionSs
 
 
  r.cCsJd}|D]<}|jD]0}t||ƒrt d|j|j|j¡|j|_d}qq|S)z×
    Apply the binding redirects specified by 'redirects' to the dependent assemblies of 'manifest'.
 
    :param manifest:
    :type manifest:
    :param redirects:
    :type redirects:
    :return:
    :rtype:
    FzRedirecting %s version %s -> %sT)ÚdependentAssembliesr rrÚnameÚversionZ
newVersion)ÚmanifestÚ    redirectsÚ redirectingZbindingÚdeprrrÚapplyRedirectsns 
 
r6Fc    %
Csòddlm}    |     dg¡}
|     dd¡} |o.tp.t}|sL|sLtsLtrH|
sL| sL|S|pRg}|rŒt |¡} |D]$} |  | ¡rft     
d|| ¡d}qŒqfdt j dt j df}t  ¡d}tj |    d    d
||||f¡}|ràtj ||¡}trj|rt | d ¡¡}tj || ¡¡}ntj |d ¡}|r\t|d ƒ}t | ¡¡}W5QRXtj || ¡¡}ntj |d¡}tj |¡s‚t |¡tj |d¡}tj |¡rÒzt |¡}Wn"tk
rÎt     d¡‚YnXni}|rêtj |¡}ntj tj |¡¡}t ||
ƒ}tj ||¡}d}||krB|||kr>t !|¡n|S| "¡ #d¡ròtròt$ %¡}||_&t|d ƒ}| '| ¡¡W5QRX|     dd¡rÚ|j(r´t     
dtj |¡¡d|_(|j)D]}|j*dkrÀd|_(qÀt+||
ƒ| ,|¡|S|r¢|rt-|dd|||||d}tr6t. /|¡r6t     
d|¡njt 0|¡rPt     
d|¡nPd}|    ddkrrtj*dkrrd}d}|     d¡r”tj |    d|¡}||d |g}n&|rÈg}tr¸d!g}d"g||g}tj tj 1|¡¡sðt tj 1|¡¡t2 3||¡t4td#ƒr0zt 5|d¡Wnt6k
r.YnXt 7|d$¡tj 8| "¡¡dd%kr4tr4zt$ 9tj :|¡¡} WnRt;j<j=k
rÄ}!z,|!j>dt;j?kržnt     =tj :|¡¡‚W5d}!~!XYnpXt$j@| kr4tA| t$j@ƒr4| t$j@D]D}"| t$j@|"D],}#zHt$ %¡}d& |tBt$j@ƒtB|"ƒtB|#ƒg¡|_&| '| t$j@|"|#d¡Wn4tk
r‚t     =d'|"|#¡t    j=d(|dd)YnªX| rÌ|j(r¦t     
d*tj |¡¡d|_(|j)D]}|j*dkr²d|_(q²t+||
ƒ}$|$sâ| rz| Ctj :|¡|"g|#g¡Wn*tk
r*t     =tj :|¡¡‚YnXqqì|rbt     
d+d, |¡¡tDjE|tDjFtDjFd-|||<t G||¡trîz.tHjI|||d.tJ K||¡tH L|||¡WnBtHjMk
rÂYn,tHjNk
rì|r܂t     Od/|¡YnX|S)0zó
    Cache prevents preprocessing binary files again and again.
 
    'dist_nm'  Filename relative to dist directory. We need it on Mac to determine level of paths for @loader_path like
               '@loader_path/../../' for qt4 plugins.
    rrZbinding_redirectsÚwin_private_assembliesFz8Disabling UPX for %s due to match in exclude pattern: %szpy%d%sr#Úcachedirzbincache%d%d_%s_%súutf-8ZadhocÚrbzno-entitlementsz    index.datzIPyInstaller bincache may be corrupted; use pyinstaller --clean to fix it.Nz    .manifestz!Changing %s into private assemblyz!Microsoft.Windows.Common-ControlsT)ÚstripÚupxÚdist_nmÚ target_archÚcodesign_identityÚentitlements_fileÚstrict_arch_validationz Disabling UPX for %s due to CFG!z1Disabling UPX for %s due to it being a Qt plugin!z--bestZhasUPX)éÚntz--lzmar<Zupx_dirz-qz-Sr;Úchflagsií)z.pydz.dllú:z&Cannot parse manifest resource %s, =%sz From file %s)Úexc_infoz#Changing %s into a private assemblyz Executing - Ú)ÚstdoutÚstderr)Z display_namezCFile %s failed optional architecture validation - collecting as-is!)PÚPyInstaller.configr    ÚgetrrrÚpathlibÚPurePathÚmatchrrÚsysÚ version_infoÚplatformÚ architecturer&r(ÚjoinÚhashlibÚsha256ÚencodeÚ    hexdigestÚopenÚreadÚexistsÚmakedirsr Zload_py_data_structÚ    ExceptionÚwarningÚnormcaser*Ú cacheDigestÚremoveÚlowerr$rZManifestÚfilenameÚ parse_stringZpublicKeyTokenr/r0r6ZwriteprettyxmlÚ
checkCacher Zpefile_check_control_flow_guardZis_file_qt_pluginÚdirnameÚshutilÚcopyÚhasattrrDÚOSErrorÚchmodr)ZGetManifestResourcesÚabspathrZ
pywintypesÚerrorÚargsZERROR_BAD_EXE_FORMATZ RT_MANIFESTr,ÚstrZupdate_resourcesÚ
subprocessÚrunÚDEVNULLZsave_py_data_structÚosxutilsZbinary_to_target_archr
Zmac_set_relative_dylib_depsZ sign_binaryZInvalidBinaryErrorZIncompatibleBinaryArchErrorÚdebug)%Úfnmr;r<Z upx_excluder=r>r?r@rAr    r3r7Zfnm_pathZupx_exclude_entryÚpyverÚarchr8Zcsi_hashÚfpZef_hashZ cacheindexfnZ cache_indexZbasenmÚdigestZ
cachedfileÚcmdr2Úfr5ZbestoptZupx_executableZ strip_optionsÚresÚer0Úlanguager4rrrrdƒs6    
 
 
 
 
 
 
 
 
 
 
ø       þ
 
 
 
rdc    slt ¡}t|dƒ(‰t‡fdd„dƒD]}| |¡q&W5QRX|r\t|ƒ d¡}| |¡t| ¡ƒ}|S)Nr:cs
ˆ d¡S)Ni@)rYr©rzrrÚ<lambda>‰ózcacheDigest.<locals>.<lambda>r€r9)    rTÚmd5rXÚiterÚupdaternrVÚ    bytearrayrx)rtr3ZhasherÚchunkrxrr~rr_†s 
 r_cCsxddlm}d}|d |¡r8t d||d¡|d7}|d |¡r`t d||d¡|d7}|rttd|d    ƒ‚d
S) zø
    Check that path does not overlap with WORKPATH or SPECPATH (i.e., WORKPATH and SPECPATH may not start with path,
    which could be caused by a faulty hand-edited specfile).
 
    Raise SystemExit if there is overlap, return True otherwise
    rrÚworkpathz;Specfile error: The output path "%s" contains WORKPATH (%s)r#Zspecpathz;Specfile error: The output path "%s" contains SPECPATH (%s)z\Error: Please edit/recreate the specfile (%s) and set a different output name (e.g. "dist").ÚspecT)rJr    Ú
startswithrrlÚ
SystemExit)r(r    ZspecerrrrrÚ_check_path_overlap’s ÿÿrŠcCs^t|ƒrZtj |¡s tj |¡rLzt |¡Wntk
rJt|ƒYnXtj|dddS)zA
    Create a clean directory from the given directory name.
    T©Úexist_okN)    rŠr&r(ÚisdirÚisfiler`riÚ_rmtreer[)r(rrrÚ_make_clean_directory©srcCs‚ddlm}|drd}n$tj ¡r2td|ƒ}n td|ƒ‚| ¡ ¡dkrv|ds^t    dƒt
  d|¡t   |¡ntd    ƒ‚d
S) zn
    Remove directory and all its contents, but only after user confirmation, or if the -y option is set.
    rrZ    noconfirmÚyzXWARNING: The output directory "%s" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)z’Error: The output directory "%s" is not empty. Please remove all its contents or use the -y option (remove output directory without confirmation).zSOn your own risk, you can use the option `--noconfirm` to get rid of this question.zRemoving dir %sz User abortedN)rJr    rOrHÚisattyÚinputr‰r;raÚprintrrrfÚrmtree)r(r    Úchoicerrrr·s$ 
ÿÿÿ  rc Cs–tƒ}|D]„\}}|s tdƒ‚|s6tdtj|fƒ‚|rTtj |¡sTtj ||¡}tj |¡}tj |¡rt|g}n
t         |¡}|s¤d|}| 
d¡rœ|d7}t|ƒ‚|D]æ}tj |¡rê|  tj tj |tj  |¡¡¡tj |¡f¡q¨tj  |¡r¨t |¡D]Œ\}}    }
| |¡st‚tj tj |tj ||¡¡¡} |
D]J} tj || ¡} tj | ¡r>|  tj tj | | ¡¡tj | ¡f¡q>qq¨q
|S)a®
    Convert the passed list of hook-style 2-tuples into a returned set of `TOC`-style 2-tuples.
 
    Elements of the passed list are 2-tuples `(source_dir_or_glob, target_dir)`.
    Elements of the returned set are 2-tuples `(target_file, source_file)`.
    For backwards compatibility, the order of elements in the former tuples are the reverse of the order of elements in
    the latter tuples!
 
    Parameters
    ----------
    binaries_or_datas : list
        List of hook-style 2-tuples (e.g., the top-level `binaries` and `datas` attributes defined by hooks) whose:
        * The first element is either:
          * A glob matching only the absolute or relative paths of source non-Python data files.
          * The absolute or relative path of a source directory containing only source non-Python data files.
        * The second element is the relative path of the target directory into which these source files will be
          recursively copied.
 
        If the optional `workingdir` parameter is passed, source paths may be either absolute or relative; else, source
        paths _must_ be absolute.
    workingdir : str
        Optional absolute path of the directory to which all relative source paths in the `binaries_or_datas`
        parameter will be prepended by (and hence converted into absolute paths) _or_ `None` if these paths are to be
        preserved as relative. Defaults to `None`.
 
    Returns
    ----------
    set
        Set of `TOC`-style 2-tuples whose:
        * First element is the absolute or relative path of a target file.
        * Second element is the absolute or relative path of the corresponding source file to be copied to this target
          file.
    z„Empty SRC is not allowed when adding binary and data files, as it would result in collection of the whole current working directory.zbEmpty DEST not allowed when adding binary and data files. Maybe you want to used %r.
Caused by %r.z6Unable to find "%s" when adding binary and data files.z
pyconfig.ha»This means your Python installation does not come with proper shared library files.
This usually happens due to missing development package, or unsuitable build parameters of the Python installation.
 
* On Debian/Ubuntu, you need to install Python development packages:
  * apt-get install python3-dev
  * apt-get install python-dev
* If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).
)Úsetr‰r&Úcurdirr(ÚisabsrSÚnormpathrŽÚglobr$Úaddr*rÚwalkrˆr+Úrelpath)Zbinaries_or_datasZ
workingdirZ    toc_datasZsrc_root_path_or_globZ trg_root_dirZsrc_root_pathsÚmsgZ src_root_pathÚsrc_dirZsrc_subdir_basenamesZsrc_file_basenamesZtrg_dirZsrc_file_basenameZsrc_filerrrÚformat_binaries_and_datasØsR"ÿÿÿ  
 
 
þ  
ÿr¡c
Cs zb|dkr(t d|¡d}t||dƒWSt d|¡t|dƒ}| ¡}W5QRXt||dƒWSWn8tk
rš}ztd|ƒt|jƒ‚W5d}~XYnXdS)    zz
    Get the code-object for a module.
 
    This is a simplifed non-performant version which circumvents __pycache__.
    )ú-NzCompiling namespace package %sz#
Úexecz Compiling %sr:zSyntax error in N)rrsÚcompilerXrYÚ SyntaxErrorr”rm)ÚmodnamerbÚtxtrzÚsourcer|rrrÚget_code_objectEs   
 
r©cs(tjtd}tdd„|Dƒtdd}ˆdkrhtj |j¡}|D]"}| |¡r@|t|ƒd…‰qhq@|St    |ƒ‰t
‡‡fdd„|j Dƒƒ}t |dƒr¢|j |ˆdSt |d    ƒrêˆ|j|j|j|j|j|j||j|jˆ|j|j|j|j|jƒSˆ|j|j|j|j|j||j|jˆ|j|j|j|j|jƒSdS)
NZpathexcss|]}tj |d¡VqdS)rGN)r&r(rS)Ú.0rzrrrÚ    <genexpr>bsz&strip_paths_in_code.<locals>.<genexpr>T)ÚkeyÚreversec3s&|]}t|ˆƒrt|ˆƒn|VqdS)N)Ú
isinstanceÚstrip_paths_in_code)rªZconst_co©Z    code_funcÚ new_filenamerrr«psÿr%)Ú    co_constsÚ co_filenameÚco_kwonlyargcount)rOr(r    Úsortedr,r&ršr³rˆÚtypeÚtupler²rhr%Ú co_argcountr´Ú
co_nlocalsÚ co_stacksizeÚco_flagsÚco_codeÚco_namesÚ co_varnamesÚco_nameÚco_firstlinenoÚ    co_lnotabÚ co_freevarsÚ co_cellvars)Úcor±Z replace_pathsZoriginal_filenamerzZconstsrr°rr¯^sb
þ
 
ýþr¯cCsf|d}| d¡rdS|d}t |d¡r.dS| d¡sF| d¡sFdS|D]}t ||¡rJdSqJdS)    ak
    Return True if the given binary_tuple describes a system binary that should be included.
 
    Exclude all system library binaries other than those with "lib-dynload" in the destination or "python" in the
    source, except for those matching the patterns in the exceptions list. Intended to be used from the Analysis
    exclude_system_libraries method.
    rz lib-dynloadTr#z*python*z/libz/usr/libF)rˆÚfnmatch)Z binary_tupleÚ
exceptionsÚdestÚsrcÚ    exceptionrrrÚ_should_include_system_binary…s
  rÊc    Csê| d¡}d|kr|}d}n|dd…}|d}tjj|f||dfžŽ}tj |¡rœd}t |¡t |¡kr”t|dƒ}    |     d¡t    j
k}W5QRX|rœ|Stj tj  |¡d    d
|rÂ|  |d¡nd}
|
dkr”tj |¡\} } |  ¡} | d krt ||¡t|dƒ} |  ¡}W5QRXnd| dkrlt|dƒ} |  ¡}W5QRX|dd…t    j
kr‚td |›d ƒ‚ntd|›d| ›dƒ‚t |dd…¡}
t|
ƒ}
t|dƒ:}    |     t    j
¡|     t dd¡¡|     d¡t |
|    ¡W5QRX|S)zø
    Given the TOC entry (name, path, typecode) for a pure-python module, compile the module in the specified working
    directory, and return the TOC entry for collecting the byte-compiled module. No-op for typecodes other than
    PYMODULE.
    r"Ú__init__Néÿÿÿÿz.pycFr:éTr‹z.pyzThe .pyc module z1 was compiled for incompatible version of python!zInvalid python module file z; unhandled extension ú!éÚwbz<Ir#s)Úsplitr&r(rSrZr rrXrYrZBYTECODE_MAGICr[rerKr)raÚ
py_compiler¤Ú
ValueErrorÚmarshalÚloadsr¯ÚwriteÚstructÚpackÚdump)r0Zsrc_pathr†Z
code_cacheZ
split_nameZ parent_dirsZ mod_basenameÚpyc_pathZ    can_reuseÚfhÚ code_objectÚ_ÚextrwZpyc_datarrrÚcompile_pymodule›sJ
 
 
 
 
rß)FFNNNNNF)N)N)N)7rÅr›rTrÔr&rLrQrÒrfr×rorOZ PyInstallerrrÚloggingZPyInstaller.compatrrrrrJr    ZPyInstaller.dependr
ZPyInstaller.depend.bindependr ZPyInstaller.utilsr ZPyInstaller.utils.win32r rrZPyInstaller.utils.osxÚutilsZosxrrÚ    getLoggerÚ__name__rrr r!r.r6rdr_rŠrrr¡r©r¯rÊrßrrrrÚ<module>s`      
 
 
÷
 !
m
'