Skip to content

Commit

Permalink
fix: resolve dependency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 committed Oct 30, 2023
1 parent 8405295 commit 23b92f8
Show file tree
Hide file tree
Showing 7 changed files with 824 additions and 860 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0
3.9
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM tiangolo/uvicorn-gunicorn:python3.9

COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt --index-url https://pypi.org/simple --default-timeout=1000

COPY . .
CMD ["uvicorn", "telegram_bot.app:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "2"]
1,602 changes: 780 additions & 822 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ authors = ["Henry Zhu <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.9"
fastapi = "^0.63.0"
fastapi = "^0.79.0"
sqlalchemy = "^1.3.23"
requests = "^2.25.1"
aiogram = "^2.11.2"
uvicorn = "^0.13.3"
psycopg2 = "^2.9.5"
aioredis = "^1.3.1"
sentry-sdk = "^1.18.0"
loguru = "^0.5.3"
pytest = "^6.2.2"
requests-futures = "^1.0.0"
Expand All @@ -29,6 +27,8 @@ pytest-mock = "^3.7.0"
pytest-asyncio = "^0.18.3"
python-dotenv = "^0.20.0"
tenacity = "^8.2.2"
sentry-sdk = {extras = ["fastapi"], version = "^1.32.0"}
psycopg2 = "^2.9.9"

[tool.poetry.dev-dependencies]

Expand Down
59 changes: 29 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@
--extra-index-url https://pypi.doubanio.com/simple

aiocache==0.11.1 ; python_version >= "3.9" and python_version < "4.0"
aiogram==2.25.1 ; python_version >= "3.9" and python_version < "4.0"
aiohttp==3.8.4 ; python_version >= "3.9" and python_version < "4.0"
aiogram==2.25.2 ; python_version >= "3.9" and python_version < "4.0"
aiohttp==3.8.6 ; python_version >= "3.9" and python_version < "4.0"
aioredis==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
apscheduler==3.10.1 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
anyio==4.0.0 ; python_version >= "3.9" and python_version < "4.0"
apscheduler==3.10.4 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "4.0"
atomicwrites==1.4.1 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4.0"
babel==2.9.1 ; python_version >= "3.9" and python_version < "4.0"
certifi==2022.12.7 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.1.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2023.7.22 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.3.1 ; python_version >= "3.9" and python_version < "4.0"
click==7.1.2 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
decorator==5.1.1 ; python_version >= "3.9" and python_version < "4.0"
fastapi==0.63.0 ; python_version >= "3.9" and python_version < "4.0"
frozenlist==1.3.3 ; python_version >= "3.9" and python_version < "4.0"
greenlet==2.0.2 ; python_version >= "3.9" and platform_machine == "aarch64" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "ppc64le" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "x86_64" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "amd64" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "AMD64" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "win32" and python_version < "4.0" or python_version >= "3.9" and platform_machine == "WIN32" and python_version < "4.0"
exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11"
fastapi==0.79.1 ; python_version >= "3.9" and python_version < "4.0"
frozenlist==1.4.0 ; python_version >= "3.9" and python_version < "4.0"
greenlet==3.0.1 ; python_version >= "3.9" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.9" and python_version < "4.0"
hiredis==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
hiredis==2.2.3 ; python_version >= "3.9" and python_version < "4.0"
httpcore==0.12.3 ; python_version >= "3.9" and python_version < "4.0"
httpx==0.17.1 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "4.0"
loguru==0.5.3 ; python_version >= "3.9" and python_version < "4.0"
magic-filter==1.0.9 ; python_version >= "3.9" and python_version < "4.0"
msgpack==1.0.5 ; python_version >= "3.9" and python_version < "4.0"
magic-filter==1.0.12 ; python_version >= "3.9" and python_version < "4.0"
msgpack==1.0.7 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
packaging==23.1 ; python_version >= "3.9" and python_version < "4.0"
pluggy==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
psycopg2==2.9.6 ; python_version >= "3.9" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.9" and python_version < "4.0"
pluggy==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
py==1.11.0 ; python_version >= "3.9" and python_version < "4.0"
pydantic==1.10.7 ; python_version >= "3.9" and python_version < "4.0"
pydantic==1.10.13 ; python_version >= "3.9" and python_version < "4.0"
pytest-asyncio==0.18.3 ; python_version >= "3.9" and python_version < "4.0"
pytest-mock==3.10.0 ; python_version >= "3.9" and python_version < "4.0"
pytest-mock==3.12.0 ; python_version >= "3.9" and python_version < "4.0"
pytest==6.2.5 ; python_version >= "3.9" and python_version < "4.0"
python-dotenv==0.20.0 ; python_version >= "3.9" and python_version < "4.0"
pytz-deprecation-shim==0.1.0.post0 ; python_version >= "3.9" and python_version < "4.0"
pytz==2023.3 ; python_version >= "3.9" and python_version < "4.0"
pytz==2023.3.post1 ; python_version >= "3.9" and python_version < "4.0"
redis==3.5.3 ; python_version >= "3.9" and python_version < "4.0"
requests-futures==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
requests==2.29.0 ; python_version >= "3.9" and python_version < "4.0"
requests-futures==1.0.1 ; python_version >= "3.9" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0"
retry==0.9.2 ; python_version >= "3.9" and python_version < "4.0"
rfc3986[idna2008]==1.5.0 ; python_version >= "3.9" and python_version < "4.0"
sentry-sdk==1.21.1 ; python_version >= "3.9" and python_version < "4.0"
setuptools==67.7.2 ; python_version >= "3.9" and python_version < "4.0"
sentry-sdk[fastapi]==1.32.0 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
sqlalchemy==1.4.47 ; python_version >= "3.9" and python_version < "4.0"
starlette==0.13.6 ; python_version >= "3.9" and python_version < "4.0"
sqlalchemy==1.4.50 ; python_version >= "3.9" and python_version < "4.0"
starlette==0.19.1 ; python_version >= "3.9" and python_version < "4.0"
syncer==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
tenacity==8.2.2 ; python_version >= "3.9" and python_version < "4.0"
tenacity==8.2.3 ; python_version >= "3.9" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.5.0 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0"
tzlocal==4.3 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.8.0 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows"
tzlocal==5.2 ; python_version >= "3.9" and python_version < "4.0"
ujson==4.3.0 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.15 ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.0.7 ; python_version >= "3.9" and python_version < "4.0"
uvicorn==0.13.4 ; python_version >= "3.9" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
yarl==1.9.2 ; python_version >= "3.9" and python_version < "4.0"
8 changes: 5 additions & 3 deletions telegram_bot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ async def startup_event():

# sentry middleware
if settings.SENTRY_URL:
logger.info("start sentry...")
sentry_sdk.init(
dsn=settings.SENTRY_URL,
environment=settings.ENV,
# To set a uniform sample rate
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)
app = SentryAsgiMiddleware(app)
Expand Down
5 changes: 5 additions & 0 deletions telegram_bot/controllers/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ async def config():
return "OK"


@router.get("/sentry")
async def test_sentry():
return 1 / 0


@router.get("/users")
async def users():
with get_db_session() as db:
Expand Down

0 comments on commit 23b92f8

Please sign in to comment.