Closed5
poetryからryeに移行する
venv + poetryからryeに移行する
取り敢えず消す
.venv
poetry.lock
.python-version
pyproject.toml
を書き換える
- [tool.poetry]を[project]にする
pyproject.toml
- [tool.poetry]
+ [project]
- authorsの形式を変更
pyproject.toml
- authors = ["ibaraki <ibaraki@example.com>"]
+ authors = [{ name = "ibaraki", email = "ibaraki@example.com" }]
- pythonのバージョン指定の変更
pyproject.toml
- [tool.poetry.dependencies]
- python = "~3.11"
+ requires-python = ">=3.11,<3.12"
- dependenciesの変更
pyproject.toml
- [tool.poetry.dependencies]
- boto3 = "^1.28.62"
+ dependencies = [
+ "boto3>=1.28.62,<2",
+ ]
- dev-dependenciesの変更
pyproject.toml
- [tool.poetry.dev-dependencies]
- pytest = "^5.2"
+ [tool.rye]
+ managed = true
+ dev-dependencies = [
+ "pytest>=5.2,<6",
+ ]
- build-systemの変更
pyproject.toml
[build-system]
- requires = ["poetry-core>=1.0.0"]
- build-backend = "poetry.core.masonry.api"
+ requires = ["hatchling"]
+ build-backend = "hatchling.build"
- scriptsの変更
pyproject.toml
- [tool.poetry]
- packages = [
- { include="scripts", from="." },
- ]
- [tool.poetry.scripts]
+ [project.scripts]
start = "scripts.func_start:main"
test = "scripts.test:main"
最終的にはこんな感じ
pyproject.toml
[project]
name = "sample-app"
version = "0.1.2"
description = ""
authors = [{ name = "ibaraki", email = "ibaraki@example.com" }]
readme = "readme.md"
requires-python = ">=3.11,<3.12"
dependencies = [
"boto3>=1.28.62,<2",
"fastapi>=0.63.0,<1",
"gunicorn>=20.0.4,<20",
"uvicorn[standard]>=0.13.3,<1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=5.2,<6",
"autopep8>=1.5.5,<2"
]
[project.scripts]
start = "scripts.func_start:main"
test = "scripts.test:main"
rye sync
このスクラップは2023/11/09にクローズされました