From e669a755ece8c00d416fa30c4ec44981bc8ba936 Mon Sep 17 00:00:00 2001 From: Micha Albert Date: Thu, 15 Aug 2024 19:00:38 +0000 Subject: [PATCH] promptly package python projects properly (breaking changes, sorry) --- {backend => onboard-live-backend}/main.py | 10 ++ .../20240719191810_init/migration.sql | 0 .../20240815175119_pls_work/migration.sql | 0 .../migrations/migration_lock.toml | 0 .../schema.prisma | 0 pyproject.toml | 96 +++++++++++++++++++ requirements.txt | 10 -- 7 files changed, 106 insertions(+), 10 deletions(-) rename {backend => onboard-live-backend}/main.py (99%) rename {backend => onboard-live-backend}/migrations/20240719191810_init/migration.sql (100%) rename {backend => onboard-live-backend}/migrations/20240815175119_pls_work/migration.sql (100%) rename {backend => onboard-live-backend}/migrations/migration_lock.toml (100%) rename {backend => onboard-live-backend}/schema.prisma (100%) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/backend/main.py b/onboard-live-backend/main.py similarity index 99% rename from backend/main.py rename to onboard-live-backend/main.py index 96e1c33..f020828 100644 --- a/backend/main.py +++ b/onboard-live-backend/main.py @@ -5,6 +5,7 @@ from random import choice from secrets import token_hex from typing import Dict, List +import fastapi import httpx from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.triggers.interval import IntervalTrigger @@ -18,6 +19,7 @@ from prisma import Prisma from slack_bolt.adapter.fastapi.async_handler import AsyncSlackRequestHandler from slack_bolt.async_app import AsyncAck, AsyncApp from social_core.backends.slack import SlackOAuth2 +import uvicorn load_dotenv() @@ -562,3 +564,11 @@ async def handle_some_action(ack): @api.post("/slack/events") async def slack_event_endpoint(req: Request): return await bolt_handler.handle(req) + + +def main(): + uvicorn.run(api) + + +if __name__ == "__main__": + main() diff --git a/backend/migrations/20240719191810_init/migration.sql b/onboard-live-backend/migrations/20240719191810_init/migration.sql similarity index 100% rename from backend/migrations/20240719191810_init/migration.sql rename to onboard-live-backend/migrations/20240719191810_init/migration.sql diff --git a/backend/migrations/20240815175119_pls_work/migration.sql b/onboard-live-backend/migrations/20240815175119_pls_work/migration.sql similarity index 100% rename from backend/migrations/20240815175119_pls_work/migration.sql rename to onboard-live-backend/migrations/20240815175119_pls_work/migration.sql diff --git a/backend/migrations/migration_lock.toml b/onboard-live-backend/migrations/migration_lock.toml similarity index 100% rename from backend/migrations/migration_lock.toml rename to onboard-live-backend/migrations/migration_lock.toml diff --git a/backend/schema.prisma b/onboard-live-backend/schema.prisma similarity index 100% rename from backend/schema.prisma rename to onboard-live-backend/schema.prisma diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5cb361c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,96 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "backend" +version = "0.0.1" +authors = [{ name = "Micha Albert", email = "micha@2231puppy.tech" }] +description = "Backend for OnBoard Live, A Hack Club YSWS grant program" +readme = "README.md" +requires-python = ">=3.9" +dependencies = [ + "aiohttp==3.9.5", + "aiosignal==1.3.1", + "annotated-types==0.7.0", + "anyio==4.4.0", + "APScheduler==3.10.4", + "attrs==23.2.0", + "black==24.4.2", + "certifi==2024.7.4", + "cffi==1.17.0", + "charset-normalizer==3.3.2", + "click==8.1.7", + "cryptography==43.0.0", + "defusedxml==0.8.0rc2", + "dnspython==2.6.1", + "ecdsa==0.19.0", + "email_validator==2.2.0", + "fastapi==0.112.0", + "fastapi-cli==0.0.4", + "fastapi-oauth2==1.0.0", + "fastapi-utils==0.7.0", + "frozenlist==1.4.1", + "h11==0.14.0", + "httpcore==1.0.5", + "httptools==0.6.1", + "httpx==0.27.0", + "idna==3.7", + "Jinja2==3.1.4", + "markdown-it-py==3.0.0", + "MarkupSafe==2.1.5", + "mdurl==0.1.2", + "multidict==6.0.5", + "mypy==1.11.0", + "mypy-extensions==1.0.0", + "nodeenv==1.9.1", + "oauthlib==3.2.2", + "packaging==24.1", + "pathspec==0.12.1", + "platformdirs==4.2.2", + "prisma==0.14.0", + "psutil==5.9.8", + "pyasn1==0.6.0", + "pycparser==2.22", + "pydantic==2.8.2", + "pydantic_core==2.20.1", + "Pygments==2.18.0", + "PyJWT==2.9.0", + "python-dotenv==1.0.1", + "python-jose==3.3.0", + "python-multipart==0.0.9", + "python3-openid==3.2.0", + "pytz==2024.1", + "PyYAML==6.0.1", + "requests==2.32.3", + "requests-oauthlib==2.0.0", + "rich==13.7.1", + "rsa==4.9", + "shellingham==1.5.4", + "six==1.16.0", + "slack_bolt==1.20.0", + "slack_sdk==3.31.0", + "sniffio==1.3.1", + "social-auth-core==4.5.4", + "starlette==0.37.2", + "tomlkit==0.13.0", + "typer==0.12.3", + "typing-inspect==0.9.0", + "typing_extensions==4.12.2", + "tzlocal==5.2", + "urllib3==2.2.2", + "uvicorn[standard]==0.30.6", + "uvloop==0.19.0", + "watchfiles==0.22.0", + "websockets==12.0", + "yarl==1.9.4", +] + +[project.urls] +Homepage = "https://github.com/MichaByte/OnBoard-Live" + +[tool.hatch.build.targets.wheel] +packages = ["backend"] + +[project.scripts] +start = "main:main" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 598a42f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -fastapi -uvicorn[standard] -slack-bolt -requests -python-dotenv -prisma -fastapi-utils -httpx -apscheduler -fastapi-oauth2