From ea0746103c29829f3f73bfaa1de3cccb55bcd291 Mon Sep 17 00:00:00 2001 From: Manuel Raimann Date: Thu, 31 Oct 2024 16:09:51 +0100 Subject: [PATCH] Move to standalone project --- .editorconfig | 16 + .github/workflows/docker-image.yaml | 47 ++ .github/workflows/pre-commit.yaml | 16 + .gitignore | 527 ++++++++++++++++++ .pre-commit-config.yaml | 68 +++ README.md | 1 + deadlock_analytics_api/main.py | 3 +- .../rate_limiter/limiter.py | 7 +- deadlock_analytics_api/routers/internal.py | 5 +- deadlock_analytics_api/routers/v1.py | 13 +- deadlock_analytics_api/routers/v2.py | 9 +- deadlock_analytics_api/salt_scraper.py | 1 + deadlock_analytics_api/utils.py | 3 +- docker-compose.yaml | 13 + poetry.lock | 34 +- pyproject.toml | 6 +- requirements.txt | 8 +- 17 files changed, 736 insertions(+), 41 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/docker-image.yaml create mode 100644 .github/workflows/pre-commit.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 README.md create mode 100644 docker-compose.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e0fb07f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false + +[*.{json,yaml,yml}] +indent_size = 2 diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml new file mode 100644 index 0000000..8e0d57f --- /dev/null +++ b/.github/workflows/docker-image.yaml @@ -0,0 +1,47 @@ +name: docker-image + +on: + workflow_dispatch: + push: + branches: + - 'master' + +permissions: + contents: read + packages: write + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push Compose + uses: docker/build-push-action@v6 + with: + push: true + tags: ghcr.io/${{ github.repository }}:latest + - name: Create Sentry release + uses: getsentry/action-release@v1 + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + with: + environment: production diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..d6f0252 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,16 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: pre-commit/action@v3.0.1 diff --git a/.gitignore b/.gitignore index 7e369eb..1a3c60f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,529 @@ api_keys.txt internal_api_keys.txt +.env +# Created by https://www.toptal.com/developers/gitignore/api/jetbrains+all,visualstudiocode,vim,visualstudio,rust +# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains+all,visualstudiocode,vim,visualstudio,rust + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +*.code-workspace + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/jetbrains+all,visualstudiocode,vim,visualstudio,rust diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..26db8ba --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,68 @@ +repos: + # Hooks that modify code +- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.3 + hooks: + - id: yamlfmt + args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '92', --implicit_start, --preserve-quotes] +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: fix-byte-order-marker + - id: end-of-file-fixer + - id: trailing-whitespace + - id: mixed-line-ending + - id: pretty-format-json + args: [--autofix] +- repo: https://github.com/asottile/pyupgrade + rev: v3.19.0 + hooks: + - id: pyupgrade + args: [--py313-plus] +- repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake +- repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--profile, black, --filter-files] +- repo: https://github.com/ambv/black + rev: 24.10.0 + hooks: + - id: black + + # Hooks for validation +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-merge-conflict + - id: check-case-conflict + - id: check-json + - id: check-toml + - id: check-yaml + - id: check-ast + - id: debug-statements +- repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: 3.0.3 + hooks: + - id: editorconfig-checker + alias: ec +- repo: local + hooks: + - id: hadolint-docker + name: Lint Dockerfiles + description: Runs hadolint Docker image to lint Dockerfiles + language: docker_image + types: ["dockerfile"] + files: '(^Dockerfile$)|(\.Dockerfile$)' + entry: ghcr.io/hadolint/hadolint hadolint --ignore DL3006 --ignore DL3008 --ignore DL3013 +- repo: https://github.com/python-poetry/poetry + rev: '1.8.0' + hooks: + - id: poetry-check + - id: poetry-lock + - id: poetry-export + args: ["-f", "requirements.txt", "--without-hashes"] + - id: poetry-install diff --git a/README.md b/README.md new file mode 100644 index 0000000..16a4552 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Deadlock Analytics API diff --git a/deadlock_analytics_api/main.py b/deadlock_analytics_api/main.py index ff20361..82fa984 100644 --- a/deadlock_analytics_api/main.py +++ b/deadlock_analytics_api/main.py @@ -1,13 +1,14 @@ import logging import os -from deadlock_analytics_api.routers import internal, v1, v2 from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from prometheus_fastapi_instrumentator import Instrumentator from starlette.middleware.gzip import GZipMiddleware from starlette.responses import FileResponse, RedirectResponse +from deadlock_analytics_api.routers import internal, v1, v2 + logging.basicConfig(level=os.environ.get("LOGLEVEL", "DEBUG")) if "SENTRY_DSN" in os.environ: diff --git a/deadlock_analytics_api/rate_limiter/limiter.py b/deadlock_analytics_api/rate_limiter/limiter.py index 8cced16..fe4f66f 100644 --- a/deadlock_analytics_api/rate_limiter/limiter.py +++ b/deadlock_analytics_api/rate_limiter/limiter.py @@ -2,13 +2,14 @@ import time from cachetools.func import ttl_cache -from deadlock_analytics_api import utils -from deadlock_analytics_api.globs import ENFORCE_RATE_LIMITS, postgres_conn, redis_conn -from deadlock_analytics_api.rate_limiter.models import RateLimit, RateLimitStatus from fastapi import HTTPException from starlette.requests import Request from starlette.responses import Response +from deadlock_analytics_api import utils +from deadlock_analytics_api.globs import ENFORCE_RATE_LIMITS, postgres_conn, redis_conn +from deadlock_analytics_api.rate_limiter.models import RateLimit, RateLimitStatus + LOGGER = logging.getLogger(__name__) MAX_TTL_SECONDS = 60 * 60 # 1 hour diff --git a/deadlock_analytics_api/routers/internal.py b/deadlock_analytics_api/routers/internal.py index 53d0e93..0627a06 100644 --- a/deadlock_analytics_api/routers/internal.py +++ b/deadlock_analytics_api/routers/internal.py @@ -1,13 +1,14 @@ import os -from deadlock_analytics_api import utils -from deadlock_analytics_api.globs import CH_POOL, s3_conn from fastapi import APIRouter, Depends from fastapi.openapi.models import APIKey from pydantic import BaseModel, Field from starlette.exceptions import HTTPException from starlette.responses import JSONResponse, Response, StreamingResponse +from deadlock_analytics_api import utils +from deadlock_analytics_api.globs import CH_POOL, s3_conn + router = APIRouter(prefix="/v1", tags=["Internal API-Key required"]) diff --git a/deadlock_analytics_api/routers/v1.py b/deadlock_analytics_api/routers/v1.py index 93723fe..ad33532 100644 --- a/deadlock_analytics_api/routers/v1.py +++ b/deadlock_analytics_api/routers/v1.py @@ -3,6 +3,13 @@ from typing import Annotated, Literal from clickhouse_driver import Client +from fastapi import APIRouter, Depends, Path, Query +from fastapi.openapi.models import APIKey +from pydantic import BaseModel, Field, computed_field +from starlette.exceptions import HTTPException +from starlette.requests import Request +from starlette.responses import Response, StreamingResponse + from deadlock_analytics_api import utils from deadlock_analytics_api.globs import CH_POOL from deadlock_analytics_api.models.active_match import ( @@ -13,12 +20,6 @@ from deadlock_analytics_api.models.match_metadata import MatchMetadata from deadlock_analytics_api.rate_limiter import limiter from deadlock_analytics_api.rate_limiter.models import RateLimit -from fastapi import APIRouter, Depends, Path, Query -from fastapi.openapi.models import APIKey -from pydantic import BaseModel, Field, computed_field -from starlette.exceptions import HTTPException -from starlette.requests import Request -from starlette.responses import Response, StreamingResponse router = APIRouter(prefix="/v1", tags=["V1"]) no_tagged_router = APIRouter(prefix="/v1") diff --git a/deadlock_analytics_api/routers/v2.py b/deadlock_analytics_api/routers/v2.py index e7662e5..1fac063 100644 --- a/deadlock_analytics_api/routers/v2.py +++ b/deadlock_analytics_api/routers/v2.py @@ -1,15 +1,16 @@ from datetime import datetime from typing import Annotated, Literal -from deadlock_analytics_api.globs import CH_POOL -from deadlock_analytics_api.rate_limiter import limiter -from deadlock_analytics_api.rate_limiter.models import RateLimit -from deadlock_analytics_api.routers.v1 import HeroWinLossStat from fastapi import APIRouter, HTTPException, Path, Query from pydantic import BaseModel, Field, computed_field from starlette.requests import Request from starlette.responses import Response +from deadlock_analytics_api.globs import CH_POOL +from deadlock_analytics_api.rate_limiter import limiter +from deadlock_analytics_api.rate_limiter.models import RateLimit +from deadlock_analytics_api.routers.v1 import HeroWinLossStat + router = APIRouter(prefix="/v2", tags=["V2"]) diff --git a/deadlock_analytics_api/salt_scraper.py b/deadlock_analytics_api/salt_scraper.py index a29b49b..579ac25 100644 --- a/deadlock_analytics_api/salt_scraper.py +++ b/deadlock_analytics_api/salt_scraper.py @@ -2,6 +2,7 @@ import os import pika + from deadlock_analytics_api.globs import CH_POOL RMQ_HOST = os.environ.get("RMQ_HOST", "154.53.45.225") diff --git a/deadlock_analytics_api/utils.py b/deadlock_analytics_api/utils.py index c53c118..f7ed678 100644 --- a/deadlock_analytics_api/utils.py +++ b/deadlock_analytics_api/utils.py @@ -2,13 +2,14 @@ import uuid from cachetools.func import ttl_cache -from deadlock_analytics_api.globs import postgres_conn from fastapi import HTTPException, Security from fastapi.openapi.models import APIKey, APIKeyIn from fastapi.security.api_key import APIKeyBase from starlette.requests import Request from starlette.status import HTTP_403_FORBIDDEN +from deadlock_analytics_api.globs import postgres_conn + LOGGER = logging.getLogger(__name__) diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c232efe --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +services: + api: + build: . + restart: always + ports: + - "8080:8080" + env_file: .env + networks: + - database + +networks: + database: + external: true diff --git a/poetry.lock b/poetry.lock index 72baf1c..6f71eb3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -77,17 +77,17 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "boto3" -version = "1.35.51" +version = "1.35.52" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.51-py3-none-any.whl", hash = "sha256:c922f6a18958af9d8af0489d6d8503b517029d8159b26aa4859a8294561c72e9"}, - {file = "boto3-1.35.51.tar.gz", hash = "sha256:a57c6c7012ecb40c43e565a6f7a891f39efa990ff933eab63cd456f7501c2731"}, + {file = "boto3-1.35.52-py3-none-any.whl", hash = "sha256:ec0e797441db56af63b1150bba49f114b0f885f5d76c3b6dc18075f73030d2bb"}, + {file = "boto3-1.35.52.tar.gz", hash = "sha256:68299da8ab2bb37cc843d61b9f4c1c9367438406cfd65a8f593afc7b3bfe226d"}, ] [package.dependencies] -botocore = ">=1.35.51,<1.36.0" +botocore = ">=1.35.52,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -96,13 +96,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.51" +version = "1.35.52" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.51-py3-none-any.whl", hash = "sha256:4d65b00111bd12b98e9f920ecab602cf619cc6a6d0be6e5dd53f517e4b92901c"}, - {file = "botocore-1.35.51.tar.gz", hash = "sha256:a9b3d1da76b3e896ad74605c01d88f596324a3337393d4bfbfa0d6c35822ca9c"}, + {file = "botocore-1.35.52-py3-none-any.whl", hash = "sha256:cdbb5e43c9c3a977763e2a10d3b8b9c405d51279f9fcfd4ca4800763b22acba5"}, + {file = "botocore-1.35.52.tar.gz", hash = "sha256:1fe7485ea13d638b089103addd818c12984ff1e4d208de15f180b1e25ad944c5"}, ] [package.dependencies] @@ -298,13 +298,13 @@ files = [ [[package]] name = "fastapi" -version = "0.115.3" +version = "0.115.4" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.3-py3-none-any.whl", hash = "sha256:8035e8f9a2b0aa89cea03b6c77721178ed5358e1aea4cd8570d9466895c0638c"}, - {file = "fastapi-0.115.3.tar.gz", hash = "sha256:c091c6a35599c036d676fa24bd4a6e19fa30058d93d950216cdc672881f6f7db"}, + {file = "fastapi-0.115.4-py3-none-any.whl", hash = "sha256:0b504a063ffb3cf96a5e27dc1bc32c80ca743a2528574f9cdc77daa2d31b4742"}, + {file = "fastapi-0.115.4.tar.gz", hash = "sha256:db653475586b091cb8b2fec2ac54a680ac6a158e07406e1abae31679e8826349"}, ] [package.dependencies] @@ -886,13 +886,13 @@ files = [ [[package]] name = "starlette" -version = "0.41.0" +version = "0.41.2" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.41.0-py3-none-any.whl", hash = "sha256:a0193a3c413ebc9c78bff1c3546a45bb8c8bcb4a84cae8747d650a65bd37210a"}, - {file = "starlette-0.41.0.tar.gz", hash = "sha256:39cbd8768b107d68bfe1ff1672b38a2c38b49777de46d2a592841d58e3bf7c2a"}, + {file = "starlette-0.41.2-py3-none-any.whl", hash = "sha256:fbc189474b4731cf30fcef52f18a8d070e3f3b46c6a04c97579e85e6ffca942d"}, + {file = "starlette-0.41.2.tar.gz", hash = "sha256:9834fd799d1a87fd346deb76158668cfa0b0d56f85caefe8268e2d97c3468b62"}, ] [package.dependencies] @@ -903,13 +903,13 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 [[package]] name = "tqdm" -version = "4.66.5" +version = "4.66.6" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" files = [ - {file = "tqdm-4.66.5-py3-none-any.whl", hash = "sha256:90279a3770753eafc9194a0364852159802111925aa30eb3f9d85b0e805ac7cd"}, - {file = "tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad"}, + {file = "tqdm-4.66.6-py3-none-any.whl", hash = "sha256:223e8b5359c2efc4b30555531f09e9f2f3589bcd7fdd389271191031b49b7a63"}, + {file = "tqdm-4.66.6.tar.gz", hash = "sha256:4bdd694238bef1485ce839d67967ab50af8f9272aab687c0d7702a01da0be090"}, ] [package.dependencies] @@ -1008,4 +1008,4 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "4efde6114b26fd8de1d15e24b042b8c9c0ae4ea22c683d4f108d655ab58d360c" +content-hash = "34ed583cf68075347d05fa1c83fe3f034e578238358b2b22928e092f0f72c022" diff --git a/pyproject.toml b/pyproject.toml index b740a3d..1e0d2d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "api" +name = "deadlock-analytics-api" version = "0.1.0" description = "" authors = ["Manuel Raimann "] @@ -17,14 +17,14 @@ uuid = "^1.30" cachetools = "^5.5.0" pika = "^1.3.2" sentry-sdk = {version = "^2.17.0", extras = ["fastapi"]} -boto3 = "^1.35.51" +boto3 = "^1.35.52" [tool.poetry.group.dev.dependencies] black = "^24.10.0" [tool.poetry.group.mmr.dependencies] -tqdm = "^4.66.5" +tqdm = "^4.66.6" [build-system] requires = ["poetry-core"] diff --git a/requirements.txt b/requirements.txt index 6b10871..2333ab1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ annotated-types==0.7.0 ; python_version >= "3.12" and python_version < "4.0" anyio==4.6.2.post1 ; python_version >= "3.12" and python_version < "4.0" -boto3==1.35.51 ; python_version >= "3.12" and python_version < "4.0" -botocore==1.35.51 ; python_version >= "3.12" and python_version < "4.0" +boto3==1.35.52 ; python_version >= "3.12" and python_version < "4.0" +botocore==1.35.52 ; python_version >= "3.12" and python_version < "4.0" cachetools==5.5.0 ; python_version >= "3.12" and python_version < "4.0" certifi==2024.8.30 ; python_version >= "3.12" and python_version < "4.0" click==8.1.7 ; python_version >= "3.12" and python_version < "4.0" clickhouse-driver==0.2.7 ; python_version >= "3.12" and python_version < "4" clickhouse-pool==0.6.0 ; python_version >= "3.12" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.12" and python_version < "4.0" and platform_system == "Windows" -fastapi==0.115.3 ; python_version >= "3.12" and python_version < "4.0" +fastapi==0.115.4 ; python_version >= "3.12" and python_version < "4.0" h11==0.14.0 ; python_version >= "3.12" and python_version < "4.0" hiredis==3.0.0 ; python_version >= "3.12" and python_version < "4.0" idna==3.10 ; python_version >= "3.12" and python_version < "4.0" @@ -26,7 +26,7 @@ s3transfer==0.10.3 ; python_version >= "3.12" and python_version < "4.0" sentry-sdk[fastapi]==2.17.0 ; python_version >= "3.12" and python_version < "4.0" six==1.16.0 ; python_version >= "3.12" and python_version < "4.0" sniffio==1.3.1 ; python_version >= "3.12" and python_version < "4.0" -starlette==0.41.0 ; python_version >= "3.12" and python_version < "4.0" +starlette==0.41.2 ; python_version >= "3.12" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.12" and python_version < "4.0" tzdata==2024.2 ; python_version >= "3.12" and python_version < "4" and platform_system == "Windows" tzlocal==5.2 ; python_version >= "3.12" and python_version < "4"