Skip to content

Commit 92fdbe9

Browse files
committed
First
1 parent 9c6e274 commit 92fdbe9

34 files changed

+1250
-1
lines changed

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# EditorConfig information: http://editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set charset for JavaScript, and Python
12+
[*.{js,py}]
13+
charset = utf-8
14+
15+
# Set indent style for Python, JSON
16+
[*.{py,json}]
17+
indent_style = space
18+
indent_size = 4
19+
20+
# Set indent style for XML, YANG, YAML
21+
[*.{xml,yang,yml,yaml}]
22+
indent_style = space
23+
indent_size = 2
24+
25+
# Set indent style for Makefile
26+
[Makefile]
27+
indent_style = tab
28+
29+
# Do not insert new line in file
30+
[*.{j2,jinja2,json}]
31+
insert_final_newline = false

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# By default all non specific files as text
2+
# With LF endings
3+
* text=auto eol=lf
4+
5+
# Set files as binary
6+
*.png binary
7+
*.gif binary
8+
*.pdf binary
9+
*.jar binary
10+
*.tar.gz binary

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,10 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# No JetBrains
132+
.idea/
133+
134+
# No vscode
135+
.vscode/
136+

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
1-
# cookiecutter-python-fastapi-openapi
1+
# cookiecutter-python-fastapi-openapi
2+
* This is a "cookiecutter" repository designed to be used as a framework to create repository structure.
3+
4+
## How to use a "cookiecutter" repository
5+
6+
1. First install the python library called [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/)
7+
8+
```text
9+
pip install cookiecutter
10+
```
11+
12+
2. Create a **TOTALLY** empty repository in a GIT based system. In my example I am creating a repo called
13+
throw-me-away.
14+
15+
3. Use the cookiecutter repository to create your structure.
16+
17+
```text
18+
cookiecutter https://github.com/btr1975/cookiecutter-python-fastapi-openapi
19+
```
20+
21+
4. Now you will be asked a series of questions. This is an example
22+
**THE QUESTIONS MAY NOT BE THE EXACT FOR THIS COOKIECUTTER**, also if you have downloaded it before
23+
you will be asked if you want to download it again, always say yes to get the latest version.
24+
25+
```text
26+
full_name [Your Full Name]: Ben T
27+
email [Your E-Mail Address]: somename@example.com
28+
git_username [Your GitHub Username]: btr1975
29+
git_repo_name [The Repository Name]: throw-me-away
30+
git_url [The GIT URL]: https://github.com/btr1975/throw-me-away
31+
app_description [A short description]: This is great
32+
app_version [0.1.0]:
33+
```
34+
35+
5. Now initialize it and push it up to the GIT based system.
36+
37+
```text
38+
git init -b main
39+
git add --all
40+
git commit -m "First"
41+
git remote add origin https://github.com/btr1975/throw-me-away.git
42+
git push -u origin main
43+
```

cookiecutter.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"full_name": "Your Full Name",
3+
"email": "Your E-Mail Address",
4+
"git_username": "Your GitHub Username",
5+
"git_repo_name": "The Repository Name",
6+
"git_url": "The GIT URL",
7+
"app_description": "A short description",
8+
"app_version": "0.1.0",
9+
"app_documents_location": ["readthedocs.io", "github-pages"],
10+
"use_requests": "no",
11+
"__template_repo": "https://github.com/btr1975/cookiecutter-python-fastapi-openapi",
12+
"__template_version": "1.0.0"
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
command_line= -m pytest -vvv
3+
4+
[report]
5+
include =
6+
modules/*
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# EditorConfig information: http://editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set charset for JavaScript, and Python
12+
[*.{js,py}]
13+
charset = utf-8
14+
15+
# Set indent style for Python, JSON
16+
[*.{py,json}]
17+
indent_style = space
18+
indent_size = 4
19+
20+
# Set indent style for XML, YANG, YAML
21+
[*.{xml,yang,yml,yaml}]
22+
indent_style = space
23+
indent_size = 2
24+
25+
# Set indent style for Makefile
26+
[Makefile]
27+
indent_style = tab
28+
29+
# Do not insert new line in file
30+
[*.{j2,jinja2,json}]
31+
insert_final_newline = false
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# By default all non specific files as text
2+
# With LF endings
3+
* text=auto eol=lf
4+
5+
# Set files as binary
6+
*.png binary
7+
*.gif binary
8+
*.pdf binary
9+
*.jar binary
10+
*.tar.gz binary
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
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+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# No JetBrains
132+
.idea/
133+
134+
# No vscode
135+
.vscode/
136+
137+
# No temp_*.py files
138+
temp_*.py
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM registry.access.redhat.com/ubi8/python-38:1-77
2+
3+
LABEL version="{{ cookiecutter.app_version }}"
4+
LABEL name="{{ cookiecutter.git_repo_name }}"
5+
LABEL description="{{ cookiecutter.app_description }}"
6+
LABEL maintainer="{{ cookiecutter.full_name }}"
7+
8+
COPY ./modules /app_run/modules
9+
COPY ./requirements.txt /app_run
10+
COPY ./app_run.py /app_run
11+
12+
WORKDIR /app_run
13+
14+
RUN pip install --upgrade pip \
15+
&& pip install --upgrade setuptools wheel \
16+
&& pip install -r requirements.txt
17+
18+
EXPOSE 8080/tcp
19+
20+
ENTRYPOINT ["python", "app_run.py"]

0 commit comments

Comments
 (0)