转换Pipfile的CLI工具/Pipfile.lock文件到要求.txt
pipfile-freeze的Python项目详细描述
pipfile冻结
转换Pipfile的CLI工具/Pipfile.lock文件到要求.txt在
所需Python版本
>=2.7, >=3.4
它有什么作用?在
该工具构建在requirementslib之上,为 将Pipenv托管文件转换为要求.txt. 在
Pipenv是管理virtualenv和依赖关系的一个很好的工具,但是它在部署中可能没有那么有用。 Pip安装比Pipenv操作快得多,因为后者需要向PyPI发出额外的请求以进行哈希检查。 在部署中安装Pipenv可能会被过度使用。我们只需要一个要求.txt告诉CI或生产服务器 应该安装哪些软件包和版本。在
安装
$ pip install pipfile-freeze
名为pipfile
的可执行文件将可以在bin路径中使用。在
示例:
^{pr2}$如果你的文件是这样的:
[[source]]name="tuna"url="http://pypi.tuna.tsinghua.edu.cn/simple"verify_ssl=true[[source]]name="pypi"url="https://pypi.org/simple"verify_ssl=true[dev-packages][packages]requests="*"ilogger="==0.1"apscheduler="*"pywinusb={version="1.1",sys_platform="== 'win32'"}[requires]python_version="3.7"
这是输出(要求.txt)公司名称:
--index-url http://pypi.tuna.tsinghua.edu.cn/simple
--trusted-host pypi.tuna.tsinghua.edu.cn
--extra-index-url https://pypi.org/simple
apscheduler
ilogger==0.1
pywinusb; sys_platform == 'win32'
requests
用法:
$ pipfile freeze --help
usage: pipfile freeze [-h] [-p PROJECT] [--hashes] [-d] [-o [file]] [file]
positional arguments:
file The file path to convert, support both Pipfile and
Pipfile.lock. If it isn't given, will try Pipfile.lock
first then Pipfile.
optional arguments:
-h, --help show this help message and exit
-p PROJECT, --project PROJECT
Specify another project root
--hashes whether to include the hashes
-d, --dev whether to choose both develop and default packages
-o [file], --outfile [file]
Output requirements to the file
许可证
这个工具是在pipfile-requirements工具的基础上改进的,感谢@frostming的贡献。在
- 项目
标签: