Skip to content

Commit

Permalink
fix: Revert "chore: resolve deprecation warning and update requiremen…
Browse files Browse the repository at this point in the history
…ts (#7275)" (#7350)
  • Loading branch information
nayib-jose-gloria authored Oct 3, 2024
1 parent a12556f commit d3eb0a4
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN python3 -m pip install --upgrade pip setuptools
# TODO: Determine if cmake is really needed for ddtrace
# see ticket: https://github.com/chanzuckerberg/single-cell-data-portal/issues/5821
RUN python3 -m pip install cmake
RUN python3 -m pip install -r requirements.txt -r ./common/server/requirements.txt
RUN python3 -m pip install -r requirements.txt
RUN if [ "$INSTALL_DEV" = "true" ]; then python3 -m pip install -r requirements-dev.txt; fi
# Install awscli to download wmg snapshot to the local disk
RUN python3 -m pip install awscli
Expand Down
4 changes: 2 additions & 2 deletions backend/api_server/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.17.14/swagger-ui.css"
integrity="sha512-MvYROlKG3cDBPskMQgPmkNgZh85LIf68y7SZ34TIppaIHQz1M/3S/yYqzIfufdKDJjzB9Qu1BV63SZjimJkPvw=="
href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.0.13/swagger-ui.css"
integrity="sha256-Z7Z2kffooC4H3U4Myviypq5dO2IIGkmu7VRtd1YqNn8="
crossorigin="anonymous"
/>
<style>
Expand Down
2 changes: 1 addition & 1 deletion backend/common/auth0_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def session(self):
total=3,
backoff_factor=1,
status_forcelist=self.config.retry_status_forcelist,
allowed_methods=["POST", "HEAD", "GET", "PUT", "DELETE", "OPTIONS"],
method_whitelist=["POST", "HEAD", "GET", "PUT", "DELETE", "OPTIONS"],
)
session.mount("https://", HTTPAdapter(max_retries=retry_config))

Expand Down
8 changes: 4 additions & 4 deletions backend/common/census_cube/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ def depluralize(x):
return x[:-1] if x[-1] == "s" else x


def setup_retry_session(retries=3, backoff_factor=2, status_forcelist=(500, 502, 503, 504), allowed_methods=None):
def setup_retry_session(retries=3, backoff_factor=2, status_forcelist=(500, 502, 503, 504), method_whitelist=None):
session = requests.Session()

if allowed_methods is None:
allowed_methods = {"GET"}
if method_whitelist is None:
method_whitelist = {"GET"}

retry = Retry(
total=retries,
backoff_factor=backoff_factor,
status_forcelist=status_forcelist,
allowed_methods=allowed_methods,
allowed_methods=method_whitelist,
)

adapter = HTTPAdapter(max_retries=retry)
Expand Down
6 changes: 2 additions & 4 deletions backend/common/server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ def configure_flask_app(flask_app):
SESSION_COOKIE_SECURE=require_secure_cookies,
SESSION_COOKIE_HTTPONLY=True,
SESSION_COOKIE_SAMESITE="Lax",
JSON_SORT_KEYS=True,
)
flask_app.json_encoder = CustomJSONEncoder
flask_app.json.sort_keys = True

return flask_app


Expand Down Expand Up @@ -142,8 +141,7 @@ def create_api_app(api_paths_and_spec_files, **server_args):
based on the deployment stage.
Args:
api_paths_and_spec_files (list of tuples): A list where each tuple contains a base path and a specification
file.
api_paths_and_spec_files (list of tuples): A list where each tuple contains a base path and a specification file.
**server_args: Additional arguments to be passed to the FlaskApp.
Returns:
Expand Down
3 changes: 2 additions & 1 deletion backend/portal/api/app/v1/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import requests
from authlib.integrations.flask_client import OAuth
from authlib.integrations.flask_client.remote_app import FlaskRemoteApp
from flask import Response, after_this_request, current_app, g, jsonify, make_response, redirect, request, session

from backend.common.authorizer import assert_authorized_token, get_userinfo_from_auth0
Expand All @@ -19,7 +20,7 @@
oauth_client = None


def get_oauth_client(config: CorporaAuthConfig) -> OAuth:
def get_oauth_client(config: CorporaAuthConfig) -> FlaskRemoteApp:
"""Create an oauth client on the first invocation, then return oauth client for subsequent calls.
:param config: An object containing the auth configuration.
Expand Down
6 changes: 3 additions & 3 deletions python_dependencies/backend/common/server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
connexion[swagger-ui]~=2.14.2
gunicorn[gevent]~=22.0.0
furl~=2.1.2
Flask-Cors~=4.0.1
Flask-Cors~=3.0.6
flask-server-timing~=0.1.2
ddtrace~=2.9.2
ddtrace~=2.8.5
python-json-logger
boto3~=1.34.114
boto3~=1.34.114
17 changes: 13 additions & 4 deletions python_dependencies/backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
alembic==1.*
Authlib==1.3.1
Authlib==0.14.3
boto3>=1.11.17
botocore>=1.14.17
dataclasses-json==0.6.7
connexion[swagger-ui]==2.14.2
dataclasses-json==0.6.6
cellxgene-ontology-guide<2
# TODO: Check if this is really essential for APM tracing
# see ticket: https://github.com/chanzuckerberg/single-cell-data-portal/issues/5821
datadog==0.49.1
Flask # verison determined by connexion
psutil>=6, <7
ddtrace>=2.1.4, <3
Flask>=2.2.3, <3
Flask-Cors>=3.0.6
flask-server-timing>=0.1.2
gunicorn[gevent]==22.0.0
matplotlib>=3.6.3, <3.7 # 3.7.0 isn't compatible with scanpy: https://github.com/scverse/scanpy/issues/2411
psutil>=5.9.5, <6
psycopg2-binary==2.*
pydantic>=1.10.7, <2
python-jose[cryptography]>=3.1.0
python-json-logger
requests>=2.22.0
rsa>=4.7 # not directly required, pinned by Snyk to avoid a vulnerability
setproctitle>1.3,<2 # for gunicorn integration with datadog
SQLAlchemy-Utils
SQLAlchemy==2.*
tenacity
tiledb
Werkzeug==2.2.3

0 comments on commit d3eb0a4

Please sign in to comment.