Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
§

hµµh¤'ãóؗdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
mZddlmZmZddlmZddlmZmZmZmZmZerddlmZmZGd	„d
¦«ZGd„de¦«ZdS)
z:Handles all file writing and post-installation processing.éN)ÚPath)Ú
TYPE_CHECKINGÚBinaryIOÚ
CollectionÚDictÚIterableÚOptionalÚTupleÚUnion)ÚHashÚRecordEntry)ÚScript)ÚSchemeÚconstruct_record_fileÚcopyfileobj_with_hashingÚfix_shebangÚmake_file_executable)ÚLauncherKindÚ
ScriptSectionc
óŽ—eZdZdZdedededddef
d„Zd	ed
eedfde	d
e
def
d„Zd	ededee
eefddfd„ZdS)ÚWheelDestinationz¿Handles writing the unpacked files, script generation and ``RECORD`` generation.

    Subclasses provide the concrete script generation logic, as well as the RECORD file
    (re)writing.
    ÚnameÚmoduleÚattrÚsectionrÚreturncó—t‚)aWrite a script in the correct location to invoke given entry point.

        :param name: name of the script
        :param module: module path, to load the entry point from
        :param attr: final attribute access, for the entry point
        :param section: Denotes the "entry point section" where this was specified.
            Valid values are ``"gui"`` and ``"console"``.
        :type section: str

        Example usage/behaviour::

            >>> dest.write_script("pip", "pip._internal.cli", "main", "console")

        ©ÚNotImplementedError)Úselfrrrrs     úA/usr/local/lib/python3.11/site-packages/installer/destinations.pyÚwrite_scriptzWheelDestination.write_script's
€õ""Ð!óÚschemeÚpathúos.PathLike[str]ÚstreamÚ
is_executablecó—t‚)aWrite a file to correct ``path`` within the ``scheme``.

        :param scheme: scheme to write the file in (like "purelib", "platlib" etc).
        :param path: path within that scheme
        :param stream: contents of the file
        :param is_executable: whether the file should be made executable

        The stream would be closed by the caller, after this call.

        Example usage/behaviour::

            >>> with open("__init__.py") as stream:
            ...     dest.write_file("purelib", "pkg/__init__.py", stream)

        r)r r$r%r'r(s     r!Ú
write_filezWheelDestination.write_file:s
€õ,"Ð!r#Úrecord_file_pathÚrecordsNcó—t‚)aFinalize installation, after all the files are written.

        Handles (re)writing of the ``RECORD`` file.

        :param scheme: scheme to write the ``RECORD`` file in
        :param record_file_path: path of the ``RECORD`` file with that scheme
        :param records: entries to write to the ``RECORD`` file

        Example usage/behaviour::

            >>> dest.finalize_installation("purelib")

        r)r r$r+r,s    r!Úfinalize_installationz&WheelDestination.finalize_installationRs
€õ&"Ð!r#)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr
r"rrrÚboolr*rr
r.©r#r!rr sò€€€€€ððð"Øð"Ø!$ð"Ø,/ð"Ø:Ið"à	ð"ð"ð"ð"ð&"àð"ðCÐ+Ð+Ô,ð"ðð	"ð
ð"ð
ð
"ð"ð"ð"ð0"àð"ðð"ð˜% ¨Ð 3Ô4Ô5ð	"ð

ð"ð"ð"ð"ð"ð"r#rcó&—eZdZdZ			d!deeefdeddd	ed
eedeeddfd
„Z	de
dedefd„Zde
dedede
def
d„Zde
deedfdede
def
d„Zdedededddef
d„Zde
deddfd„Zde
dedeee
efddfd „ZdS)"ÚSchemeDictionaryDestinationz>Destination, based on a mapping of {scheme: file-system-path}.Úsha256r5NÚscheme_dictÚinterpreterÚscript_kindrÚhash_algorithmÚbytecode_optimization_levelsÚdestdirrcóZ—||_||_||_||_||_||_dS)a Construct a ``SchemeDictionaryDestination`` object.

        :param scheme_dict: a mapping of {scheme: file-system-path}
        :param interpreter: the interpreter to use for generating scripts
        :param script_kind: the "kind" of launcher script to use
        :param hash_algorithm: the hashing algorithm to use, which is a member
            of :any:`hashlib.algorithms_available` (ideally from
            :any:`hashlib.algorithms_guaranteed`).
        :param bytecode_optimization_levels: Compile cached bytecode for
            installed .py files with these optimization levels. The bytecode
            is specific to the minor version of Python (e.g. 3.10) used to
            generate it.
        :param destdir: A staging directory in which to write all files. This
            is expected to be the filesystem root at runtime, so embedded paths
            will be written as though this was the root.
        N)r9r:r;r<r=r>)r r9r:r;r<r=r>s       r!Ú__init__z$SchemeDictionaryDestination.__init__ks7€ð2'ˆÔØ&ˆÔØ&ˆÔØ,ˆÔØ,HˆÔ)؈Œˆˆr#r$r%có—tj |j||¦«}|jNt|¦«}| |j¦«}tj |j|¦«S|S)N)Úosr%Újoinr9r>rÚrelative_toÚanchor)r r$r%ÚfileÚ	file_pathÚrel_paths      r!Ú_path_with_destdirz.SchemeDictionaryDestination._path_with_destdir‹se€ÝŒw|Š|˜DÔ,¨VÔ4°dÑ;Ô;ˆØŒ<Ð#ݘT™
œ
ˆIØ ×,Ò,¨YÔ-=Ñ>Ô>ˆHÝ”7—<’< ¤¨hÑ7Ô7Ð7؈r#r'r(có$—| ||¦«}tj |¦«rd|›}t	|¦«‚tj |¦«}tj |¦«stj|¦«t|d¦«5}t|||j	¦«\}	}
ddd¦«n#1swxYwY|rt|¦«t|t|j	|	¦«|
¦«S)aßWrite contents of ``stream`` to the correct location on the filesystem.

        :param scheme: scheme to write the file in (like "purelib", "platlib" etc).
        :param path: path within that scheme
        :param stream: contents of the file
        :param is_executable: whether the file should be made executable

        - Ensures that an existing file is not being overwritten.
        - Hashes the written content, to determine the entry in the ``RECORD`` file.
        zFile already exists: ÚwbN)
rIrBr%ÚexistsÚFileExistsErrorÚdirnameÚmakedirsÚopenrr<rr
r)r r$r%r'r(Útarget_pathÚmessageÚ
parent_folderÚfÚhash_Úsizes           r!Úwrite_to_fsz'SchemeDictionaryDestination.write_to_fs“sD€ð"×-Ò-¨f°dÑ;Ô;ˆÝ
Œ7>Š>˜+Ñ&Ô&ð	+Ø;¨kÐ;Ð;ˆGÝ! 'Ñ*Ô*Ð*土š¨Ñ4Ô4ˆ
ÝŒw~Š~˜mÑ,Ô,ð	'ÝŒK˜
Ñ&Ô&Ð&å
+˜tÑ
$Ô
$ð	S¨Ý2°6¸1¸dÔ>QÑRÔR‰KˆE4ð	Sð	Sð	Sñ	Sô	Sð	Sð	Sð	Sð	Sð	Sð	Søøøð	Sð	Sð	Sð	Sðð	.Ý  Ñ-Ô-Ð-å˜4¥ dÔ&9¸5Ñ!AÔ!AÀ4ÑHÔHÐHsÂ,CÃCÃCr&cóð—tj|¦«}|dkrEt||j¦«5}| ||||¦«cddd¦«S#1swxYwY| ||||¦«S)aåWrite a file to correct ``path`` within the ``scheme``.

        :param scheme: scheme to write the file in (like "purelib", "platlib" etc).
        :param path: path within that scheme
        :param stream: contents of the file
        :param is_executable: whether the file should be made executable

        - Changes the shebang for files in the "scripts" scheme.
        - Uses :py:meth:`SchemeDictionaryDestination.write_to_fs` for the
          filesystem interaction.
        ÚscriptsN)rBÚfspathrr:rW)r r$r%r'r(Úpath_Ústream_with_different_shebangs       r!r*z&SchemeDictionaryDestination.write_fileµsÀ€õ$”	˜$‘”ˆàYÒÐݘV TÔ%5Ñ6Ô6ð
Ð:WØ×'Ò'ؘEÐ#@À-ñôð
ð
ð
ð
ñ
ô
ð
ð
ð
ð
ð
ð
øøøð
ð
ð
ð
ð
×Ò ¨¨v°}ÑEÔEÐEs°AÁAÁArrrrrcóЗt||||¦«}| |j|j¦«\}}t	j|¦«5}| td¦«||d¬¦«}	| td¦«|¦«}
tj
|
¦«j}||dzdz	z}tj|
|¦«|	cddd¦«S#1swxYwYdS)aXWrite a script to invoke an entrypoint.

        :param name: name of the script
        :param module: module path, to load the entry point from
        :param attr: final attribute access, for the entry point
        :param section: Denotes the "entry point section" where this was specified.
            Valid values are ``"gui"`` and ``"console"``.
        :type section: str

        - Generates a launcher using :any:`Script.generate`.
        - Writes to the "scripts" scheme.
        - Uses :py:meth:`SchemeDictionaryDestination.write_to_fs` for the
          filesystem interaction.
        rYT©r(i$éN)
rÚgenerater:r;ÚioÚBytesIOrWrrIrBÚstatÚst_modeÚchmod)r rrrrÚscriptÚscript_nameÚdatar'Úentryr%Úmodes            r!r"z(SchemeDictionaryDestination.write_scriptÑs(€õ"˜˜f d¨GÑ4Ô4ˆØ"ŸOšO¨DÔ,<¸dÔ>NÑOÔOшTå
ŒZ˜Ñ
Ô
ð
	 Ø×$Ò$ݐyÑ!Ô! ;°Àdð%ñôˆEð×*Ò*­6°)Ñ+<Ô+<¸kÑJÔJˆDÝ”7˜4‘=”=Ô(ˆDØT˜E‘\ aÑ'Ñ'ˆDÝŒHT˜4Ñ Ô Ð àð
	ð
	ð
	ð
	ñ
	ô
	ð
	ð
	ð
	ð
	ð
	ð
	øøøð
	ð
	ð
	ð
	ð
	ð
	sÁ
BCÃCÃ"CÚrecordcó&—|dvrdS| ||j¦«}tj tj |j||j¦«¦«}|jD]}tj||d|¬¦«ŒdS)z'Compile bytecode for a single .py file.)ÚpurelibÚplatlibNé)ÚoptimizeÚquietÚddir)	rIr%rBrNrCr9r=Ú
compileallÚcompile_file)r r$rkrQÚdir_path_to_embedÚlevels      r!Ú_compile_bytecodez-SchemeDictionaryDestination._compile_bytecodeñs¤€àÐ/Ð/Ð/ØˆFà×-Ò-¨f°f´kÑBÔBˆÝœGŸOšOÝŒGLŠL˜Ô)¨&Ô1°6´;Ñ?Ô?ñ
ô
ÐðÔ6ð	ð	ˆEÝÔ#Ø e°1Ð;Lð
ñ
ô
ð
ð
ð	ð	r#r+r,có&‡‡—dtdttfˆˆfd„}t|¦«}t||¦«5}‰ ‰||d¬¦«ddd¦«n#1swxYwY|D]\Š}‰ ‰|¦«ŒdS)a!Finalize installation, by writing the ``RECORD`` file & compiling bytecode.

        :param scheme: scheme to write the ``RECORD`` file in
        :param record_file_path: path of the ``RECORD`` file with that scheme
        :param records: entries to write to the ``RECORD`` file
        Úfile_schemerc󌕗|‰krdStj ‰j|‰j‰¬¦«}|dzS)N)Ústartú/)rBr%Úrelpathr9)ryr%r$r s  €€r!Úprefix_for_schemezLSchemeDictionaryDestination.finalize_installation.<locals>.prefix_for_schemesOø€Ø˜fÒ$Ð$ؐtÝ”7—?’?ØÔ  Ô-ØÔ& vÔ.ð#ñôˆDð˜#‘:Ðr#Fr^N)r3r	ÚlistrrWrw)r r$r+r,r~Úrecord_listÚ
record_streamrks``      r!r.z1SchemeDictionaryDestination.finalize_installationÿsøø€ð	­3ð	µ8½C´=ð	ð	ð	ð	ð	ð	ð	õ˜7‘m”mˆÝ
" ;Ð0AÑ
BÔ
Bð	ÀmØ×ÒØÐ(¨-Àuð
ñ
ô
ð
ð	ð	ð	ñ	ô	ð	ð	ð	ð	ð	ð	øøøð	ð	ð	ð	ð
*ð	3ð	3‰NˆFFØ×"Ò" 6¨6Ñ2Ô2Ð2Ð2ð	3ð	3sÁA(Á(A,Á/A,)r8r5N)r/r0r1r2rr3rÚintr	r@rrIrr4r
rWrr*r"rwrr
r.r5r#r!r7r7hs€€€€€ØHÐHð'Ø8:Ø!%ððà˜#˜s˜(”^ðððð$ð	ð
ðð'1°¤oð
ð˜#”ðð
ððððð@¨ð°sð¸sððððð Iàð Iðð Iðð	 Ið
ð Ið
ð
 Ið Ið Ið IðDFàðFðCÐ+Ð+Ô,ðFðð	Fð
ðFð
ð
FðFðFðFð8ØðØ!$ðØ,/ðØ:Iðà	ððððð@¨ð¸ðÈððððð3àð3ðð3ð˜% ¨Ð 3Ô4Ô5ð	3ð

ð3ð3ð3ð3ð3ð3r#r7)r2rsrarBÚpathlibrÚtypingrrrrrr	r
rÚinstaller.recordsrr
Úinstaller.scriptsrÚinstaller.utilsrrrrrrrrr7r5r#r!ú<module>rˆs£ðØ@Ð@àÐÐÐØ	€	€	€	Ø	€	€	€	ØÐÐÐÐÐð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð	ð0Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ø$Ð$Ð$Ð$Ð$Ð$ðððððððððððððððð>Ø=Ð=Ð=Ð=Ð=Ð=Ð=Ð=ðE"ðE"ðE"ðE"ðE"ñE"ôE"ðE"ðPt3ðt3ðt3ðt3ðt3Ð"2ñt3ôt3ðt3ðt3ðt3r#