diff --git a/main_package/app.py b/main_package/app.py index 4586c72..aa7036d 100644 --- a/main_package/app.py +++ b/main_package/app.py @@ -38,7 +38,7 @@ async def lifespan(app: FastAPI): yield # await delete_tables() # print("База очищена") - pass + print("Приложение завершено") app = FastAPI( diff --git a/pwd.txt b/pwd.txt new file mode 100644 index 0000000..55365df --- /dev/null +++ b/pwd.txt @@ -0,0 +1 @@ +/data/github/active/LeraFoxQueen.ru/LeraFoxQueen \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 56f6859..35439c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ "unicorn (>=2.1.3,<3.0.0)", "uvicorn (>=0.34.3,<0.35.0)", "gunicorn (>=23.0.0,<24.0.0)", - "fastapi (>=0.115.12,<0.116.0)", + "fastapi[standard] (>=0.115.12,<0.116.0)", "aiosqlite (>=0.21.0,<0.22.0)", "sqlalchemy (>=2.0.41,<3.0.0)", "pydantic (>=2.11.5,<3.0.0)", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..db7ea1b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,54 @@ +aiosqlite==0.21.0 ; python_version >= "3.13" +annotated-types==0.7.0 ; python_version >= "3.13" +anyio==4.9.0 ; python_version >= "3.13" +certifi==2025.7.14 ; python_version >= "3.13" +click==8.2.1 ; python_version >= "3.13" +colorama==0.4.6 ; python_version >= "3.13" +dnspython==2.7.0 ; python_version >= "3.13" +email-validator==2.2.0 ; python_version >= "3.13" +fastapi-cli==0.0.8 ; python_version >= "3.13" +fastapi-cloud-cli==0.1.4 ; python_version >= "3.13" +fastapi-sitemap==1.0.4 ; python_version >= "3.13" +fastapi==0.115.12 ; python_version >= "3.13" +greenlet==3.2.2 ; python_version >= "3.13" +gunicorn==23.0.0 ; python_version >= "3.13" +h11==0.16.0 ; python_version >= "3.13" +h2==4.2.0 ; python_version >= "3.13" +hpack==4.1.0 ; python_version >= "3.13" +httpcore==1.0.9 ; python_version >= "3.13" +httptools==0.6.4 ; python_version >= "3.13" +httpx==0.28.1 ; python_version >= "3.13" +hypercorn==0.17.3 ; python_version >= "3.13" +hyperframe==6.1.0 ; python_version >= "3.13" +idna==3.10 ; python_version >= "3.13" +jinja2==3.1.6 ; python_version >= "3.13" +markdown-it-py==3.0.0 ; python_version >= "3.13" +markupsafe==3.0.2 ; python_version >= "3.13" +mdurl==0.1.2 ; python_version >= "3.13" +packaging==25.0 ; python_version >= "3.13" +priority==2.0.0 ; python_version >= "3.13" +pydantic-core==2.33.2 ; python_version >= "3.13" +pydantic-settings==2.9.1 ; python_version >= "3.13" +pydantic==2.11.5 ; python_version >= "3.13" +pygments==2.19.2 ; python_version >= "3.13" +python-dotenv==1.1.0 ; python_version >= "3.13" +python-multipart==0.0.20 ; python_version >= "3.13" +pyyaml==6.0.2 ; python_version >= "3.13" +rich-toolkit==0.14.8 ; python_version >= "3.13" +rich==14.1.0 ; python_version >= "3.13" +rignore==0.6.4 ; python_version >= "3.13" +sentry-sdk==2.33.2 ; python_version >= "3.13" +shellingham==1.5.4 ; python_version >= "3.13" +sniffio==1.3.1 ; python_version >= "3.13" +sqlalchemy==2.0.41 ; python_version >= "3.13" +starlette==0.46.2 ; python_version >= "3.13" +typer==0.16.0 ; python_version >= "3.13" +typing-extensions==4.14.0 ; python_version >= "3.13" +typing-inspection==0.4.1 ; python_version >= "3.13" +unicorn==2.1.3 ; python_version >= "3.13" +urllib3==2.5.0 ; python_version >= "3.13" +uvicorn==0.34.3 ; python_version >= "3.13" +uvloop==0.21.0 ; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy" and python_version >= "3.13" +watchfiles==1.1.0 ; python_version >= "3.13" +websockets==15.0.1 ; python_version >= "3.13" +wsproto==1.2.0 ; python_version >= "3.13" diff --git a/start.sh b/start.sh index 19fdbee..d204a48 100755 --- a/start.sh +++ b/start.sh @@ -1,10 +1,22 @@ #!/bin/sh + +echo -n $( dirname -- "$( readlink -f -- "$0" )" ) > pwd.txt +CWD=$(cat pwd.txt) +cd "${CWD}" + +rm -rf "${CWD}/.venv" +find . -name __pycache__ -type d -exec rm -vrf {} \; + python -m venv .venv -source .venv/bin/activate -pip install -U pip -pip install uvicorn gunicorn hypercorn fastapi certifi poetry poetry-plugin-export -poetry self add poetry-plugin-export +source "${CWD}/.venv/bin/activate" + +pip install --upgrade pip +pip install poetry poetry-plugin-export +poetry lock +poetry export --without-hashes --format requirements.txt --output ./requirements.txt +pip install --no-cache-dir -r requirements.txt +poetry self update pip show uvicorn | grep -E "Name:|Version:|Location:" pip show gunicorn | grep -E "Name:|Version:|Location:" @@ -18,5 +30,9 @@ poetry install --no-root #hypercorn main_package.app:app --reload -w $(nproc) --bind 0.0.0.0:8001 #poetry run hypercorn main_package/app:app --reload -w $(nproc) --bind 0.0.0.0:8001 #uvicorn main_package.app:app --reload --workers $(nproc) --host 0.0.0.0 --port 8001 -uvicorn main_package.app:app --reload --workers $(nproc) --host 127.0.0.1 --port 8001 +#uvicorn main_package.app:app --reload --workers $(nproc) --host 127.0.0.1 --port 8001 #gunicorn -b 0.0.0.0:8001 -k uvicorn.workers.UvicornWorker main_package.app:app + +cd "${CWD}" +source "${CWD}/.venv/bin/activate" +fastapi run main_package/app.py --reload --port 8001 --proxy-headers