From 9bf508d4af78cb37faccf0b33fc843a1bb00a844 Mon Sep 17 00:00:00 2001 From: Vincent LaGrassa Date: Fri, 25 Oct 2024 13:00:36 -0500 Subject: [PATCH 1/3] Update launch file to use 'debugpy' --- .vscode/launch.json | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f0a5ea62..0b079796 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,7 @@ { "name": "Run Site-v2 (requires a local Postgres instance or cloud-sql-proxy)", - "type": "python", + "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}/src/modules/site-v2", "console": "integratedTerminal", @@ -44,7 +44,7 @@ }, { "name": "Run Site (requires a local Postgres instance or cloud-sql-proxy)", - "type": "python", + "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}/src/modules/site", "console": "integratedTerminal", @@ -79,7 +79,7 @@ }, { "name": "Script: Create NemaScan Task", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/site/scripts/create-nemascan-mapping-task.py", "cwd": "${workspaceFolder}/src/modules/site", @@ -91,7 +91,7 @@ }, { "name": "Run API pipeline server", - "type": "python", + "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}/src/modules/api/pipeline-task", "console": "integratedTerminal", @@ -121,7 +121,7 @@ }, { "name": "TEST img_thumb_gen", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/img_thumb_gen/test.py", "console": "integratedTerminal", @@ -135,7 +135,7 @@ }, { "name": "Run DROP_AND_POPULATE_STRAINS", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -158,7 +158,7 @@ }, { "name": "Run DROP_AND_POPULATE_WORMBASE_GENES (WS283)", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -181,7 +181,7 @@ }, { "name": "Run DROP_AND_POPULATE_STRAIN_ANNOTATED_VARIANTS", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -204,7 +204,7 @@ }, { "name": "Run DROP_AND_POPULATE_PHENOTYPE_METADATA", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -227,7 +227,7 @@ }, { "name": "Run DROP_AND_POPULATE_PHENOTYPE_DB", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -250,7 +250,7 @@ }, { "name": "Run DROP_AND_POPULATE_PHENOTYPES", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -273,7 +273,7 @@ }, { "name": "Run DROP_AND_POPULATE_ALL_TABLES", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -298,7 +298,7 @@ }, { "name": "DROP_AND_POPULATE_ALL_TABLES (USE MOCK DATA)", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -324,7 +324,7 @@ }, { "name": "Run POPULATE_PHENOTYPES_DATASTORE", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -346,7 +346,7 @@ }, { "name": "DB_OP TEST_ECHO", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -372,7 +372,7 @@ }, { "name": "DbOp: Recompute Phenotype Report Cached Names", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/db_operations/main.py", "console": "integratedTerminal", @@ -390,7 +390,7 @@ }, { "name": "Test Indel Finder", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/src/modules/indel_primer/main.py", "console": "integratedTerminal", @@ -410,7 +410,7 @@ }, { "name": "Run Site-v2 (local API)", - "type": "python", + "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}/src/modules/site-v2", "console": "integratedTerminal", @@ -440,7 +440,7 @@ }, { "name": "Run API pipeline server (local site)", - "type": "python", + "type": "debugpy", "request": "launch", "cwd": "${workspaceFolder}/src/modules/api/pipeline-task", "console": "integratedTerminal", From e52d0116947727935e748f2891cbe6ce5a0982e4 Mon Sep 17 00:00:00 2001 From: Vincent LaGrassa Date: Fri, 25 Oct 2024 13:02:25 -0500 Subject: [PATCH 2/3] Add README Q/A for new VSCode debugpy error --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 8495fc22..23d44907 100644 --- a/README.md +++ b/README.md @@ -408,4 +408,13 @@ $ arch -x86_64 brew install openssl ``` +Q: I get an `ImportError` when running the API in VSCode: +``` + ImportError: cannot import name 'Literal' from 'typing' (/Users/ ... /.pyenv/versions/3.7.12/lib/python3.7/typing.py) +``` + +A: The VSCode extension `debugpy`, version `v2024.12.0`, appears to break on Python 3.7 -- it's not clear if this is a bug, or intentional dropping of support for older versions. +You can get around this by pinning your extension to `v2024.10.0` -- see [the VSCode docs](https://code.visualstudio.com/updates/v1_30#_install-previous-versions) for instructions. + +(If this is a bug, further updates to `debugpy` might fix this issue. Keep an eye on it, and try the newest version if necessary.) From 2efe2e01e52205157fd080d64fe5d3d74e0d84ef Mon Sep 17 00:00:00 2001 From: Vincent LaGrassa Date: Fri, 25 Oct 2024 13:02:48 -0500 Subject: [PATCH 3/3] Make genome browser tool data endpoints public --- src/modules/site-v2/base/views/api/tracks.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/site-v2/base/views/api/tracks.py b/src/modules/site-v2/base/views/api/tracks.py index 1b8b6b97..2ee3457e 100644 --- a/src/modules/site-v2/base/views/api/tracks.py +++ b/src/modules/site-v2/base/views/api/tracks.py @@ -207,7 +207,6 @@ def edit_track(track: BrowserTrackDefault = None, form_data = None, no_cache: bo @api_tracks_bp.route('/tool/', methods=['GET']) -@jwt_required() @jsonify_request def get_tool_tracks(tool_id: str): ''' @@ -227,7 +226,6 @@ def get_tool_tracks(tool_id: str): @api_tracks_bp.route('/templates', methods=['GET']) -@jwt_required() @jsonify_request def get_track_templates(): '''