溫馨提示×

溫馨提示×

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

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

怎么用python poetry創建項目

發布時間:2022-05-23 16:55:49 來源:億速云 閱讀:132 作者:iii 欄目:大數據

這篇“怎么用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

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