From 73315ea2e065ae89c995ed52ecf80b6abbe9e58f Mon Sep 17 00:00:00 2001 From: Kalyan Dutia Date: Mon, 4 Nov 2024 11:54:54 +0000 Subject: [PATCH] update sdk dependency to run tests --- .env.old | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ poetry.lock | 15 ++++++---- pyproject.toml | 8 +++++- 3 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 .env.old diff --git a/.env.old b/.env.old new file mode 100644 index 00000000..b6743f60 --- /dev/null +++ b/.env.old @@ -0,0 +1,77 @@ +# Backend Postgres connection settings +BACKEND_POSTGRES_USER=navigator +BACKEND_POSTGRES_PASSWORD=password +BACKEND_DATABASE_URL=postgresql://${BACKEND_POSTGRES_USER}:${BACKEND_POSTGRES_PASSWORD}@backend_db:5432/${BACKEND_POSTGRES_USER} + +# Fastapi settings +ENABLE_API_DOCS=False + +# Opensearch connection settings +OPENSEARCH_USER=admin +OPENSEARCH_PASSWORD=admin +OPENSEARCH_URL=http://opensearch-node1:9200 +OPENSEARCH_INDEX_PREFIX=navigator +OPENSEARCH_REQUEST_TIMEOUT=30 +OPENSEARCH_USE_SSL=False +OPENSEARCH_VERIFY_CERTS=False +OPENSEARCH_SSL_WARNINGS=False +OPENSEARCH_INDEX_EMBEDDING_DIM=768 + +# Opensearch query/index settings - optional +# Disabled as not used in deployment. Defaults are set within the application. +# OPENSEARCH_INDEX_INNER_PRODUCT_THRESHOLD=70.0 +# OPENSEARCH_INDEX_MAX_DOC_COUNT=100 +# OPENSEARCH_INDEX_MAX_PASSAGES_PER_DOC=10 +# OPENSEARCH_INDEX_KNN_K_VALUE=10000 +# OPENSEARCH_INDEX_N_PASSAGES_TO_SAMPLE_PER_SHARD=5000 +# OPENSEARCH_INDEX_NAME_BOOST=100 +# OPENSEARCH_INDEX_DESCRIPTION_BOOST=40 +# OPENSEARCH_INDEX_EMBEDDED_TEXT_BOOST=50 +# OPENSEARCH_JIT_MAX_DOC_COUNT=20 +# OPENSEARCH_INDEX_NAME_KEY=for_search_action_name +# OPENSEARCH_INDEX_DESCRIPTION_KEY=for_search_action_description +# OPENSEARCH_INDEX_DESCRIPTION_EMBEDDING_KEY=action_description_embedding +# OPENSEARCH_INDEX_INDEX_KEY=action_name_and_id +# OPENSEARCH_INDEX_TEXT_BLOCK_KEY=text_block_id +# OPENSEARCH_INDEX_ENCODER=msmarco-distilbert-dot-v5 + +# Backend Superuser account information for admin +SUPERUSER_EMAIL=user@navigator.com +SUPERUSER_PASSWORD=password + +# AWS credentials +AWS_ACCESS_KEY_ID=ACCESS_KEY +AWS_SECRET_ACCESS_KEY=SECRET_KEY +AWS_REGION=eu-west-1 + +# Frontend +NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1 +NEXT_PUBLIC_LOGIN_API_URL=http://localhost:8000/api/tokens +PUBLIC_APP_URL=http://localhost:3000 +NEXT_PUBLIC_ADOBE_API_KEY=apikey + +# Backend API host +API_HOST=http://backend:8888 + +# app secret +SECRET_KEY=super_secret +PASSWORD_RESET_TOKEN_EXPIRY_MINUTES=30 + +# sendgrid +SENDGRID_ENABLED=False +SENDGRID_API_KEY=SENDGRID_KEY +SENDGRID_FROM_EMAIL=example@example.org + +DOCUMENT_BUCKET=cpr-document-queue + +# CDN URL +CDN_URL=https://cdn.climatepolicyradar.org +CDN_DOMAIN=cdn.climatepolicyradar.org + +# Pipeline settings +PIPELINE_BUCKET="a-bucket-for-testing-cpr-endpoints" + +# Default frontend config vars +THEME=cpr +HOSTNAME=http://localhost:3000 +ROBOTS=false diff --git a/poetry.lock b/poetry.lock index b2ea3a1a..7c9506ea 100644 --- a/poetry.lock +++ b/poetry.lock @@ -702,13 +702,13 @@ files = [ [[package]] name = "cpr-sdk" -version = "1.9.1" +version = "1.0.1730719241" description = "" optional = false -python-versions = "<4.0,>=3.10" +python-versions = ">=3.10,<4.0" files = [ - {file = "cpr_sdk-1.9.1-py3-none-any.whl", hash = "sha256:f5ac11da4ccc09fc75ebc9438f4ca46c68191e2c8b9d42d485f2ca734a799a7e"}, - {file = "cpr_sdk-1.9.1.tar.gz", hash = "sha256:22ec7385829b96be5939df13e0336ca9e1a72cbd5ca669ea7dba9b210a153415"}, + {file = "cpr_sdk-1.0.1730719241-py3-none-any.whl", hash = "sha256:95e4353ab0153c1b42ad3ff3be8a0fffa38b1950364ae10c9cd98d7351e04ee4"}, + {file = "cpr_sdk-1.0.1730719241.tar.gz", hash = "sha256:559c22e34c2a8b2d6c08141859abbce22176e3af0b233ffe40807fa1ae8b8655"}, ] [package.dependencies] @@ -730,6 +730,11 @@ tqdm = ">=4.66.5,<5.0.0" spacy = ["spacy (>=3.5.1,<4.0.0)"] vespa = ["pyvespa (>=0.45.0,<0.46.0)", "pyyaml (>=6.0.2,<7.0.0)"] +[package.source] +type = "legacy" +url = "https://test.pypi.org/simple" +reference = "test_pypi" + [[package]] name = "crashtest" version = "0.4.1" @@ -4250,4 +4255,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "bc6587895ac9daa65512c4e6dfcc47ea3fb8fb0e3cb8ac420308a596def410ea" +content-hash = "3b52dab7a81911481bf6f320d7a9818f1e21e91921c318b332822dd33bb02801" diff --git a/pyproject.toml b/pyproject.toml index 2ff65ae6..74208903 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ python = "^3.10" Authlib = "^0.15.5" bcrypt = "^3.2.0" boto3 = "^1.26" -cpr_sdk = { version = "1.9.1", extras = ["vespa"] } +cpr_sdk = {version = "1.0.1730719241", extras = ["vespa"], source = "test_pypi"} fastapi = "^0.104.1" fastapi-health = "^0.4.0" fastapi-pagination = { extras = ["sqlalchemy"], version = "^0.12.19" } @@ -51,6 +51,12 @@ types-SQLAlchemy = "^1.4.31" [tool.poetry.group.dev.dependencies] surrogate = "^0.1" + +[[tool.poetry.source]] +name = "test_pypi" +url = "https://test.pypi.org/simple/" +priority = "supplemental" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"