@@ -42,94 +42,18 @@ requires = ["meson-python", "pybind11"]
4242build-backend = " mesonpy"
4343{%- elif cookiecutter.backend == "poetry" %}
4444{%- if cookiecutter.vcs %}
45- requires = [" poetry-core>=1 .0.0" , " poetry-dynamic-versioning" ]
45+ requires = [" poetry-core>=2 .0.0" , " poetry-dynamic-versioning" ]
4646build-backend = " poetry_dynamic_versioning.backend"
4747{%- else %}
48- requires = [" poetry_core>=1 .0.0" ]
48+ requires = [" poetry_core>=2 .0.0" ]
4949build-backend = " poetry.core.masonry.api"
5050{%- endif %}
5151{%- endif %}
5252
5353
54- {%- if cookiecutter.backend == "poetry" %}
55-
56-
57- [tool .poetry ]
58- name = " {{ cookiecutter.project_name }}"
59- {%- if cookiecutter.vcs %}
60- version = " 0.0.0"
61- {%- else %}
62- version = " 0.1.0"
63- {%- endif %}
64- authors = [
65- " {{ cookiecutter.full_name }} <{{ cookiecutter.email }}>" ,
66- ]
67- {%- if cookiecutter.org == "scikit-hep" %}
68- maintainers = [
69- " The Scikit-HEP admins <[email protected] >" ,
70- ]
71- {%- endif %}
72- homepage = " {{ cookiecutter.url }}"
73- repository = " {{ cookiecutter.url }}"
74- {%- if cookiecutter.license == "BSD" %}
75- license = " BSD-3-Clause"
76- {%- elif cookiecutter.license == "Apache" %}
77- license = " Apache-2.0"
78- {%- elif cookiecutter.license == "MIT" %}
79- license = " MIT"
80- {%- endif %}
81- description = " {{ cookiecutter.project_short_description }}"
82- readme = " README.md"
83-
84- classifiers = [
85- " Development Status :: 1 - Planning" ,
86- " Intended Audience :: Science/Research" ,
87- " Intended Audience :: Developers" ,
88- " Operating System :: OS Independent" ,
89- " Topic :: Scientific/Engineering" ,
90- " Typing :: Typed" ,
91- ]
92-
93- [tool .poetry .dependencies ]
94- python = " >=3.9"
95-
96- furo = { version = " >=2023.08.17" , optional = true }
97- myst_parser = { version = " >=0.13" , optional = true }
98- pytest = { version = " >=6" , optional = true }
99- pytest-cov = { version = " >=3" , optional = true }
100- sphinx = { version = " >=7.0" , optional = true }
101- sphinx_copybutton = { version = " >=0.3.0" , optional = true }
102- sphinx-autodoc-typehints = { version = " *" , optional = true }
103- docutils = { version = " !=0.21.post1" , optional = true }
104-
105- [tool .poetry .dev-dependencies ]
106- pytest = " >= 6"
107- pytest-cov = " >= 3"
108-
109- [tool .poetry .extras ]
110- test = [" pytest" , " pytest-cov" ]
111- dev = [" pytest" , " pytest-cov" ]
112- docs = [
113- " furo" ,
114- " myst_parser" ,
115- " sphinx" ,
116- " sphinx_autodoc_typehints" ,
117- " sphinx_copybutton" ,
118- " docutils" ,
119- ]
120-
121- {%- if cookiecutter.vcs %}
122-
123- [tool .poetry-dynamic-versioning ]
124- enable = true
125- substitution.files = [" src/{{ cookiecutter.__project_slug }}/__init__.py" ]
126- {%- endif %}
127- {%- else %}
128-
129-
13054[project ]
13155name = " {{ cookiecutter.project_name }}"
132- {%- if cookiecutter.backend in ['maturin', 'mesonpy'] or not cookiecutter.vcs and cookiecutter.backend in ['setuptools', 'pybind11', 'skbuild'] %}
56+ {%- if cookiecutter.backend in ['maturin', 'mesonpy'] or not cookiecutter.vcs and cookiecutter.backend in ['setuptools', 'pybind11', 'skbuild', 'poetry' ] %}
13357version = " 0.1.0"
13458{%- endif %}
13559authors = [
@@ -196,7 +120,6 @@ Homepage = "{{ cookiecutter.url }}"
196120"Bug Tracker" = " {{ cookiecutter.url }}/issues"
197121Discussions = " {{ cookiecutter.url }}/discussions"
198122Changelog = " {{ cookiecutter.url }}/releases"
199- {%- endif %}
200123
201124
202125{%- if cookiecutter.backend == "skbuild" %}
@@ -257,17 +180,32 @@ path = "src/{{ cookiecutter.__project_slug }}/__init__.py"
257180[tool .pdm .dev-dependencies ]
258181devtest = [" pytest" , " pytest-cov" ]
259182
183+ {%- elif cookiecutter.backend == "poetry" %}
184+ {%- if cookiecutter.vcs %}
185+ [tool .poetry ]
186+ version = " 0.0.0"
187+
188+ [tool .poetry .requires-plugins ]
189+ poetry-dynamic-versioning = { version = " >=1.0.0" , extras = [" plugin" ] }
190+
191+ [tool .poetry-dynamic-versioning ]
192+ enable = true
193+ substitution.files = [" src/{{ cookiecutter.__project_slug }}/__init__.py" ]
260194{%- endif %}
261195
262- {%- if cookiecutter.backend in ["pybind11", "poetry", "flit", "skbuild", "setuptools"] and cookiecutter.vcs %}
196+ [tool .poetry .group .test .dependencies ]
197+ pytest = " >= 6"
198+ pytest-cov = " >= 3"
199+ {%- endif %}
200+
201+
202+ {%- if cookiecutter.backend in ["pybind11", "flit", "skbuild", "setuptools"] and cookiecutter.vcs %}
263203
264204
265205[tool .setuptools_scm ]
266206write_to = " src/{{ cookiecutter.__project_slug }}/_version.py"
267- {%- endif %}
268-
269207
270- {%- if cookiecutter.backend != "poetry" %}
208+ {%- endif %}
271209
272210
273211[tool .uv ]
@@ -276,9 +214,6 @@ dev-dependencies = [
276214]
277215
278216
279- {%- endif %}
280-
281-
282217{%- if cookiecutter.__type == "compiled" %}
283218
284219
0 commit comments