Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/generate_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Setup poetry
- name: Setup uv
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry --version
curl -LsSf https://astral.sh/uv/install.sh | sh
uv --version
- name: Generate tag
run: |
# pyproject.tomlからバージョン取得
export TAG_VERSION=$(poetry version | awk '{print $2}')
export TAG_VERSION=$(uv version | awk '{print $2}')
# 取得したバージョンでタグを生成
git tag $TAG_VERSION
git push origin $TAG_VERSION
16 changes: 8 additions & 8 deletions .github/workflows/python-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Setup poetry
- name: Setup uv
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry --version
curl -LsSf https://astral.sh/uv/install.sh | sh
uv --version
- name: Install dependencies
run: |
poetry install
uv sync
- name: Format and test
run: |
poetry run black src/ tests/
poetry run mypy -p src
poetry run pytest tests/
uv run black src/ tests/
uv run mypy -p src
uv run pytest tests/
- name: Tag check
run: |
# タグ情報のみfetch
git fetch --tags
git tag -n
# pyproject.tomlからバージョン取得
export TAG_VERSION=$(poetry version | awk '{print $2}')
export TAG_VERSION=$(uv version | awk '{print $2}')
# 取得したバージョンでタグを生成
git tag $TAG_VERSION
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp src/.env.sample src/.env
## プログラム実行

```bash
poetry run python src/main.py
uv run python src/main.py
```

## その他コマンド
Expand All @@ -25,20 +25,5 @@ poetry run python src/main.py
## リポジトリのバージョンアップ

```bash
poetry version <バージョン>
```

## パッケージのバージョンアップ

```bash
poetry search <パッケージ名>
```

`pyproject.toml`を確認し、必要であれば制約を修正する。
その後

```bash
poetry update
```

[poetry documentation](https://python-poetry.org/docs/cli/#update)
uv version --bump patch
```
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def main():
print("Hello from python-starter!")


if __name__ == "__main__":
main()
14 changes: 5 additions & 9 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@ python = "3.13"

[tasks.main]
description = "プログラムを実行する"
run = "poetry run python src/main.py"
run = "uv run python src/main.py"

[tasks.test]
description = "テストを実行する"
run = "poetry run pytest tests/"
run = "uv run pytest tests/"

[tasks.format]
description = "ファイルのフォーマットを行う"
run = "poetry run black src/ tests/"
run = "uv run black src/ tests/"

[tasks.type-check]
description = "プログラムの型チェックを行う"
run = "poetry run mypy -p src"
run = "uv run mypy -p src"

[tasks.check-all]
description = "全てまとめてチェックを行う"
run =[
"mise run format",
"mise run type-check",
"mise run test"
]

[tasks.export]
description = "requirements.txtを出力する"
run = "poetry export -f requirements.txt --output requirements.txt"
]
698 changes: 0 additions & 698 deletions poetry.lock

This file was deleted.

40 changes: 17 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
[tool.poetry]
[project]
name = "python-starter"
version = "1.2.2"
version = "2.0.0"
description = "Template for Python project"
authors = ["negi524 <egtnrumpbiizarre.info@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [
{ include = "application_setting", from = "src" }
]
requires-python = ">=3.13"
dependencies = [
"pydantic>=2.11.7",
"python-dotenv>=1.1.1",
"pyyaml>=6.0.2",
"requests>=2.32.4",
"types-requests>=2.32.4.20250611",
]

[tool.poetry.dependencies]
python = "^3.13"
requests = "^2.32"
PyYAML = "^6.0"
python-dotenv = "^1.0.0"
types-requests = "^2.32"
pydantic = "^2.10.4"
[dependency-groups]
dev = [
"black>=25.1.0",
"mypy>=1.16.1",
"pytest>=8.4.1",
"types-pyyaml>=6.0.12.20250516",
]

[tool.poetry.group.dev.dependencies]
pytest = "^8.3"
black = "^24.8"
mypy = "^1.11"
types-pyyaml = "^6.0.12"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
ignore_missing_imports = true
Expand Down
364 changes: 364 additions & 0 deletions uv.lock

Large diffs are not rendered by default.