From 1617062fe325a38fe48899e00611434ab9bd950f Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 13:28:46 +0200 Subject: [PATCH 1/9] Removed test.yaml that was left over --- .../.github/workflows/test.yml | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 {{ cookiecutter.project_name }}/.github/workflows/test.yml diff --git a/{{ cookiecutter.project_name }}/.github/workflows/test.yml b/{{ cookiecutter.project_name }}/.github/workflows/test.yml deleted file mode 100644 index bd16ac3..0000000 --- a/{{ cookiecutter.project_name }}/.github/workflows/test.yml +++ /dev/null @@ -1,44 +0,0 @@ -{% raw -%}name: Linux - -# Run on PR requests. And on master itself. -on: - push: - branches: - - master - pull_request: - -jobs: - TestLinux: - name: Linux, Python ${{ matrix.python }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - # 2022 - - python: "3.10" - pins: "" - # 2023 - - python: "3.11" - pins: "" - # 2023 - - python: "3.12" - pins: "" - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Install python dependencies - run: | - pip install --disable-pip-version-check --upgrade pip setuptools - pip install -e .[test] ${{ matrix.pins }} - pip list - - - name: Run tests - run: pytest --cov -{% endraw -%} From bbfc366e8623a04896057e33288d16f89a5b8ab7 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 13:29:31 +0200 Subject: [PATCH 2/9] Upped versions --- .../.github/workflows/nens-meta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.project_name }}/.github/workflows/nens-meta.yml b/{{ cookiecutter.project_name }}/.github/workflows/nens-meta.yml index 601c868..393c149 100644 --- a/{{ cookiecutter.project_name }}/.github/workflows/nens-meta.yml +++ b/{{ cookiecutter.project_name }}/.github/workflows/nens-meta.yml @@ -22,9 +22,9 @@ jobs: name: nens-meta runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.12 - uses: pre-commit/action@v3.0.1 From 74b4b411f033d998650e6f9ad566d89439557516 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 14:28:40 +0200 Subject: [PATCH 3/9] Added hint for vscode (--no-cov) --- {{ cookiecutter.project_name }}/pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.project_name }}/pyproject.toml b/{{ cookiecutter.project_name }}/pyproject.toml index 31ecddf..59873c8 100644 --- a/{{ cookiecutter.project_name }}/pyproject.toml +++ b/{{ cookiecutter.project_name }}/pyproject.toml @@ -23,6 +23,8 @@ homepage = "https://github.com/nens/{{ cookiecutter.project_name }}" [tool.pytest.ini_options] addopts = "--cov --cov-fail-under=80" +# Debugging tests in vscode? Run pytest with "--no-cov", see +# https://pytest-cov.readthedocs.io/en/latest/debuggers.html [tool.zest-releaser] release = false From 795bb5a0780aa7e74a3d675add44147e3318f327 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 14:35:39 +0200 Subject: [PATCH 4/9] updated changelog --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 78d87c8..3a163a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,8 @@ ## 0.8 (unreleased) -- Nothing changed yet. +- Removed old `test.yml`. +- Documented `--no-cov` for vscode when debugging inside tests. ## 0.7 (2025-09-16) From 18dcc16a78bb405903c74d988b67f13418c66019 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 15:36:07 +0200 Subject: [PATCH 5/9] Fixed broken symlink --- .../.github/workflows/test.yml | 1 - symlink_into_django_template.py | 9 +++++++++ uv.lock | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) delete mode 120000 django/{{ cookiecutter.project_name }}/.github/workflows/test.yml diff --git a/django/{{ cookiecutter.project_name }}/.github/workflows/test.yml b/django/{{ cookiecutter.project_name }}/.github/workflows/test.yml deleted file mode 120000 index fb494e7..0000000 --- a/django/{{ cookiecutter.project_name }}/.github/workflows/test.yml +++ /dev/null @@ -1 +0,0 @@ -../../../../{{ cookiecutter.project_name }}/.github/workflows/test.yml \ No newline at end of file diff --git a/symlink_into_django_template.py b/symlink_into_django_template.py index 29060e0..372ac29 100644 --- a/symlink_into_django_template.py +++ b/symlink_into_django_template.py @@ -40,8 +40,17 @@ def create_symlinks(filenames: list[str]) -> bool: return changed_something +def check_for_dead_symlinks(): + for root, dirs, files in Path("django").walk(): + d = Path(root) # d = directory + for f in files: # f = file + if not (d / f).exists(): + print(f"BROKEN symlink '{d / f}'") + + if __name__ == "__main__": changed_something = create_symlinks(python_files()) if changed_something: # Exit with error code: that way we can be run as check in a github action. sys.exit("Some symlinks were created") + check_for_dead_symlinks() diff --git a/uv.lock b/uv.lock index 431f5e1..87de778 100644 --- a/uv.lock +++ b/uv.lock @@ -138,7 +138,7 @@ wheels = [ [[package]] name = "cookiecutter-python-template" -version = "0.7.dev0" +version = "0.8.dev0" source = { virtual = "." } dependencies = [ { name = "cookiecutter" }, From b0ae67cea3a4906254564d69b6ba8e76fea0dd90 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 15:52:09 +0200 Subject: [PATCH 6/9] Added comment about the "dev" dependency group --- {{ cookiecutter.project_name }}/pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{ cookiecutter.project_name }}/pyproject.toml b/{{ cookiecutter.project_name }}/pyproject.toml index 59873c8..fb81346 100644 --- a/{{ cookiecutter.project_name }}/pyproject.toml +++ b/{{ cookiecutter.project_name }}/pyproject.toml @@ -49,4 +49,6 @@ venvPath = "." venv = ".venv" [dependency-groups] +# The "dev" group is automatically installed by uv. When using pip, +# do "pip install --group test". dev = ["pytest>=8.4.2", "pytest-cov>=6.3.0", "pytest-sugar>=1.1.1"] From 87a157338a182a7eeddccc4a969bafcd39934a59 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 16:06:46 +0200 Subject: [PATCH 7/9] Fixed exclusion of tests/ files in the distribution. --- CHANGES.md | 1 + {{ cookiecutter.project_name }}/MANIFEST.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3a163a6..c4595fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - Removed old `test.yml`. - Documented `--no-cov` for vscode when debugging inside tests. +- Fixed exclusion of tests/ files in the distribution. ## 0.7 (2025-09-16) diff --git a/{{ cookiecutter.project_name }}/MANIFEST.in b/{{ cookiecutter.project_name }}/MANIFEST.in index 326e7d0..6cbc083 100644 --- a/{{ cookiecutter.project_name }}/MANIFEST.in +++ b/{{ cookiecutter.project_name }}/MANIFEST.in @@ -1,3 +1,3 @@ # setuptools_scm automatically includes all git-managed files. You can include/exclude # extra files here. -exclude tests/ +recursive-exclude tests/ From e0d7639d5a9fad93a471df7070a3a9c2ecf43172 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 16:09:08 +0200 Subject: [PATCH 8/9] comment tweak --- {{ cookiecutter.project_name }}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.project_name }}/pyproject.toml b/{{ cookiecutter.project_name }}/pyproject.toml index fb81346..0280198 100644 --- a/{{ cookiecutter.project_name }}/pyproject.toml +++ b/{{ cookiecutter.project_name }}/pyproject.toml @@ -50,5 +50,5 @@ venv = ".venv" [dependency-groups] # The "dev" group is automatically installed by uv. When using pip, -# do "pip install --group test". +# do something like "pip install -e . --group test". dev = ["pytest>=8.4.2", "pytest-cov>=6.3.0", "pytest-sugar>=1.1.1"] From 86586c08c0dac4cea3f9aee3791de65ebdec9c73 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Tue, 16 Sep 2025 16:42:41 +0200 Subject: [PATCH 9/9] Fixed post-creation instructions --- {{ cookiecutter.project_name }}/README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/{{ cookiecutter.project_name }}/README.md b/{{ cookiecutter.project_name }}/README.md index 17a016a..0de4233 100644 --- a/{{ cookiecutter.project_name }}/README.md +++ b/{{ cookiecutter.project_name }}/README.md @@ -11,11 +11,11 @@ See [nens-meta's documentation](https://nens-meta.readthedocs.io) for an explana The standard commands apply: - $ uv sync - $ uv run pytest - $ uv run python # You can also activate the virtualenv in .venv - $ pre-commit run --all # You can also do 'pre-commit install' - $ uv add some-dependency + uv sync # Yes, add 'uv.lock' to git afterwards! + uv run pytest + uv run python # You can also activate the virtualenv in .venv + pre-commit run --all # You can also do 'pre-commit install' + uv add some-dependency `uv` replaces pip/venv/requirement.txt/pip-tools. `pre-commit` does basic formatting. @@ -36,11 +36,18 @@ If you need a new dependency (like `requests`), add it in Note: "public" means "don't put customer data or sample data with real persons' addresses on github"! -- Follow the steps you then see (from "git init" to "git push origin main") - and your code will be online. +- Push your project to github (note: the current instructions on github only add the README, but we want to add all files): + + git init + git add -A + git commit -m "Generated with cookiecutter" + git branch -M main + git remote add origin https://github.com/nens/{{ cookiecutter.project_name }}.git + # git remote add origin git@github.com:nens/{{ cookiecutter.project_name }}.git # If you use ssh + git push -u origin main - Go to - https://github.com/nens/>{{ cookiecutter.project_name }}/settings/collaboration + https://github.com/nens/{{ cookiecutter.project_name }}/settings/access and add the teams with write access (you might have to ask someone with admin rights (like Reinout) to do it).