溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

python poetry怎么創建項目

發布時間:2021-09-07 11:01:38 來源:億速云 閱讀:169 作者:小新 欄目:編程語言

這篇文章主要為大家展示了“python poetry怎么創建項目”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“python poetry怎么創建項目”這篇文章吧。

1、可以通過命令poetrynew創建項目手腳架。

? poetry new example
? tree
.
└── example
    ├── example
    │   └── __init__.py
    ├── pyproject.toml
    ├── README.rst
    └── tests
        ├── __init__.py
        └── test_example.py
 
3 directories, 5 files

2、Poetry創建了example項目,生成了相應的文件夾和pyproject.toml,包括項目信息。

在現有項目中,通過命令poetryinit進行初始化。

?  example poetry init
 
This command will guide you through creating your pyproject.toml config.
# 交互bash, 通過該交互bash填寫項目信息。
Package name [example]:  example
Version [0.1.0]:  0.0.8
Description []:  example project
Author [so1n <qaz6803609@163.com>, n to skip]:  n
License []:  
Compatible Python versions [^3.7]:  
 
Would you like to define your main dependencies interactively? (yes/no) [yes] no
Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file
# 填寫完項目信息后會生成以下內容, 之后會在剛才的路徑創建pyproject.toml文件, 并寫入。
[tool.poetry]
name = "example"
version = "0.0.8"
description = "example project"
authors = ["Your Name <you@example.com>"]
 
[tool.poetry.dependencies]
python = "^3.7"
 
[tool.poetry.dev-dependencies]
 
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
 
 
Do you confirm generation? (yes/no) [yes] yes

以上是“python poetry怎么創建項目”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女