#!/usr/bin/env python
#
# Hi There!
#
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version 23.3).
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
# script. Pip has a lot of code to deal with the security of installing
# packages, various edge cases on various platforms, and other such sort of
# "tribal knowledge" that has been encoded in its code base. Because of this
# we basically include an entire copy of pip inside this blob. We do this
# because the alternatives are attempt to implement a "minipip" that probably
# doesn't do things correctly and has weird edge cases, or compress pip itself
# down into a single file.
#
# If you're wondering how this is created, it is generated using
# `scripts/generate.py` in https://github.com/pypa/get-pip.
import sys
this_python = sys.version_info[:2]
min_version = (3, 7)
if this_python < min_version:
message_parts = [
"This script does not work on Python {}.{}".format(*this_python),
"The minimum supported Python version is {}.{}.".format(*min_version),
"Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(*this_python),
]
print("ERROR: " + " ".join(message_parts))
sys.exit(1)
import os.path
import pkgutil
import shutil
import tempfile
import argparse
import importlib
from base64 import b85decode
def include_setuptools(args):
"""
Install setuptools only if absent and not excluded.
"""
cli = not args.no_setuptools
env = not os.environ.get("PIP_NO_SETUPTOOLS")
absent = not importlib.util.find_spec("setuptools")
return cli and env and absent
def include_wheel(args):
"""
Install wheel only if absent and not excluded.
"""
cli = not args.no_wheel
env = not os.environ.get("PIP_NO_WHEEL")
absent = not importlib.util.find_spec("wheel")
return cli and env and absent
def determine_pip_install_arguments():
pre_parser = argparse.ArgumentParser()
pre_parser.add_argument("--no-setuptools", action="store_true")
pre_parser.add_argument("--no-wheel", action="store_true")
pre, args = pre_parser.parse_known_args()
args.append("pip")
if include_setuptools(pre):
args.append("setuptools")
if include_wheel(pre):
args.append("wheel")
return ["install", "--upgrade", "--force-reinstall"] + args
def monkeypatch_for_cert(tmpdir):
"""Patches `pip install` to provide default certificate with the lowest priority.
This ensures that the bundled certificates are used unless the user specifies a
custom cert via any of pip's option passing mechanisms (config, env-var, CLI).
A monkeypatch is the easiest way to achieve this, without messing too much with
the rest of pip's internals.
"""
from pip._internal.commands.install import InstallCommand
# We want to be using the internal certificates.
cert_path = os.path.join(tmpdir, "cacert.pem")
with open(cert_path, "wb") as cert:
cert.write(pkgutil.get_data("pip._vendor.certifi", "cacert.pem"))
install_parse_args = InstallCommand.parse_args
def cert_parse_args(self, args):
if not self.parser.get_default_values().cert:
# There are no user provided cert -- force use of bundled cert
self.parser.defaults["cert"] = cert_path # calculated above
return install_parse_args(self, args)
InstallCommand.parse_args = cert_parse_args
def bootstrap(tmpdir):
monkeypatch_for_cert(tmpdir)
# Execute the included pip and use it to install the latest pip and
# setuptools from PyPI
from pip._internal.cli.main import main as pip_entry_point
args = determine_pip_install_arguments()
sys.exit(pip_entry_point(args))
def main():
tmpdir = None
try:
# Create a temporary working directory
tmpdir = tempfile.mkdtemp()
# Unpack the zipfile into the temporary directory
pip_zip = os.path.join(tmpdir, "pip.zip")
with open(pip_zip, "wb") as fp:
fp.write(b85decode(DATA.replace(b"\n", b"")))
# Add the zipfile to sys.path so that we can import it
sys.path.insert(0, pip_zip)
# Run the bootstrap
bootstrap(tmpdir=tmpdir)
finally:
# Clean up our temporary working directory
if tmpdir:
shutil.rmtree(tmpdir, ignore_errors=True)
DATA = b"""
P)h>@6aWAK2mm~SPgm3R^WgRX003hF000jF003}la4%n9X>MtBUtcb8c|B0UO2j}6z0X&KUUXrd0as8
93SI<3)PuKWDYI?b2HKe+NnQH)PP^=eK*;0e<?&jMBj}tcbU<T@tnf*qTlh{&G5Eols`^8gyi^suKyk
mbyTTaLU<;$CaO=5~^2*;Y=X+5;95VYW2He2iD^SqVK(3-FetQzg?ZW~i=PP*o`G6RP8AkL$p^XfaAR
K2%lx_s#DL@^A!~sESrlexcD)^qMzG>+E9vW0ngKR+%p;t{(I@gi*)6v#(bZJiBWlcvS6N-C$cz&`MX
X|X2NHW7#7k75jENL+)&nae9E?HG4_9-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p|Md5_dh8VFk)MrKrY1tUi4BuK
mpdJh&SGC!EjMR=WhEgyI1U-+*Jxtjwr`*jE#k+Nu|2xz<*P-bGr7G|sd#KKPysm4#it^iA4fpVr6V`
C`V5xQQz}{}Rdl|{L5-5y<{BEf&GvwGoo0H^-AT3i-0Ua&a6c!L`BCcyP_Q;r8%dy#!dbfc`vj|;BUo
oIV4OZSI2qKKCMfOcIkdE`ow|Q#HQbJ>GHzYEnG&k3GxBeV(`~SO#$E3WJZ0zrCK6ovXzoIbe%;|^RD
yrQlP)h>@6aWAK2mm~SPge{ch+|s}0009h000^Q003}la4%nJZggdGZeeUMVs&Y3WM5@&b}n#v)mlq)
<G2yN>sMeohb0q|`#7akqa^dt?6@-VxMn<?Y^hXSiiAdtDUu72wzV$*_jES^5+Et>Y$})4!4knnqaR;
C0NC@qmt9fjY+c<JqOOj-YFQ_F&i1ung{;f8E$WKpohYi$Oy-4b*$!vG<HGa2#iBSiwP;ycfBuYP`mv
VgSCh7fve=nNS+u<Wed?)Ne&61Sv{~#$ePmf(mOR6iCDR1&Ma~7!Ul&=cXxdZ5`?uF3&G;_OZmwape~
%&?f}gI|$*Z^PSO2)U{2^o)Ef?vo<RN<p8inkAgNvnQ$Ubs-yzUx&hs;9use)Gv#k47!IJxCjUW+*6q
Am7?S>f&g@=d845GqB>#
没有合适的资源?快使用搜索试试~ 我知道了~
解决TypeError: expected str, bytes or os.PathLike object, not int
共1个文件
py:1个
需积分: 1 2 下载量 178 浏览量
2023-10-20
11:21:50
上传
评论
收藏 2.04MB RAR 举报
温馨提示
博文需要的资源文件
资源推荐
资源详情
资源评论
收起资源包目录
pip.rar (1个子文件)
pip.py 2.54MB
共 1 条
- 1
资源评论
lao_5
- 粉丝: 293
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 沈丘盛世龙门图纸符合规范化
- HM3400-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 基于python+streamlit联邦学习进行高校学生成绩预测研究python源码+项目说明+模型+数据.zip
- HM3400D-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM3400B-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- spring-boot示例
- 搜集火星资源.py
- JAR应用启动停止脚本化解决方案.zip
- 配合eclipse svn插件subclipse-4.3.4版本的javahl
- Bash脚本教程:如何优雅地停止JAR服务.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功