Skip to content

Commit ec90dcf

Browse files
committed
added mypy
1 parent c877da2 commit ec90dcf

File tree

8 files changed

+65
-11
lines changed

8 files changed

+65
-11
lines changed

.github/workflows/test-bake.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,17 @@ on:
2121

2222
jobs:
2323
build:
24-
2524
runs-on: ${{ matrix.os }}
2625
strategy:
2726
matrix:
2827
python-version:
29-
- "3.9"
3028
- "3.10"
3129
- "3.11"
3230
- "3.12"
3331
- "3.13"
3432
- "3.14"
3533
os:
3634
- ubuntu-latest
37-
- windows-latest
3835
- macos-latest
3936

4037
steps:
@@ -58,3 +55,38 @@ jobs:
5855
- name: Check Vulnerabilities
5956
run: |
6057
pip-audit -r requirements.txt
58+
59+
build-windows:
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
matrix:
63+
python-version:
64+
- "3.10"
65+
- "3.11"
66+
- "3.12"
67+
- "3.13"
68+
- "3.14"
69+
os:
70+
- windows-latest
71+
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Set up Python ${{ matrix.python-version }}
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: ${{ matrix.python-version }}
78+
- name: Upgrade pip setuptools wheel
79+
run: |
80+
python -m pip install --upgrade pip setuptools wheel
81+
- name: Install requirements from requirements-dev.txt
82+
run: |
83+
python -m pip install -r requirements-dev.txt
84+
- name: Run Testing
85+
run: |
86+
pytest --cov -vvv
87+
- name: Run Linting
88+
run: |
89+
pylint hooks/
90+
- name: Check Vulnerabilities
91+
run: |
92+
pip-audit -r requirements.txt

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"https"
4949
],
5050
"__template_repo": "https://github.com/btr1975/cookiecutter-python-fastapi-openapi",
51-
"__template_version": "2.0.3",
51+
"__template_version": "2.0.4",
5252
"_new_lines": "\n",
5353
"_copy_without_render": [
5454
"{{cookiecutter.__app_name}}/templates",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "cookiecutter-python-fastapi-openapi"
10-
version = "2.0.3"
10+
version = "2.0.4"
1111
dynamic = ["readme"]
1212
requires-python = ">=3.9"
1313
description = "A cookiecutter for a python FastAPI Application"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

{{cookiecutter.git_repo_name}}/Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Makefile for project needs
22
# Author: Ben Trachtenberg
3-
# Version: 2.0.0
3+
# Version: 2.0.1
44
#
55

66
.PHONY: all info build build-container coverage format pylint pytest gh-pages build dev-run start-container \
7-
stop-container remove-container check-vuln check-security pip-export
7+
stop-container remove-container check-vuln check-security pip-export mypy
88

99
info:
1010
@echo "make options"
@@ -16,6 +16,7 @@ info:
1616
@echo " coverage To run coverage and display ASCII and output to htmlcov"
1717
@echo " dev-run To run the app"
1818
@echo " format To format the code with black"
19+
@echo " mypy To run mypy"
1920
@echo " pylint To run pylint"
2021
@echo " pytest To run pytest with verbose option"
2122
@echo " start-container To start the container"
@@ -26,7 +27,7 @@ info:
2627

2728
{% if cookiecutter.package_manager == 'pip' %}
2829

29-
all: format pylint coverage check-security check-vuln
30+
all: format pylint mypy coverage check-security check-vuln
3031

3132
build:
3233
@python -m build
@@ -53,6 +54,9 @@ check-vuln:
5354
check-security:
5455
@bandit -c pyproject.toml -r .
5556

57+
mypy:
58+
@mypy {{cookiecutter.__app_name}}/
59+
5660
{% if cookiecutter.app_documents_location == 'github-pages' %}
5761
gh-pages:
5862
@rm -rf ./docs/source/code
@@ -62,7 +66,7 @@ gh-pages:
6266

6367
{% elif cookiecutter.package_manager == 'uv' %}
6468

65-
all: format pylint coverage check-security pip-export
69+
all: format pylint mypy coverage check-security pip-export
6670

6771
build:
6872
@uv build --wheel --sdist
@@ -86,6 +90,9 @@ dev-run:
8690
check-security:
8791
@uv run bandit -c pyproject.toml -r .
8892

93+
mypy:
94+
@uv run mypy {{cookiecutter.__app_name}}/
95+
8996
pip-export:
9097
@uv export --no-dev --no-emit-project --no-editable > requirements.txt
9198
@uv export --no-emit-project --no-editable > requirements-dev.txt

{{cookiecutter.git_repo_name}}/make.bat

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@ECHO OFF
22
REM Makefile for project needs
33
REM Author: Ben Trachtenberg
4-
REM Version: 2.0.0
4+
REM Version: 2.0.1
55
REM
66

77
SET option=%1
@@ -16,6 +16,7 @@ IF "%option%" == "all" (
1616
black {{cookiecutter.__app_name}}/
1717
black tests/
1818
pylint {{cookiecutter.__app_name}}\
19+
mypy {{cookiecutter.__app_name}}\
1920
pytest --cov --cov-report=html -vvv
2021
bandit -c pyproject.toml -r .
2122
pip-audit -r requirements.txt
@@ -63,6 +64,11 @@ IF "%option%" == "check-security" (
6364
GOTO END
6465
)
6566

67+
IF "%option%" == "mypy" (
68+
mypy {{cookiecutter.__app_name}}\
69+
GOTO END
70+
)
71+
6672
{% if cookiecutter.app_documents_location == 'github-pages' %}
6773
IF "%option%" == "gh-pages" (
6874
rmdir /s /q docs\source\code
@@ -78,6 +84,7 @@ IF "%option%" == "all" (
7884
uv run black {{cookiecutter.__app_name}}/
7985
uv run black tests/
8086
uv run pylint {{cookiecutter.__app_name}}\
87+
uv run mypy {{cookiecutter.__app_name}}\
8188
uv run pytest --cov --cov-report=html -vvv
8289
uv run bandit -c pyproject.toml -r .
8390
uv export --no-dev --no-emit-project --no-editable > requirements.txt
@@ -121,6 +128,11 @@ IF "%option%" == "check-security" (
121128
GOTO END
122129
)
123130

131+
IF "%option%" == "mypy" (
132+
uv run mypy {{cookiecutter.__app_name}}\
133+
GOTO END
134+
)
135+
124136
IF "%option%" == "pip-export" (
125137
uv export --no-dev --no-emit-project --no-editable > requirements.txt
126138
uv export --no-emit-project --no-editable > requirements-dev.txt
@@ -147,6 +159,7 @@ IF "%option%" == "gh-pages" (
147159
@ECHO check-vuln To check for vulnerabilities in the dependencies
148160
@ECHO check-security To check for vulnerabilities in the code
149161
@ECHO format To format the code with black
162+
@ECHO mypy To run mypy
150163
@ECHO pylint To run pylint
151164
@ECHO pytest To run pytest with verbose option
152165
{% if cookiecutter.package_manager == 'uv' %}@ECHO pip-export To export the requirements.txt and requirements-dev.txt{% endif %}

{{cookiecutter.git_repo_name}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ dev = [
8383
"sphinxcontrib-mermaid",
8484
"httpx",
8585
"bandit",
86+
"mypy",
8687
{% if cookiecutter.use_requests == 'y' %}"requests-mock",{% endif %}
8788
]
8889
{% endif %}

{{cookiecutter.git_repo_name}}/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ sphinxcontrib-mermaid
1515
httpx
1616
twine
1717
bandit
18+
mypy
1819
{% if cookiecutter.use_requests == 'y' %}requests-mock{% endif %}

0 commit comments

Comments
 (0)