Using setup.py instead of pyproject.toml, tutorial in setup.py, updated deps

This commit is contained in:
DarkCat09 2023-04-03 16:53:28 +04:00
parent 1880c4100b
commit 6bf265f139
5 changed files with 45 additions and 28 deletions

View file

@ -50,6 +50,7 @@ Make commands:
|`make prod`|Run a production server| |`make prod`|Run a production server|
|`make docker` or `make docker-build`|Build a docker image from `Dockerfile`| |`make docker` or `make docker-build`|Build a docker image from `Dockerfile`|
|`make docker-push`|Upload the built image to Docker Hub| |`make docker-push`|Upload the built image to Docker Hub|
|`make docker-run`|Starts the containers with Docker Compose|
|`make clean`|Clean all cache| |`make clean`|Clean all cache|
@ -89,7 +90,7 @@ Make commands:
- `db_url` is the MySQL connection URL - `db_url` is the MySQL connection URL
generated from the sql_settings configuration; generated from the sql_settings configuration;
just edit the line declaring `db_url` in `db.py` just edit the line declaring `db_url` in `db.py`
if you are going to use other DBMS, e.g. PostgresSQL if you are going to use other DBMS, e.g. PostgreSQL
### Paths ### Paths
`app/paths` directory contains all FastAPI paths `app/paths` directory contains all FastAPI paths

6
mypy.ini Normal file
View file

@ -0,0 +1,6 @@
[mypy]
show_error_codes = True
ignore_missing_imports = True
check_untyped_defs = True
warn_redundant_casts = True
warn_unused_configs = True

View file

@ -1,26 +0,0 @@
[project]
name = "app"
version = "1.0.0"
dependencies = [
"fastapi",
"uvicorn[standard]",
"gunicorn",
"jinja2",
"starlette-wtf",
"sqlalchemy",
"sqlalchemy-utils",
"mysqlclient",
"python-dotenv",
"autopep8",
"pylint",
"mypy",
]
[tool.setuptools]
packages = []
[tool.mypy]
show_error_codes = true
ignore_missing_imports = true
warn_redundant_casts = true
check_untyped_defs = true

View file

@ -9,7 +9,7 @@ jinja2~=3.1.2
starlette-wtf~=0.4.3 starlette-wtf~=0.4.3
wtforms~=3.0.1 wtforms~=3.0.1
sqlalchemy~=2.0.7 sqlalchemy~=2.0.8
sqlalchemy-utils~=0.40.0 sqlalchemy-utils~=0.40.0
mysqlclient~=2.1.1 mysqlclient~=2.1.1

36
setup.py Normal file
View file

@ -0,0 +1,36 @@
import sys
import setuptools
from tkinter import Tk, ttk
def template_tutorial() -> None:
"""Shows a short tutorial for this template,
generates secret tokens and copies the proper docker-compose.yml
asking for the preferred DBMS (MySQL or PostgreSQL)"""
# Run the tutorial just once,
# when pip calls the script
# with the `egg_info` argument
if len(sys.argv) >= 1 and sys.argv[1] == 'egg_info':
template_tutorial()
setuptools.setup(
name='app',
version='1.0.0',
install_requires=[
'fastapi',
'uvicorn[standard]',
'gunicorn',
'jinja2',
'starlette-wtf',
'sqlalchemy',
'sqlalchemy-utils',
'mysqlclient',
'python-dotenv',
'autopep8',
'pylint',
'mypy',
],
python_requires='>=3.7',
)