diff --git a/README.md b/README.md index 2ed5a30..21eb3ec 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,14 @@ The core features of our C++ Cookiecutter in a nutshell: In order to use this C++ Project Cookiecutter you need the following software installed: -* Python `>= 3.6` +* Python `>= 3.10` * [Cookiecutter](https://github.com/cookiecutter/cookiecutter) `>=2.1` e.g. by doing `pip install cookiecutter`. * Git `>= 1.8.2` In addition, the project that is generated from this cookiecutter will require the following software: * A C++ compiler, e.g. `g++` or `clang++` -* CMake `>= 3.23` +* CMake `>= 3.28` * Doxygen (optional, but recommended) # Using C++ Project Cookiecutter diff --git a/cookiecutter.json b/cookiecutter.json index fab025e..154656e 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -25,6 +25,6 @@ "local_extensions.CurrentDateExtension" ], "__python_module": "{{ cookiecutter|modname }}", - "_catch_version": "3.15.3", - "_cibuildwheel_version": "4.2.0" + "_catch_version": "3.16.0", + "_cibuildwheel_version": "4.2.1" } diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 2c61972..65e504e 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -24,6 +24,11 @@ def fail_if(condition, message): sys.exit(1) +fail_if( + "{{ cookiecutter.doxygen }}" == "No" and "{{ cookiecutter.readthedocs }}" == "Yes", + "Read the Docs requires Doxygen in this template; set doxygen to Yes" +) + fail_if( "{{ cookiecutter.pypi_release }}" != "No" and "{{ cookiecutter.python_bindings }}" == "None", "Can't do PyPI release without building Python bindings" diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 64bc4bb..1115ffa 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: - name: Run Python tests run: | python -m pytest --cov --cov-report=xml -{% else %} +{% endif %} - name: Configure cmake shell: bash @@ -120,7 +120,6 @@ jobs: - name: Build shell: bash run: cmake --build --preset test -{% endif %} - name: Run tests shell: bash @@ -138,4 +137,3 @@ jobs: fail_ci_if_error: true files: ${{ "{{github.workspace}}" }}/coverage.info{% if cookiecutter.python_bindings != "None" %},coverage.xml{% endif %} {% endif %} - diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index ffe1710..e7773e8 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -2,7 +2,7 @@ repos: {%- if cookiecutter.python_bindings != "None" %} # Run Ruff - an extremely fast Python linter and code formatter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.3 + rev: v0.16.6 hooks: # Run the linter - id: ruff-check @@ -14,7 +14,7 @@ repos: # Format C++ code with Clang-Format - automatically applying the changes - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v22.1.8 + rev: v23.1.0 hooks: - id: clang-format args: diff --git a/{{cookiecutter.project_slug}}/CMakePresets.json b/{{cookiecutter.project_slug}}/CMakePresets.json index dba3963..beaad84 100644 --- a/{{cookiecutter.project_slug}}/CMakePresets.json +++ b/{{cookiecutter.project_slug}}/CMakePresets.json @@ -69,12 +69,16 @@ "name": "release", "configurePreset": "release" }, -{% if cookiecutter.doxygen == "Yes" or cookiecutter.readthedocs == "Yes" %} +{% if cookiecutter.doxygen == "Yes" %} { "name": "documentation", "configurePreset": "documentation", "targets": [ +{% if cookiecutter.readthedocs == "Yes" %} "{{ cookiecutter.project_slug }}-sphinx-doc" +{% else %} + "{{ cookiecutter.project_slug }}-doxygen" +{% endif %} ] }, {% endif %} @@ -91,5 +95,69 @@ "outputOnFailure": true } } + ], + "workflowPresets": [ + { + "name": "debug", + "displayName": "Configure and build in debug mode", + "steps": [ + { + "type": "configure", + "name": "debug" + }, + { + "type": "build", + "name": "debug" + } + ] + }, + { + "name": "release", + "displayName": "Configure and build in release mode", + "steps": [ + { + "type": "configure", + "name": "release" + }, + { + "type": "build", + "name": "release" + } + ] + }, +{% if cookiecutter.doxygen == "Yes" %} + { + "name": "documentation", + "displayName": "Configure and build documentation", + "steps": [ + { + "type": "configure", + "name": "documentation" + }, + { + "type": "build", + "name": "documentation" + } + ] + }, +{% endif %} + { + "name": "test", + "displayName": "Configure, build, and test", + "steps": [ + { + "type": "configure", + "name": "test" + }, + { + "type": "build", + "name": "test" + }, + { + "type": "test", + "name": "test" + } + ] + } ] } diff --git a/{{cookiecutter.project_slug}}/FILESTRUCTURE.md b/{{cookiecutter.project_slug}}/FILESTRUCTURE.md index 5906960..3a0fe3c 100644 --- a/{{cookiecutter.project_slug}}/FILESTRUCTURE.md +++ b/{{cookiecutter.project_slug}}/FILESTRUCTURE.md @@ -24,6 +24,7 @@ This is an explanation of the repository's file structure: the `CMakeLists.txt` file from the directory `