Skip to content

Commit 45f4b1f

Browse files
author
James Collins
committed
Upgrade to poetry 2
1 parent 0d89313 commit 45f4b1f

File tree

3 files changed

+35
-37
lines changed

3 files changed

+35
-37
lines changed

{{cookiecutter.project_slug}}/.github/workflows/cookiecutter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: apply additional changes and fixes
3232
if: steps.changes.outputs.changed > 0
3333
run: |
34-
poetry lock --no-update # add new dependencies
34+
poetry lock # add new dependencies
3535
poetry install
3636
poetry run pre-commit run -a || true # we have to fix other issues manually
3737

{{cookiecutter.project_slug}}/.github/workflows/dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
5252
- name: Update outdated packages
5353
if: ${{ steps.check_for_outdated_dependencies.outputs.body != 0 }}
54-
run: poetry lock
54+
run: poetry lock --regenerate
5555

5656
# behaviour if PR already exists: https://github.com/marketplace/actions/create-pull-request#action-behaviour
5757
- name: Create Pull Request

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,56 @@
1-
[tool.poetry]
1+
[project]
22
name = "{{ cookiecutter.project_slug }}"
33
version = "0.0.1"
44
description = "{{ cookiecutter.project_short_description }}"
5-
authors = [
6-
"{{ cookiecutter.author_name }} <{{ cookiecutter.author_email }}>",
7-
]
85
license = "BSD-3-Clause"
96
readme = "README.md"
7+
authors = [
8+
{name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}"},
9+
]
10+
requires-python = ">=3.12"
11+
dependencies = [
12+
"click",
13+
]
1014

11-
documentation = "https://{{ cookiecutter.github_username }}.github.io/{{ cookiecutter.project_slug }}"
15+
[project.optional-dependencies]
16+
dev = [
17+
"mkdocstrings[python]",
18+
"mkdocs-material",
19+
"mkdocs-table-reader-plugin",
20+
"mkdocs-gen-files",
21+
"mkdocs-literate-nav",
22+
"mkdocs-section-index",
23+
"mypy",
24+
"pre-commit",
25+
"pymdown-extensions",
26+
"pytest",
27+
"pytest-github-actions-annotate-failures",
28+
"pytest-cov",
29+
"python-kacl",
30+
"ruff"
31+
]
32+
33+
[project.urls]
1234
homepage = "https://{{ cookiecutter.github_username }}.github.io/{{ cookiecutter.project_slug }}"
1335
repository = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}"
36+
documentation = "https://{{ cookiecutter.github_username }}.github.io/{{ cookiecutter.project_slug }}"
1437

15-
classifiers = [
16-
"Development Status :: 4 - Beta",
17-
"Intended Audience :: Developers",
18-
"Operating System :: OS Independent",
19-
"Programming Language :: Python",
20-
"Programming Language :: Python :: 3",
21-
"Topic :: Software Development :: Libraries :: Python Modules",
22-
"Typing :: Typed",
23-
]
38+
[project.scripts]
39+
my-cli = "{{ cookiecutter.package_name }}.cli:main"
2440

41+
[tool.poetry]
2542
packages = [
2643
{ include = "{{ cookiecutter.package_name }}", from = "src" }
2744
]
45+
requires-poetry = ">=2.0"
2846

2947
[tool.poetry.dependencies]
3048
python = ">=3.12, <4.0"
31-
click = "*"
32-
33-
[tool.poetry.group.dev.dependencies]
34-
mkdocstrings = {version = "*", extras = ["python"]}
35-
mkdocs-material = "*"
36-
mkdocs-table-reader-plugin = "*"
37-
mkdocs-gen-files = "*"
38-
mkdocs-literate-nav = "*"
39-
mkdocs-section-index = "*"
40-
mypy = "*"
41-
pre-commit = "*"
42-
pymdown-extensions = "*"
43-
pytest = "*"
44-
pytest-github-actions-annotate-failures = "*"
45-
pytest-cov = "*"
46-
python-kacl = "*"
47-
ruff = "*"
4849

4950
[build-system]
50-
requires = ["poetry-core>=1.0.0"]
51+
requires = ["poetry-core>=2.0.0"]
5152
build-backend = "poetry.core.masonry.api"
5253

53-
[tool.poetry.scripts]
54-
my-cli = "{{ cookiecutter.package_name }}.cli:main"
55-
5654
[tool.ruff]
5755
target-version = "py312" # The lowest supported version
5856

0 commit comments

Comments
 (0)