vault backup: 2025-01-20 10:37:47
This commit is contained in:
		
							
								
								
									
										8
									
								
								.obsidian/workspace-mobile.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.obsidian/workspace-mobile.json
									
									
									
									
										vendored
									
									
								
							| @ -13,12 +13,12 @@ | |||||||
|             "state": { |             "state": { | ||||||
|               "type": "markdown", |               "type": "markdown", | ||||||
|               "state": { |               "state": { | ||||||
|                 "file": "組織/EverfortuneAI/{Note} Nox.md", |                 "file": "組織/EverfortuneAI/{Note} Poetry.md", | ||||||
|                 "mode": "source", |                 "mode": "source", | ||||||
|                 "source": false |                 "source": false | ||||||
|               }, |               }, | ||||||
|               "icon": "lucide-file", |               "icon": "lucide-file", | ||||||
|               "title": "{Note} Nox" |               "title": "{Note} Poetry" | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|         ] |         ] | ||||||
| @ -144,9 +144,11 @@ | |||||||
|       "obsidian-git:Open Git source control": false |       "obsidian-git:Open Git source control": false | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   "active": "6dd46505ac5f0579", |   "active": "e0251782d53c0c60", | ||||||
|   "lastOpenFiles": [ |   "lastOpenFiles": [ | ||||||
|     "組織/EverfortuneAI/{Note} Nox.md", |     "組織/EverfortuneAI/{Note} Nox.md", | ||||||
|  |     "組織/EverfortuneAI/{Note} Poetry.md", | ||||||
|  |     "組織/EverfortuneAI/resources/poetry.png", | ||||||
|     "Untitled.md", |     "Untitled.md", | ||||||
|     "組織/EverfortuneAI/{Note} Packaging Python Project.md", |     "組織/EverfortuneAI/{Note} Packaging Python Project.md", | ||||||
|     "README.md", |     "README.md", | ||||||
|  | |||||||
| @ -12,5 +12,24 @@ tags: | |||||||
|  |  | ||||||
|  |  | ||||||
| - Abstract | - Abstract | ||||||
| 	- 新時代的Python環境管理器,支援Python3.9+、多平台以及[pyproject.toml](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) | 	- 新時代的Python環境管理器,支援Python3.9+、多平台以及[pyproject.toml](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/),功能全面適合管理複雜的開發專案 | ||||||
| - Note | - Resources | ||||||
|  | 	- [Installation](https://python-poetry.org/docs/#installation) - Poetry Official Doc | ||||||
|  | 	- [Python 套件管理器——Poetry 完全入門指南](https://blog.kyomind.tw/python-poetry/) - Code and Me | ||||||
|  | - Commands | ||||||
|  | 	- 將虛擬環境建立的位置設至專案資料夾內(統一放在專案資料夾內很方便啊!想移除整個環境的話直接把它刪掉就好) | ||||||
|  | 		- ``poetry config virtualenvs.in-project true`` | ||||||
|  | 	- 初始化專案並產出pyproject.toml | ||||||
|  | 		- ``poetry init`` | ||||||
|  | 	- 創立或進入某個python版本的虛擬環境中(poetry依據python版本切分虛擬環境) | ||||||
|  | 		- ``poetry env use python3.x`` | ||||||
|  | 	- 透過pyproject.toml產生poetry.lock環境檔(通常在修改完前者後執行) | ||||||
|  | 		- ``poetry lock`` | ||||||
|  | 	- 將環境檔套用至虛擬環境中(實際上跑安裝的部分) | ||||||
|  | 		- ``poetry install`` | ||||||
|  | 	- 輸出requirements.txt | ||||||
|  | 		1. 安裝export插件(poetry2.0以上版本) | ||||||
|  | 			- ``pipx inject poetry poetry-plugin-export`` | ||||||
|  | 		2. 執行指令 | ||||||
|  | 			- ``poetry export --without-hashes --format=requirements.txt > requirements.txt`` | ||||||
|  | 			- 或 ``poetry export -f requirements.txt --output requirements.txt`` (帶有hash值) | ||||||
		Reference in New Issue
	
	Block a user