From 897ea08d753cf692e6bc730f331a5963956e48f8 Mon Sep 17 00:00:00 2001 From: Abel Aoun Date: Tue, 14 May 2024 11:26:27 +0200 Subject: [PATCH 1/4] fix: minor fixes --- .../.github/PULL_REQUEST_TEMPLATE.md | 2 +- .../.github/workflows/bump-version.yml | 2 +- {{cookiecutter.project_slug}}/.github/workflows/main.yml | 2 +- {{cookiecutter.project_slug}}/docs/releasing.rst | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md b/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md index dc5f20e3f..6bc65ab47 100644 --- a/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md +++ b/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md @@ -5,7 +5,7 @@ - This PR fixes #xyz - [ ] (If applicable) Documentation has been added / updated (for bug fixes / features). - [ ] (If applicable) Tests have been added. -- [ ] CHANGES.rst has been updated (with summary of main changes). +- [ ] CHANGELOG.rst has been updated (with summary of main changes). - [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added. ### What kind of change does this PR introduce? diff --git a/{{cookiecutter.project_slug}}/.github/workflows/bump-version.yml b/{{cookiecutter.project_slug}}/.github/workflows/bump-version.yml index 1d248f25e..0df595db6 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/bump-version.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/bump-version.yml @@ -22,7 +22,7 @@ on: {%- if cookiecutter.create_author_file == 'y' %} - AUTHORS.rst {%- endif %} - - CHANGES.rst + - CHANGELOG.rst - CONTRIBUTING.rst - Makefile {%- if cookiecutter.make_docs == 'y' %} diff --git a/{{cookiecutter.project_slug}}/.github/workflows/main.yml b/{{cookiecutter.project_slug}}/.github/workflows/main.yml index 3350e0069..cf7e06a0b 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/main.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: - main paths-ignore: - .cruft.json - - CHANGES.rst + - CHANGELOG.rst - README.rst - pyproject.toml - tests/test_{{ cookiecutter.project_slug }}.py diff --git a/{{cookiecutter.project_slug}}/docs/releasing.rst b/{{cookiecutter.project_slug}}/docs/releasing.rst index 7737aa879..4f0005736 100644 --- a/{{cookiecutter.project_slug}}/docs/releasing.rst +++ b/{{cookiecutter.project_slug}}/docs/releasing.rst @@ -12,7 +12,7 @@ A reminder for the **maintainers** on how to deploy. This section is only releva It is important to be aware that any changes to files found within the ``{{ cookiecutter.project_slug }}`` folder (with the exception of ``{{ cookiecutter.project_slug }}/__init__.py``) will trigger the ``bump-version.yml`` workflow. Be careful not to commit changes to files in this folder when preparing a new release. #. Create a new branch from `main` (e.g. `release-0.2.0`). -#. Update the `CHANGES.rst` file to change the `Unreleased` section to the current date. +#. Update the `CHANGELOG.rst` file to change the `Unreleased` section to the current date. #. Bump the version in your branch to the next version (e.g. `v0.1.0 -> v0.2.0`):: .. code-block:: console diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 22b6cdd89..00c092e03 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -106,7 +106,7 @@ all = ["{{ cookiecutter.project_slug }}[dev]"] # "Changelog" = "https://{{ cookiecutter.project_slug }}.readthedocs.io/en/stable/history.html" # "About Ouranos" = "https://www.ouranos.ca/en/" "Issue tracker" = "https://github.com/{{ cookiecutter.__gh_slug }}/issues" -"changelog" = "https://github.com/{{ cookiecutter.__gh_slug }}/blob/main/changelog.rst" +"changelog" = "https://github.com/{{ cookiecutter.__gh_slug }}/blob/main/CHANGELOG.rst" "homepage" = "https://github.com/{{ cookiecutter.__gh_slug }}" [tool] @@ -164,7 +164,7 @@ values = [ [tool.coverage.run] relative_files = true -include = ["{{ cookiecutter.project_slug }}/*"] +include = ["src/{{ cookiecutter.project_slug }}/*"] omit = ["tests/*.py"] {%- if cookiecutter.use_pytest == 'n' %} command_line = "-m unittest discover -s tests/" @@ -178,7 +178,7 @@ include = [ {%- if cookiecutter.create_author_file == 'y' %} "AUTHORS.rst", {% endif -%} - "CHANGES.rst", + "CHANGELOG.rst", "CONTRIBUTING.rst", {%- if cookiecutter.open_source_license in license_classifiers %} "LICENSE", From d8aed4d1f8677d09d879ebdeae92a50f17a100dc Mon Sep 17 00:00:00 2001 From: Abel Aoun Date: Tue, 14 May 2024 13:16:03 +0200 Subject: [PATCH 2/4] and another one --- {{cookiecutter.project_slug}}/docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/docs/index.rst b/{{cookiecutter.project_slug}}/docs/index.rst index cae46ceb8..115d918b7 100644 --- a/{{cookiecutter.project_slug}}/docs/index.rst +++ b/{{cookiecutter.project_slug}}/docs/index.rst @@ -15,7 +15,7 @@ {%- if cookiecutter.create_author_file == 'y' %} authors {%- endif %} - changes + changelog .. toctree:: :maxdepth: 1 From bca16b603a76879b5c9335207dc6586ef71f30e5 Mon Sep 17 00:00:00 2001 From: Abel Aoun Date: Tue, 14 May 2024 13:44:44 +0200 Subject: [PATCH 3/4] fix: test --- tests/test_bake_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_bake_project.py b/tests/test_bake_project.py index a5df6ab40..0290b6b59 100644 --- a/tests/test_bake_project.py +++ b/tests/test_bake_project.py @@ -186,7 +186,7 @@ def test_bake_without_author_file(cookies): # Assert there are no spaces in the toc tree docs_index_path = result.project_path.joinpath("docs/index.rst") with open(str(docs_index_path)) as index_file: - assert "releasing\n changes" in index_file.read() + assert "releasing\n changelog" in index_file.read() # Check that pyproject_path = result.project_path.joinpath("pyproject.toml") From 033d506e08a09db4735a9df84ac22a994295b4f0 Mon Sep 17 00:00:00 2001 From: Abel Aoun Date: Tue, 14 May 2024 14:39:28 +0200 Subject: [PATCH 4/4] fix: Makefile for src layout --- {{cookiecutter.project_slug}}/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index 9a4fda43a..0ce20765b 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -64,14 +64,14 @@ clean-test: ## remove test and coverage artifacts rm -fr .pytest_cache lint/flake8: ## check style with flake8 - ruff {{ cookiecutter.project_slug }} tests - flake8 --config=.flake8 {{ cookiecutter.project_slug }} tests + ruff check src/{{ cookiecutter.project_slug }} tests + flake8 --config=.flake8 src/{{ cookiecutter.project_slug }} tests {% if cookiecutter.use_black == 'y' -%} lint/black: ## check style with black - black --check {{ cookiecutter.project_slug }} tests - blackdoc --check {{ cookiecutter.project_slug }} docs - isort --check {{ cookiecutter.project_slug }} tests + black --check src/{{ cookiecutter.project_slug }} tests + blackdoc --check src/{{ cookiecutter.project_slug }} docs + isort --check src/{{ cookiecutter.project_slug }} tests {% endif -%} lint: lint/flake8{%- if cookiecutter.use_black == 'y' %} lint/black{%- endif %} ## check style @@ -88,9 +88,9 @@ test-all: ## run tests on every Python version with tox coverage: ## check code coverage quickly with the default Python {%- if cookiecutter.use_pytest == 'y' %} - coverage run --source {{ cookiecutter.project_slug }} -m pytest + coverage run --source src/{{ cookiecutter.project_slug }} -m pytest {%- else %} - coverage run --source {{ cookiecutter.project_slug }} -m unittest discover -s tests/ + coverage run --source src/{{ cookiecutter.project_slug }} -m unittest discover -s tests/ {%- endif %} coverage report -m coverage html