@@ -62,8 +62,6 @@ def setup_cfg_template(package_name="foo", module_name=None):
62
62
[metadata]
63
63
name = { package_name }
64
64
version = attr: { module_name or package_name } .__version__
65
- long_description = file: README.md
66
- long_description_content_type = text/x-markdown
67
65
68
66
[options]
69
67
zip_safe = False
@@ -74,6 +72,10 @@ def setup_cfg_template(package_name="foo", module_name=None):
74
72
75
73
SETUP_PY_TEMPLATE = """__import__("setuptools").setup()\n """
76
74
75
+ LICENSE_TEMPLATE = "A fake license"
76
+
77
+ README_TEMPLATE = "A fake readme"
78
+
77
79
78
80
def pyproject_template (project_name = "foo" , sub_packages = []):
79
81
res = f"""
@@ -85,7 +87,7 @@ def pyproject_template(project_name="foo", sub_packages=[]):
85
87
name = "{ project_name } "
86
88
version = "0.0.1"
87
89
description = "My package description"
88
- dynamic = ["readme"]
90
+ readme = "README.md"
89
91
license = {{file = "LICENSE"}}
90
92
authors = [
91
93
@@ -94,9 +96,6 @@ def pyproject_template(project_name="foo", sub_packages=[]):
94
96
95
97
[project.urls]
96
98
homepage = "https://foo.com"
97
-
98
- [tool.setuptools.dynamic]
99
- readme = {{file = "README.md"}}
100
99
"""
101
100
if sub_packages :
102
101
res += f"""
@@ -219,7 +218,7 @@ def write_files(git_repo, sub_packages=[], package_name="foo", module_name=None)
219
218
220
219
pyproject = git_repo / "pyproject.toml"
221
220
pyproject .write_text (
222
- pyproject_template (module_name , sub_packages ), encoding = "utf-8"
221
+ pyproject_template (package_name , sub_packages ), encoding = "utf-8"
223
222
)
224
223
225
224
foopy = git_repo / f"{ module_name } .py"
@@ -229,15 +228,15 @@ def write_files(git_repo, sub_packages=[], package_name="foo", module_name=None)
229
228
manifest .write_text (MANIFEST_TEMPLATE , encoding = "utf-8" )
230
229
231
230
license = git_repo / "LICENSE"
232
- license .touch ( )
231
+ license .write_text ( LICENSE_TEMPLATE , encoding = "utf-8" )
233
232
234
233
here = Path (__file__ ).parent
235
234
text = here .parent .parent .joinpath (".pre-commit-config.yaml" ).read_text (
236
235
encoding = "utf-8"
237
236
)
238
237
239
238
readme = git_repo / "README.md"
240
- readme .touch ( )
239
+ readme .write_text ( README_TEMPLATE , encoding = "utf-8" )
241
240
242
241
pre_commit = git_repo / ".pre-commit-config.yaml"
243
242
pre_commit .write_text (text , encoding = "utf-8" )
0 commit comments