From 4ac013339e71ee1f112ee45af236e04561aa7a98 Mon Sep 17 00:00:00 2001 From: Ahmed Nassar Date: Mon, 16 Dec 2024 04:26:45 +0200 Subject: [PATCH] feat: Update dependencies and configuration for Gunicorn and Django; remove test step from workflow --- .github/workflows/django.yml | 4 -- poetry.lock | 75 ++++++++++++++++++++++++++++++++++-- pyproject.toml | 1 + render.yaml | 1 - requirements.txt | 6 ++- runtime.txt | 2 +- 6 files changed, 77 insertions(+), 12 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 6705f77..0d2b7ba 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -48,7 +48,3 @@ jobs: echo "Starting deployment to Render..." render deploy --service-name egypt-metro echo "Deployment complete!" - - - name: Run Tests - run: | - python manage.py test diff --git a/poetry.lock b/poetry.lock index 57cd70f..b3e649e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -146,13 +146,13 @@ tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "certifi" -version = "2024.8.30" +version = "2024.12.14" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, - {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, + {file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"}, + {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}, ] [[package]] @@ -294,6 +294,26 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "django" +version = "4.2.17" +description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." +optional = false +python-versions = ">=3.8" +files = [ + {file = "Django-4.2.17-py3-none-any.whl", hash = "sha256:3a93350214ba25f178d4045c0786c61573e7dbfa3c509b3551374f1e11ba8de0"}, + {file = "Django-4.2.17.tar.gz", hash = "sha256:6b56d834cc94c8b21a8f4e775064896be3b4a4ca387f2612d4406a5927cd2fdc"}, +] + +[package.dependencies] +asgiref = ">=3.6.0,<4" +sqlparse = ">=0.3.1" +tzdata = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +argon2 = ["argon2-cffi (>=19.1.0)"] +bcrypt = ["bcrypt"] + [[package]] name = "exceptiongroup" version = "1.2.2" @@ -329,6 +349,27 @@ dev = ["autoflake (>=1.4.0,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "graphene (>=2.1 doc = ["mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-markdownextradata-plugin (>=0.1.7,<0.3.0)", "mkdocs-material (>=7.1.9,<8.0.0)", "pyyaml (>=5.3.1,<6.0.0)", "typer-cli (>=0.0.12,<0.0.13)"] test = ["aiofiles (>=0.5.0,<0.8.0)", "async_exit_stack (>=1.0.1,<2.0.0)", "async_generator (>=1.10,<2.0.0)", "black (==21.9b0)", "databases[sqlite] (>=0.3.2,<0.6.0)", "email_validator (>=1.1.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "flask (>=1.1.2,<2.0.0)", "httpx (>=0.14.0,<0.19.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "orjson (>=3.2.1,<4.0.0)", "peewee (>=3.13.3,<4.0.0)", "pytest (>=6.2.4,<7.0.0)", "pytest-asyncio (>=0.14.0,<0.16.0)", "pytest-cov (>=2.12.0,<4.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "requests (>=2.24.0,<3.0.0)", "sqlalchemy (>=1.3.18,<1.5.0)", "types-dataclasses (==0.1.7)", "types-orjson (==3.6.0)", "types-ujson (==0.1.1)", "ujson (>=4.0.1,<5.0.0)"] +[[package]] +name = "gunicorn" +version = "23.0.0" +description = "WSGI HTTP Server for UNIX" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gunicorn-23.0.0-py3-none-any.whl", hash = "sha256:ec400d38950de4dfd418cff8328b2c8faed0edb0d517d3394e457c317908ca4d"}, + {file = "gunicorn-23.0.0.tar.gz", hash = "sha256:f014447a0101dc57e294f6c18ca6b40227a4c90e9bdb586042628030cba004ec"}, +] + +[package.dependencies] +packaging = "*" + +[package.extras] +eventlet = ["eventlet (>=0.24.1,!=0.36.0)"] +gevent = ["gevent (>=1.4.0)"] +setproctitle = ["setproctitle"] +testing = ["coverage", "eventlet", "gevent", "pytest", "pytest-cov"] +tornado = ["tornado (>=0.2)"] + [[package]] name = "h11" version = "0.12.0" @@ -614,6 +655,21 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] +[[package]] +name = "sqlparse" +version = "0.5.3" +description = "A non-validating SQL parser." +optional = false +python-versions = ">=3.8" +files = [ + {file = "sqlparse-0.5.3-py3-none-any.whl", hash = "sha256:cf2196ed3418f3ba5de6af7e82c694a9fbdbfecccdfc72e281548517081f16ca"}, + {file = "sqlparse-0.5.3.tar.gz", hash = "sha256:09f67787f56a0b16ecdbde1bfc7f5d9c3371ca683cfeaa8e6ff60b4807ec9272"}, +] + +[package.extras] +dev = ["build", "hatch"] +doc = ["sphinx"] + [[package]] name = "starlette" version = "0.14.2" @@ -650,6 +706,17 @@ files = [ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] +[[package]] +name = "tzdata" +version = "2024.2" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, + {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, +] + [[package]] name = "uvicorn" version = "0.15.0" @@ -672,4 +739,4 @@ standard = ["PyYAML (>=5.1)", "colorama (>=0.4)", "httptools (==0.2.*)", "python [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "fe89453fb9540998093cdf593ad701a6114e01f933dee4141ee9d7558be61be6" +content-hash = "1806733cd139d7a85595b6cc9314e9f9c630792022b029ae92168253a0411478" diff --git a/pyproject.toml b/pyproject.toml index 1d99633..1ddd49e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ pydantic = "^1.8.2" httpx = "^0.21.1" starlette = "^0.14.2" asyncpg = "^0.30.0" +gunicorn = "^23.0.0" pywin32 = { version = "306", optional = true, markers = "sys_platform == 'win32'" } [tool.poetry.dev-dependencies] diff --git a/render.yaml b/render.yaml index f622779..3162b4d 100644 --- a/render.yaml +++ b/render.yaml @@ -10,7 +10,6 @@ services: buildCommand: - apt-get update && apt-get install -y gcc libpq-dev python3-dev - pip install --upgrade pip - - pip install gunicorn - pip install -r requirements.txt - python manage.py collectstatic --noinput - python manage.py migrate --noinput diff --git a/requirements.txt b/requirements.txt index b85b752..2e4d0ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,19 +2,21 @@ anyio==3.7.1 ; python_version >= "3.9" and python_version < "4.0" asgiref==3.8.1 ; python_version >= "3.9" and python_version < "4.0" async-timeout==5.0.1 ; python_version >= "3.9" and python_version < "3.11.0" asyncpg==0.30.0 ; python_version >= "3.9" and python_version < "4.0" -certifi==2024.8.30 ; python_version >= "3.9" and python_version < "4.0" +certifi==2024.12.14 ; python_version >= "3.9" and python_version < "4.0" charset-normalizer==3.4.0 ; python_version >= "3.9" and python_version < "4.0" click==8.1.7 ; python_version >= "3.9" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows" exceptiongroup==1.2.2 ; python_version >= "3.9" and python_version < "3.11" fastapi==0.68.2 ; python_version >= "3.9" and python_version < "4.0" +gunicorn==23.0.0 ; python_version >= "3.9" and python_version < "4.0" # For production h11==0.12.0 ; python_version >= "3.9" and python_version < "4.0" httpcore==0.14.7 ; python_version >= "3.9" and python_version < "4.0" httpx==0.21.3 ; python_version >= "3.9" and python_version < "4.0" idna==3.10 ; python_version >= "3.9" and python_version < "4.0" +packaging==24.2 ; python_version >= "3.9" and python_version < "4.0" pydantic==1.10.19 ; python_version >= "3.9" and python_version < "4.0" rfc3986[idna2008]==1.5.0 ; python_version >= "3.9" and python_version < "4.0" sniffio==1.3.1 ; python_version >= "3.9" and python_version < "4.0" starlette==0.14.2 ; python_version >= "3.9" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "4.0" -uvicorn==0.15.0 ; python_version >= "3.9" and python_version < "4.0" +uvicorn==0.15.0 ; python_version >= "3.9" and python_version < "4.0" # For development diff --git a/runtime.txt b/runtime.txt index 425359e..815b82f 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.9.9 +python-3.9.18