Skip to content

Commit c877da2

Browse files
authored
Feature/updates for uv (#4)
* updated cookie toml * updated acitions for python 3.14 * fixed docs conf.py and web_app.py for uv * updated hooks and tests to validate version.py is removed when using uv * added 3.14 to testing cookie bake * moving dev of the cookie itself to uv * first run after moving to uv
1 parent 611d2e2 commit c877da2

File tree

20 files changed

+2818
-52
lines changed

20 files changed

+2818
-52
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ contact_links:
1010
- name: pytest-cookies Information
1111
url: https://pytest-cookies.readthedocs.io/en/latest/
1212
about: pytest-cookie Website
13+
- name: UV Information
14+
url: https://docs.astral.sh/uv/
15+
about: UV By Astral Website

.github/workflows/test-bake.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- "3.11"
3232
- "3.12"
3333
- "3.13"
34+
- "3.14"
3435
os:
3536
- ubuntu-latest
3637
- windows-latest

Makefile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
# Makefile for project needs
22
# Author: Ben Trachtenberg
3-
# Version: 1.0.0
3+
# Version: 1.0.1
44
#
55

6-
.PHONY: all info coverage pytest black security
6+
.PHONY: all info coverage pytest black security pip-export
77

88
info:
99
@echo "make options"
1010
@echo " black To format code with black"
1111
@echo " coverage To run coverage and display ASCII and output to htmlcov"
1212
@echo " pytest To run pytest with verbose option"
1313

14-
all: black pylint coverage security vulnerabilities
14+
all: black pylint coverage security pip-export vulnerabilities
1515

1616
coverage:
17-
@pytest --cov --cov-report=html -vvv
17+
@uv run pytest --cov --cov-report=html -vvv
1818

1919
pytest:
20-
@pytest --cov -vvv
20+
@uv run pytest --cov -vvv
2121

2222
pylint:
23-
@pylint hooks/
23+
@uv run pylint hooks/
2424

2525
black:
26-
@black hooks/
27-
@black tests/
26+
@uv run black hooks/
27+
@uv run black tests/
2828

2929
security:
30-
@bandit -c pyproject.toml -r .
30+
@uv run bandit -c pyproject.toml -r .
3131

3232
vulnerabilities:
33-
@pip-audit -r requirements.txt
33+
@uv run pip-audit -r requirements.txt
34+
35+
pip-export:
36+
@uv export --no-dev --no-emit-project --no-editable > requirements.txt
37+
@uv export --no-emit-project --no-editable > requirements-dev.txt

cookiecutter.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"3.10",
2121
"3.11",
2222
"3.12",
23-
"3.13"
23+
"3.13",
24+
"3.14"
2425
],
2526
"package_manager": [
2627
"uv",
@@ -47,7 +48,7 @@
4748
"https"
4849
],
4950
"__template_repo": "https://github.com/btr1975/cookiecutter-python-fastapi-openapi",
50-
"__template_version": "2.0.2",
51+
"__template_version": "2.0.3",
5152
"_new_lines": "\n",
5253
"_copy_without_render": [
5354
"{{cookiecutter.__app_name}}/templates",
@@ -77,7 +78,8 @@
7778
"3.10": "3.10",
7879
"3.11": "3.11",
7980
"3.12": "3.12",
80-
"3.13": "3.13"
81+
"3.13": "3.13",
82+
"3.14": "3.14"
8183
},
8284
"package_manager": {
8385
"__prompt__": "Which pacakge manager for Python will be supported",

hooks/post_gen_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'{% if cookiecutter.package_manager == "uv" %}requirements-dev.txt{% endif %}',
2626
'{% if cookiecutter.package_manager == "uv" %}.github/workflows/publish-to-pypi.yml{% endif %}',
2727
'{% if cookiecutter.package_manager == "uv" %}.github/workflows/test-coverage-lint.yml{% endif %}',
28+
'{% if cookiecutter.package_manager == "uv" %}{{cookiecutter.__app_name}}/version.py{% endif %}',
2829
]
2930

3031
REMOVE_PATHS_PIP = [

make.bat

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

77
IF "%1" == "all" (
8-
black hooks\
9-
black tests\
10-
pylint hooks\
11-
pytest --cov --cov-report=html -vvv
12-
bandit -c pyproject.toml -r .
13-
pip-audit -r requirements.txt
8+
uv run black hooks\
9+
uv run black tests\
10+
uv run pylint hooks\
11+
uv run pytest --cov --cov-report=html -vvv
12+
uv run bandit -c pyproject.toml -r .
13+
uv export --no-dev --no-emit-project --no-editable > requirements.txt
14+
uv export --no-emit-project --no-editable > requirements-dev.txt
15+
uv run pip-audit -r requirements.txt
1416
GOTO END
1517
)
1618

1719
IF "%1" == "coverage" (
18-
pytest --cov --cov-report=html -vvv
20+
uv run pytest --cov --cov-report=html -vvv
1921
GOTO END
2022
)
2123

2224
IF "%1" == "pylint" (
23-
pylint hooks\
25+
uv run pylint hooks\
2426
GOTO END
2527
)
2628

2729
IF "%1" == "pytest" (
28-
pytest --cov -vvv
30+
uv run pytest --cov -vvv
2931
GOTO END
3032
)
3133

3234
IF "%1" == "black" (
33-
black hooks\
34-
black tests\
35+
uv run black hooks\
36+
uv run black tests\
3537
GOTO END
3638
)
3739

3840
IF "%1" == "security" (
39-
bandit -c pyproject.toml -r .
41+
uv run bandit -c pyproject.toml -r .
4042
GOTO END
4143
)
4244

4345
IF "%1" == "vulnerabilities" (
44-
pip-audit -r requirements.txt
46+
uv run pip-audit -r requirements.txt
47+
GOTO END
48+
)
49+
50+
IF "%1" == "pip-export" (
51+
uv export --no-dev --no-emit-project --no-editable > requirements.txt
52+
uv export --no-emit-project --no-editable > requirements-dev.txt
4553
GOTO END
4654
)
4755

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=67.6.0",
4+
"wheel>=0.40.0"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "cookiecutter-python-fastapi-openapi"
10+
version = "2.0.3"
11+
dynamic = ["readme"]
12+
requires-python = ">=3.9"
13+
description = "A cookiecutter for a python FastAPI Application"
14+
keywords = [
15+
]
16+
authors = [
17+
{ name="Benjamin P. Trachtenberg", email="[email protected]" },
18+
]
19+
maintainers = [
20+
{name = "Benjamin P. Trachtenberg", email = "[email protected]"},
21+
]
22+
license = "MIT"
23+
license-files = [
24+
"LICENSE"
25+
]
26+
classifiers = [
27+
"Development Status :: 5 - Production/Stable",
28+
"Intended Audience :: Developers",
29+
"Natural Language :: English",
30+
"Operating System :: MacOS :: MacOS X",
31+
"Operating System :: POSIX",
32+
"Operating System :: POSIX :: BSD",
33+
"Operating System :: POSIX :: Linux",
34+
"Operating System :: Microsoft :: Windows",
35+
"Programming Language :: Python :: 3",
36+
"Programming Language :: Python :: 3 :: Only",
37+
"Programming Language :: Python :: 3.9",
38+
"Programming Language :: Python :: 3.10",
39+
"Programming Language :: Python :: 3.11",
40+
"Programming Language :: Python :: 3.12",
41+
"Programming Language :: Python :: 3.13",
42+
"Programming Language :: Python :: 3.14",
43+
]
44+
45+
dependencies = [
46+
"cookiecutter~=2.6.0",
47+
]
48+
49+
[dependency-groups]
50+
dev = [
51+
"pytest-cov~=4.1.0",
52+
"pytest-cookies~=0.7.0",
53+
"pylint~=3.0.2",
54+
"pip-audit~=2.7.3",
55+
"black~=24.10.0",
56+
"bandit~=1.8.3",
57+
]
58+
59+
[tool.setuptools.dynamic]
60+
readme = {file = "README.md", content-type = "text/markdown"}
61+
162
[tool.pytest.ini_options]
263
addopts = "--strict-markers"
364
markers = [
@@ -35,3 +96,7 @@ exclude_dirs = [
3596
"docs",
3697
"{{cookiecutter.git_repo_name}}",
3798
]
99+
100+
[tool.uv]
101+
keyring-provider = "subprocess"
102+
native-tls = true

0 commit comments

Comments
 (0)