Skip to content

Commit df87a78

Browse files
committed
clean up pyproject handling
1 parent 92b39b8 commit df87a78

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

jupyter_releaser/tests/conftest.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ def git_repo(tmp_path):
5353
changelog = tmp_path / "CHANGELOG.md"
5454
changelog.write_text(testutil.CHANGELOG_TEMPLATE, encoding="utf-8")
5555

56-
readme = tmp_path / "README.md"
57-
readme.write_text("Hello from foo project\n", encoding="utf-8")
58-
5956
config = Path(util.JUPYTER_RELEASER_CONFIG)
6057
config.write_text(testutil.TOML_CONFIG, encoding="utf-8")
6158

jupyter_releaser/tests/util.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def setup_cfg_template(package_name="foo", module_name=None):
6262
[metadata]
6363
name = {package_name}
6464
version = attr: {module_name or package_name}.__version__
65-
long_description = file: README.md
66-
long_description_content_type = text/x-markdown
6765
6866
[options]
6967
zip_safe = False
@@ -74,6 +72,10 @@ def setup_cfg_template(package_name="foo", module_name=None):
7472

7573
SETUP_PY_TEMPLATE = """__import__("setuptools").setup()\n"""
7674

75+
LICENSE_TEMPLATE = "A fake license"
76+
77+
README_TEMPLATE = "A fake readme"
78+
7779

7880
def pyproject_template(project_name="foo", sub_packages=[]):
7981
res = f"""
@@ -85,7 +87,7 @@ def pyproject_template(project_name="foo", sub_packages=[]):
8587
name = "{project_name}"
8688
version = "0.0.1"
8789
description = "My package description"
88-
dynamic = ["readme"]
90+
readme = "README.md"
8991
license = {{file = "LICENSE"}}
9092
authors = [
9193
{{email = "[email protected]"}},
@@ -94,9 +96,6 @@ def pyproject_template(project_name="foo", sub_packages=[]):
9496
9597
[project.urls]
9698
homepage = "https://foo.com"
97-
98-
[tool.setuptools.dynamic]
99-
readme = {{file = "README.md"}}
10099
"""
101100
if sub_packages:
102101
res += f"""
@@ -219,7 +218,7 @@ def write_files(git_repo, sub_packages=[], package_name="foo", module_name=None)
219218

220219
pyproject = git_repo / "pyproject.toml"
221220
pyproject.write_text(
222-
pyproject_template(module_name, sub_packages), encoding="utf-8"
221+
pyproject_template(package_name, sub_packages), encoding="utf-8"
223222
)
224223

225224
foopy = git_repo / f"{module_name}.py"
@@ -229,15 +228,15 @@ def write_files(git_repo, sub_packages=[], package_name="foo", module_name=None)
229228
manifest.write_text(MANIFEST_TEMPLATE, encoding="utf-8")
230229

231230
license = git_repo / "LICENSE"
232-
license.touch()
231+
license.write_text(LICENSE_TEMPLATE, encoding="utf-8")
233232

234233
here = Path(__file__).parent
235234
text = here.parent.parent.joinpath(".pre-commit-config.yaml").read_text(
236235
encoding="utf-8"
237236
)
238237

239238
readme = git_repo / "README.md"
240-
readme.touch()
239+
readme.write_text(README_TEMPLATE, encoding="utf-8")
241240

242241
pre_commit = git_repo / ".pre-commit-config.yaml"
243242
pre_commit.write_text(text, encoding="utf-8")

0 commit comments

Comments
 (0)