diff --git a/.github/workflows/test-bake.yml b/.github/workflows/test-bake.yml index f090fba..f203ec8 100644 --- a/.github/workflows/test-bake.yml +++ b/.github/workflows/test-bake.yml @@ -21,12 +21,10 @@ on: jobs: build: - runs-on: ${{ matrix.os }} strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" @@ -34,7 +32,6 @@ jobs: - "3.14" os: - ubuntu-latest - - windows-latest - macos-latest steps: @@ -58,3 +55,38 @@ jobs: - name: Check Vulnerabilities run: | pip-audit -r requirements.txt + + build-windows: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + os: + - windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip setuptools wheel + run: | + python -m pip install --upgrade pip setuptools wheel + - name: Install requirements from requirements-dev.txt + run: | + python -m pip install -r requirements-dev.txt + - name: Run Testing + run: | + pytest --cov -vvv + - name: Run Linting + run: | + pylint hooks/ + - name: Check Vulnerabilities + run: | + pip-audit -r requirements.txt diff --git a/cookiecutter.json b/cookiecutter.json index 3024deb..1039cb3 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -48,7 +48,7 @@ "https" ], "__template_repo": "https://github.com/btr1975/cookiecutter-python-fastapi-openapi", - "__template_version": "2.0.3", + "__template_version": "2.0.4", "_new_lines": "\n", "_copy_without_render": [ "{{cookiecutter.__app_name}}/templates", diff --git a/pyproject.toml b/pyproject.toml index 22629a2..7d5d897 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "cookiecutter-python-fastapi-openapi" -version = "2.0.3" +version = "2.0.4" dynamic = ["readme"] requires-python = ">=3.9" description = "A cookiecutter for a python FastAPI Application" diff --git a/uv.lock b/uv.lock index 4a03ba3..9c831ea 100644 --- a/uv.lock +++ b/uv.lock @@ -314,7 +314,7 @@ wheels = [ [[package]] name = "cookiecutter-python-fastapi-openapi" -version = "2.0.3" +version = "2.0.4" source = { editable = "." } dependencies = [ { name = "cookiecutter" }, diff --git a/{{cookiecutter.git_repo_name}}/Makefile b/{{cookiecutter.git_repo_name}}/Makefile index d7ff444..4a98d51 100644 --- a/{{cookiecutter.git_repo_name}}/Makefile +++ b/{{cookiecutter.git_repo_name}}/Makefile @@ -1,10 +1,10 @@ # Makefile for project needs # Author: Ben Trachtenberg -# Version: 2.0.0 +# Version: 2.0.1 # .PHONY: all info build build-container coverage format pylint pytest gh-pages build dev-run start-container \ - stop-container remove-container check-vuln check-security pip-export + stop-container remove-container check-vuln check-security pip-export mypy info: @echo "make options" @@ -16,6 +16,7 @@ info: @echo " coverage To run coverage and display ASCII and output to htmlcov" @echo " dev-run To run the app" @echo " format To format the code with black" + @echo " mypy To run mypy" @echo " pylint To run pylint" @echo " pytest To run pytest with verbose option" @echo " start-container To start the container" @@ -26,7 +27,7 @@ info: {% if cookiecutter.package_manager == 'pip' %} -all: format pylint coverage check-security check-vuln +all: format pylint mypy coverage check-security check-vuln build: @python -m build @@ -53,6 +54,9 @@ check-vuln: check-security: @bandit -c pyproject.toml -r . +mypy: + @mypy {{cookiecutter.__app_name}}/ + {% if cookiecutter.app_documents_location == 'github-pages' %} gh-pages: @rm -rf ./docs/source/code @@ -62,7 +66,7 @@ gh-pages: {% elif cookiecutter.package_manager == 'uv' %} -all: format pylint coverage check-security pip-export +all: format pylint mypy coverage check-security pip-export build: @uv build --wheel --sdist @@ -86,6 +90,9 @@ dev-run: check-security: @uv run bandit -c pyproject.toml -r . +mypy: + @uv run mypy {{cookiecutter.__app_name}}/ + pip-export: @uv export --no-dev --no-emit-project --no-editable > requirements.txt @uv export --no-emit-project --no-editable > requirements-dev.txt diff --git a/{{cookiecutter.git_repo_name}}/make.bat b/{{cookiecutter.git_repo_name}}/make.bat index 23ff15d..8d1ae1c 100644 --- a/{{cookiecutter.git_repo_name}}/make.bat +++ b/{{cookiecutter.git_repo_name}}/make.bat @@ -1,7 +1,7 @@ @ECHO OFF REM Makefile for project needs REM Author: Ben Trachtenberg -REM Version: 2.0.0 +REM Version: 2.0.1 REM SET option=%1 @@ -16,6 +16,7 @@ IF "%option%" == "all" ( black {{cookiecutter.__app_name}}/ black tests/ pylint {{cookiecutter.__app_name}}\ + mypy {{cookiecutter.__app_name}}\ pytest --cov --cov-report=html -vvv bandit -c pyproject.toml -r . pip-audit -r requirements.txt @@ -63,6 +64,11 @@ IF "%option%" == "check-security" ( GOTO END ) +IF "%option%" == "mypy" ( + mypy {{cookiecutter.__app_name}}\ + GOTO END +) + {% if cookiecutter.app_documents_location == 'github-pages' %} IF "%option%" == "gh-pages" ( rmdir /s /q docs\source\code @@ -78,6 +84,7 @@ IF "%option%" == "all" ( uv run black {{cookiecutter.__app_name}}/ uv run black tests/ uv run pylint {{cookiecutter.__app_name}}\ + uv run mypy {{cookiecutter.__app_name}}\ uv run pytest --cov --cov-report=html -vvv uv run bandit -c pyproject.toml -r . uv export --no-dev --no-emit-project --no-editable > requirements.txt @@ -121,6 +128,11 @@ IF "%option%" == "check-security" ( GOTO END ) +IF "%option%" == "mypy" ( + uv run mypy {{cookiecutter.__app_name}}\ + GOTO END +) + IF "%option%" == "pip-export" ( uv export --no-dev --no-emit-project --no-editable > requirements.txt uv export --no-emit-project --no-editable > requirements-dev.txt @@ -147,6 +159,7 @@ IF "%option%" == "gh-pages" ( @ECHO check-vuln To check for vulnerabilities in the dependencies @ECHO check-security To check for vulnerabilities in the code @ECHO format To format the code with black +@ECHO mypy To run mypy @ECHO pylint To run pylint @ECHO pytest To run pytest with verbose option {% if cookiecutter.package_manager == 'uv' %}@ECHO pip-export To export the requirements.txt and requirements-dev.txt{% endif %} diff --git a/{{cookiecutter.git_repo_name}}/pyproject.toml b/{{cookiecutter.git_repo_name}}/pyproject.toml index d8af419..63dd056 100644 --- a/{{cookiecutter.git_repo_name}}/pyproject.toml +++ b/{{cookiecutter.git_repo_name}}/pyproject.toml @@ -83,6 +83,7 @@ dev = [ "sphinxcontrib-mermaid", "httpx", "bandit", + "mypy", {% if cookiecutter.use_requests == 'y' %}"requests-mock",{% endif %} ] {% endif %} diff --git a/{{cookiecutter.git_repo_name}}/requirements-dev.txt b/{{cookiecutter.git_repo_name}}/requirements-dev.txt index d8d0450..52721d9 100644 --- a/{{cookiecutter.git_repo_name}}/requirements-dev.txt +++ b/{{cookiecutter.git_repo_name}}/requirements-dev.txt @@ -15,4 +15,5 @@ sphinxcontrib-mermaid httpx twine bandit +mypy {% if cookiecutter.use_requests == 'y' %}requests-mock{% endif %}