Skip to content

Commit

Permalink
Fix package name in towncrier configuration (#161)
Browse files Browse the repository at this point in the history
Update towncrier config to use `cookiecutter.module_name`

Closes #160
  • Loading branch information
Cadair authored Dec 18, 2024
2 parents 3396a46 + 9d9cdcf commit c60ccf2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def bake_examples(cookies):
"""
Examples on.
"""
result = cookies.bake(extra_context={"include_example_code": "y",
result = cookies.bake(extra_context={"package_name": "example-package",
"module_name": "example_package",
"include_example_code": "y",
"author_name": "test",
"use_extended_ruff_linting": "y"})
return _handle_cookiecutter_errors(result)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_examples_present(cookiejar_examples):
example_files.append("example_c.pyx")

for afile in example_files:
assert (cj.project_path / ctx['package_name'] / afile).exists()
assert (cj.project_path / ctx['module_name'] / afile).exists()


@pytest.mark.parametrize("license, lfile", [
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.package_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ write_to = "{{ cookiecutter.module_name }}/version.py"
# TODO: This should be in towncrier.toml but Giles currently only works looks in
# pyproject.toml we should move this back when it's fixed.
[tool.towncrier]
package = "{{ cookiecutter.package_name }}"
package = "{{ cookiecutter.module_name }}"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} </~https://github.com/{{ cookiecutter.github_repo | default('sunpy/sunpy') }}/pull/{issue}>`__"
Expand Down

0 comments on commit c60ccf2

Please sign in to comment.