Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/test-bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,17 @@ on:

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
os:
- ubuntu-latest
- windows-latest
- macos-latest

steps:
Expand All @@ -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
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions {{cookiecutter.git_repo_name}}/Makefile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
15 changes: 14 additions & 1 deletion {{cookiecutter.git_repo_name}}/make.bat
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 %}
Expand Down
1 change: 1 addition & 0 deletions {{cookiecutter.git_repo_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ dev = [
"sphinxcontrib-mermaid",
"httpx",
"bandit",
"mypy",
{% if cookiecutter.use_requests == 'y' %}"requests-mock",{% endif %}
]
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions {{cookiecutter.git_repo_name}}/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ sphinxcontrib-mermaid
httpx
twine
bandit
mypy
{% if cookiecutter.use_requests == 'y' %}requests-mock{% endif %}