转换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
                        

许可证

MIT

这个工具是在pipfile-requirements工具的基础上改进的,感谢@frostming的贡献。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
用于切换状态结果的枚举的java输入   检测*NIX上打开的端口时出现java问题   java捕获和保存屏幕截图   java SLF4JLogback:基于日志级别的多模式   Java从字符串中删除动态子字符串   在spring引导中contextLoads测试时运行java Liquibase   基于规则集的任意嵌套POJO的java任意就地转换   java如何做,边做边循环这段代码?   java是什么导致jmh测量中的错误?   java Spring RabbitTemplate执行方法可见性   java jms创建连接http超时weblogic   java如何在JMapViewer中的两点之间放置像箭头一样的图像   在我的形状计算器Java程序中使用带有Switch/Case语句的循环   字符串如何在Java中比较字符和数字