Skip to content

Commit 64b631d

Browse files
authored
Initial commit
0 parents  commit 64b631d

7 files changed

Lines changed: 258 additions & 0 deletions

File tree

.gitignore

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
.idea/

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
default_language_version:
2+
python: python3.13.11
3+
4+
files: ^python_template/
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-docstring-first
13+
- id: detect-private-key
14+
- id: check-json
15+
- id: check-xml
16+
- id: check-yaml
17+
- id: check-toml
18+
19+
- repo: https://github.com/psf/black
20+
rev: 25.1.0
21+
hooks:
22+
- id: black
23+
24+
- repo: https://github.com/PyCQA/autoflake
25+
rev: v2.3.1
26+
hooks:
27+
- id: autoflake
28+
29+
- repo: https://github.com/asottile/reorder-python-imports
30+
rev: v3.14.0
31+
hooks:
32+
- id: reorder-python-imports
33+
args: [--py313-plus]
34+
35+
- repo: https://github.com/pycqa/flake8
36+
rev: 7.1.1
37+
hooks:
38+
- id: flake8
39+
language: system

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.13.11
2+
WORKDIR /usr/src/python_template
3+
COPY . .
4+
5+
RUN python -m pip install --upgrade pip
6+
RUN python -m pip install poetry
7+
RUN python -m poetry install --without dev
8+
9+
# CMD [ "some", "command" ]

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# python-template
2+
![Static Badge](https://img.shields.io/badge/Python-0?style=flat-square&logo=python&color=010409)
3+
![Static Badge](https://img.shields.io/badge/Poetry-0?style=flat-square&logo=Poetry&color=010409)
4+
![Static Badge](https://img.shields.io/badge/Docker-0?style=flat-square&logo=Docker&color=010409)
5+
![Static Badge](https://img.shields.io/badge/Flake8-0?style=flat-square&logo=Flake8&color=010409)
6+
![Static Badge](https://img.shields.io/badge/Black-0?style=flat-square&logo=Black&color=010409)
7+
8+
Template for the [Python 3.13.11](https://www.python.org/downloads/release/python-3110/) projects based on [Poetry](https://python-poetry.org/docs/) using [Flake8](https://flake8.pycqa.org/en/latest/), [Black](https://black.readthedocs.io/en/stable/), [pre-commit](https://pre-commit.com/), [Docker](https://docs.docker.com/) and more
9+
10+
## Quick Start:
11+
1. Create a repository using this template
12+
2. Clone the created repository with `git clone`
13+
3. Rename the created folder
14+
4. Go to the created folder
15+
5. Create a local environment using the command `poetry env use PYTHON_PATH` and add it to your IDE
16+
6. Rename the `python_template` folder to the project name and mark it in the IDE as `Source Root`
17+
7. Configure the `pyproject.toml` file for the project
18+
8. Configure the Flake8 linter and other required tools in the `setup.cfg` file
19+
9. Configure the `Dockerfile` for the project
20+
10. Configure and install pre-commits with the command `pre-commit install`
21+
11. Add the required dependencies with the command `poetry add PACKAGE_NAME` and install them with the command `poetry install`

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[tool.poetry]
2+
name = "python-template"
3+
version = "0.0.0"
4+
description = ""
5+
authors = ["Your Name <you@example.com>"]
6+
readme = "README.md"
7+
packages = [{include = "python_template"}]
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.13.11"
11+
12+
[tool.poetry.group.dev.dependencies]
13+
black = "^25.1.0"
14+
flake8 = "^7.1.1"
15+
flake8-black = "^0.3.6"
16+
flake8-commas = "^2.1.0"
17+
flake8-builtins = "^2.5.0"
18+
flake8-variables-names = "^0.0.6"
19+
pep8-naming = "^0.14.1"
20+
reorder-python-imports = "^3.14.0"
21+
autoflake = "^2.3.1"
22+
setuptools = "^75.8.0"
23+
24+
[build-system]
25+
requires = ["poetry-core"]
26+
build-backend = "poetry.core.masonry.api"

python_template/__init__.py

Whitespace-only changes.

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
exclude = .git,.idea,__pycache__
3+
max-line-length = 100

0 commit comments

Comments
 (0)