简体   繁体   English

如何初始化 pyproject.toml 文件

[英]How to init the pyproject.toml file

I found that python can use pyproject.toml to list dependencies instead of requirements.txt file.我发现 python 可以使用 pyproject.toml 来列出依赖项而不是 requirements.txt 文件。 It's more convenient and is very similar to package.json for node.However, I could not find a documentation to init the pyproject.toml file much like the npm init command.它更方便,并且与 node 的 package.json 非常相似。但是,我找不到像npm init命令一样初始化 pyproject.toml 文件的文档。 How to autogenerate the file with virtualenv or pip?如何使用 virtualenv 或 pip 自动生成文件? also, is there a way to autoupdate the toml file, as the packagaes get installed, much like npm --save tag, that saves the package to the package.json as its installed?另外,有没有办法在安装包时自动更新 toml 文件,就像 npm --save 标记一样,在安装时将包保存到 package.json 中?

Look at poetry . It can do it for you nicely.它可以很好地为您完成。 Actually I think its the only project that handles this already that I know of.实际上,我认为这是我所知道的唯一一个已经处理这个问题的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM