diff --git a/cada_prio/cli.py b/cada_prio/cli.py index 3c26b08..2b1e257 100644 --- a/cada_prio/cli.py +++ b/cada_prio/cli.py @@ -9,6 +9,7 @@ import cattr import click import logzero +import yaml try: import optuna @@ -140,6 +141,16 @@ def cli_dump_graph( inspection.dump_graph(path_graph, path_hgnc_info, hgnc_to_entrez) +@cli_utils.command("dump-openapi-yaml") +@click.argument("path_out", type=str) +def cli_dump_openapi_yaml(path_out: str): + """Dump OpenAPI YAML file""" + from cada_prio import rest_server + + with open(path_out, "wt") as f: + yaml.dump(rest_server.app.openapi(), f) + + @cli.group("tune") def cli_tune(): """hyperparameter tuning""" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c7cbef6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -logzero >=1.7.0, <2.0 -attrs >=22.1.0, <24.0 -cattrs >=22.2.0, <24.0 -click >=8.1.3, <9.0 -toml >=0.10.2, <0.11 -tqdm >=4.0 -pronto >=2.5, <3.0 -networkx -node2vec >=0.4.6, <0.5 -gensim >=4.3.2, <5.0 -uvicorn >=0.23.2 -fastapi >=0.103, <0.112 -python-dotenv >=1.0, <2.0 diff --git a/requirements.txt b/requirements.txt new file mode 120000 index 0000000..2d8105f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requirements/base.txt \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt index c7cbef6..9f3332b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -11,3 +11,4 @@ gensim >=4.3.2, <5.0 uvicorn >=0.23.2 fastapi >=0.103, <0.112 python-dotenv >=1.0, <2.0 +pyyaml >=6.0, <7.0 diff --git a/requirements/test.txt b/requirements/test.txt index 0a5e4b4..7c49c08 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -19,6 +19,7 @@ types-tabulate >=0.9.0.0 types-jsonschema >=4.17.0 types-tqdm >=4.66.0 types-xmltodict >=0.13.0.3 +types-PyYAML >=6.0 networkx-stubs sphinx diff --git a/tests/test_rest_server.py b/tests/test_rest_server.py index e8c65c1..c22dc23 100644 --- a/tests/test_rest_server.py +++ b/tests/test_rest_server.py @@ -10,7 +10,7 @@ @pytest.mark.asyncio async def test_version(): with TestClient(rest_server.app) as client: - response = client.get("/version") + response = client.get("/api/v1/version") assert response.status_code == 200 @@ -18,7 +18,7 @@ async def test_version(): @pytest.mark.asyncio async def test_predict_with_gene(): with TestClient(rest_server.app) as client: - response = client.get("/predict/?hpo_terms=HP:0008551&hpo=HP:0000007&gene=MKS1") + response = client.get("/api/v1/predict/?hpo_terms=HP:0008551&hpo=HP:0000007&gene=MKS1") assert response.status_code == 200 @@ -26,5 +26,5 @@ async def test_predict_with_gene(): @pytest.mark.asyncio async def test_predict_without_gene(): with TestClient(rest_server.app) as client: - response = client.get("/predict/?hpo_terms=HP:0008551&hpo=HP:0000007") + response = client.get("/api/v1/predict/?hpo_terms=HP:0008551&hpo=HP:0000007") assert response.status_code == 200 diff --git a/utils/terraform/.gitignore b/utils/terraform/.gitignore deleted file mode 100644 index 5dfe310..0000000 --- a/utils/terraform/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.terraform* -terraform.tfstate* diff --git a/utils/terraform/main.tf b/utils/terraform/main.tf deleted file mode 100644 index a36f677..0000000 --- a/utils/terraform/main.tf +++ /dev/null @@ -1,19 +0,0 @@ -# Mangement of the GitHub project. - -resource "github_repository" "cada-prio" { - name = "cada-prio" - description = "Re-implementation of the CADA phenotype-based prioritization algorithm" - - has_issues = true - visibility = "public" - - allow_auto_merge = true - allow_rebase_merge = false - allow_merge_commit = false - has_downloads = true - has_discussions = true - delete_branch_on_merge = true - - squash_merge_commit_message = "BLANK" - squash_merge_commit_title = "PR_TITLE" -} diff --git a/utils/terraform/provider.tf b/utils/terraform/provider.tf deleted file mode 100644 index 0349641..0000000 --- a/utils/terraform/provider.tf +++ /dev/null @@ -1 +0,0 @@ -provider "github" {}