Skip to content

Commit 5c0ba33

Browse files
committed
build: create base cookiecutter template
0 parents  commit 5c0ba33

10 files changed

Lines changed: 103 additions & 0 deletions

File tree

cookiecutter.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"project_name": "snake_case_project_name",
3+
"author_name": "David Zhang",
4+
"version": "0.1.0",
5+
"description": "Main goal of the project.",
6+
"python_version": "3.13",
7+
"year": "2025"
8+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.12.10
12+
hooks:
13+
- id: ruff-check
14+
args: [ --fix ]
15+
- id: ruff-format
16+
17+
- repo: https://github.com/pre-commit/mirrors-mypy
18+
rev: v1.17.1
19+
hooks:
20+
- id: mypy
21+
additional_dependencies: [types-requests, types-python-dateutil]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 0.1.0
4+
5+
- Initial release.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) {{cookiecutter.year}}, David Zhang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# {{cookiecutter.project_name}}
2+
3+
{{cookiecutter.description}}
4+
5+
## Installation
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[project]
2+
name = "{{cookiecutter.project_name}}"
3+
version = "{{cookiecutter.version}}"
4+
description = "{{cookiecutter.description}}"
5+
authors = [
6+
{ name = "{{cookiecutter.author_name}}" },
7+
]
8+
requires-python = ">={{cookiecutter.version}}"
9+
dependencies = []
10+
11+
[project.optional-dependencies]
12+
dev = [
13+
"pre-commit==4.3.0",
14+
"pytest==8.4.1",
15+
"pytest-cov==6.0.0",
16+
]
17+
18+
[tool.setuptools.packages.find]
19+
where = ["src"]
20+
21+
[build-system]
22+
requires = ["pip>=22.0", "setuptools>=61", "wheel"]
23+
build-backend = "setuptools.build_meta"

{{cookiecutter.project_name}}/src/{{cookiecutter.project_name}}/__init__.py

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def add_one(x: int) -> int:
2+
"""
3+
Example function that adds one to the input.
4+
5+
Args:
6+
x: The input number.
7+
8+
Returns:
9+
The input number plus one.
10+
"""
11+
12+
return x + 1

{{cookiecutter.project_name}}/tests/__init__.py

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from {{cookiecutter.project_name}}.add_one import add_one
2+
3+
4+
def test_add_one():
5+
"""
6+
Test that the add_one function works correctly.
7+
"""
8+
assert add_one(31) == 32

0 commit comments

Comments
 (0)