From 3e7d169e4f6f254b1fa6a576ebd136cd16804aaf Mon Sep 17 00:00:00 2001 From: Kalyan Dutia Date: Thu, 25 Apr 2024 15:15:48 +0100 Subject: [PATCH 1/2] move unnecessary requirements for API to new dependency group --- poetry.lock | 5 +++-- pyproject.toml | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/poetry.lock b/poetry.lock index d8c113c..0c6d3d0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohttp" @@ -3720,6 +3720,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -5940,4 +5941,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "c24d3b128276150ed0619cb4c0a60ffbb441d9d9b0bab63d38bb4eaf040cd7fa" +content-hash = "a58afc5d8dac2e7e447bfa9b0b146a09f22c6a0d5f7d746f773b9c81bcd6cead" diff --git a/pyproject.toml b/pyproject.toml index 6cbdb82..4817c44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,27 @@ authors = ["CPR-tech-team "] python = ">=3.9,<3.12" uvicorn = {extras = ["standard"], version = "^0.20.0"} fastapi = "^0.92.0" +python-dotenv = "^0.20.0" +opensearch-py = "^2.2.0" + +[tool.poetry.dev-dependencies] +ruff = "^0.0.247" +black = "^22.1.0" +pyright = "^1.1.267" +pre-commit = "^2.17.0" +pytest = "^7.0.1" +pytest-dotenv = "^0.5.2" + +[tool.poetry.group.dev.dependencies] +nbmake = "^1.4.1" +httpx = "^0.23.3" + +[tool.poetry.group.extra.dependencies] cpr-data-access = {git = "https://github.com/climatepolicyradar/data-access.git", rev = "v0.2.9"} openpyxl = "^3.1.1" cloudpathlib = {version = "^0.13.0", extras = ["s3"]} requests = "^2.28.2" click = "^8.1.3" -opensearch-py = "^2.2.0" openmock = "^2.2.0" pycountry = "^22.3.5" wbgapi = "^1.0.12" @@ -30,19 +45,6 @@ rich = "^13.7.0" awscli = "^1.29.28" explorer = {git = "https://github.com/climatepolicyradar/explorer.git", rev = "96d2a244f4a0e3298a080f71edee6c4b96e5bd37"} -[tool.poetry.dev-dependencies] -ruff = "^0.0.247" -black = "^22.1.0" -pyright = "^1.1.267" -pre-commit = "^2.17.0" -python-dotenv = "^0.20.0" -pytest = "^7.0.1" -pytest-dotenv = "^0.5.2" - -[tool.poetry.group.dev.dependencies] -nbmake = "^1.4.1" -httpx = "^0.23.3" - [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From f3ee081132db54c58c02cf8f923d4f3a91832aa7 Mon Sep 17 00:00:00 2001 From: Kalyan Dutia Date: Thu, 25 Apr 2024 15:25:33 +0100 Subject: [PATCH 2/2] change group name; revert dockerfile changes --- Dockerfile | 4 ++-- poetry.lock | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36b68d6..2238dad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,8 @@ RUN pip install --no-cache "poetry>=1.2.2,<1.3.0" COPY poetry.lock pyproject.toml ./ # Install python dependencies -RUN poetry config virtualenvs.create false -RUN poetry install --with dev +RUN poetry export --with dev > requirements.txt +RUN pip install --no-cache -r requirements.txt # Copy files to image COPY data ./data diff --git a/poetry.lock b/poetry.lock index 0c6d3d0..80db9b5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5941,4 +5941,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "a58afc5d8dac2e7e447bfa9b0b146a09f22c6a0d5f7d746f773b9c81bcd6cead" +content-hash = "388f6bbb8c01ee036d59fcac6b673c2070a260e515cab2b2f09d03de764a171f" diff --git a/pyproject.toml b/pyproject.toml index 4817c44..ebde243 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ pytest-dotenv = "^0.5.2" nbmake = "^1.4.1" httpx = "^0.23.3" -[tool.poetry.group.extra.dependencies] +[tool.poetry.group.other.dependencies] cpr-data-access = {git = "https://github.com/climatepolicyradar/data-access.git", rev = "v0.2.9"} openpyxl = "^3.1.1" cloudpathlib = {version = "^0.13.0", extras = ["s3"]}