diff --git a/.compass/compass.yml b/.compass/compass.yml new file mode 100644 index 0000000..ac3c9d0 --- /dev/null +++ b/.compass/compass.yml @@ -0,0 +1,103 @@ +name: geneweaver-api +id: 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/ac8655e4-ce94-4576-adb6-15a785b0161b' +description: null +configVersion: 1 +typeId: SERVICE +ownerId: 'ari:cloud:teams::team/0d1a489d-e157-4c61-8d94-7e5c651eb9cc' +fields: + tier: 2 + lifecycle: Active +links: + - name: null + type: REPOSITORY + url: 'https://github.com/TheJacksonLaboratory/geneweaver-api' + - name: null + type: PROJECT + url: 'https://jacksonlaboratory.atlassian.net/browse/G3' + - name: '' + type: DOCUMENT + url: 'https://thejacksonlaboratory.github.io/geneweaver-docs/' + - name: Swagger Page + type: OTHER_LINK + url: 'https://geneweaver.jax.org/api/docs' + - name: GeneWeaver Slack + type: CHAT_CHANNEL + url: 'https://thejacksonlaboratory.slack.com/archives/GGKCSAWCF' + - name: GeneWeaver JCPG Slack + type: CHAT_CHANNEL + url: 'https://thejacksonlaboratory.slack.com/archives/C05G32L2SLX' +relationships: + DEPENDS_ON: + - 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/f1375e59-b539-46b4-a44c-2cf1bce3637a' + - 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/a95bd6b6-cf4f-4635-bb62-693ef9df2f69' + - 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/37625f97-0774-42ba-9e0e-9a6b4c87a707' + - 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/43044a89-087b-4469-86a8-34f9ded06b4c' + - 'ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:component/90bb0329-f6c5-429a-abbc-8d174535ad21/71eb9358-bf9c-4bb2-b30f-2918b099ed57' +labels: null +customFields: + - name: 'FIN: Funding End Date' + type: text + value: null + - name: 'FIN: Funding Sources' + type: text + value: null + - name: 'FIN: Hosting Cost' + type: number + value: null + - name: 'FIN: Incurred Development Cost' + type: number + value: null + - name: 'FIN: Maintenance Cost' + type: number + value: null + - name: 'INFO: Business Owner' + type: text + value: 'Erich Baker, Elissa Chesler' + - name: 'INFO: Creation Date' + type: text + value: null + - name: 'INFO: Data Type(s)' + type: text + value: null + - name: 'INFO: FAIR Compliance' + type: text + value: null + - name: 'INFO: Usage Statistics' + type: text + value: null + - name: 'INFO: User Statistics' + type: text + value: null + - name: 'TECH: Authentication Type' + type: text + value: null + - name: 'TECH: Authorization' + type: text + value: null + - name: 'TECH: Automated Deployments' + type: boolean + value: true + - name: 'TECH: Containerized' + type: boolean + value: false + - name: 'TECH: Deployment Location' + type: text + value: jax-cluster + - name: 'TECH: Deployment OS' + type: text + value: null + - name: 'TECH: Open Source Code' + type: boolean + value: true + - name: 'TECH: Other' + type: text + value: null + - name: 'TECH: Point of Contact' + type: text + value: null + - name: 'TECH: Public Domain Name' + type: boolean + value: false + - name: 'TECH: Stack' + type: text + value: 'python, fastapi' diff --git a/.github/workflows/_check-coverage-action.yml b/.github/workflows/_check-coverage-action.yml index 0990df5..99cbfda 100644 --- a/.github/workflows/_check-coverage-action.yml +++ b/.github/workflows/_check-coverage-action.yml @@ -65,6 +65,32 @@ jobs: with: name: coverage-report-html path: htmlcov + - name: Upload coverage to Compass + run: | + METRIC_VALUE=$(cat coverage_report.txt | grep 'Total coverage:' | awk '{print $NF}' | sed 's/%//') + curl --request POST \ + --url https://jacksonlaboratory.atlassian.net/gateway/api/compass/v1/metrics \ + --user "${{ vars.ATLASSIAN_COMPASS_EMAIL }}:${{ secrets.ATLASSIAN_COMPASS_KEY }}" \ + --header "Accept: application/json" \ + --header "Content-Type: application/json" \ + --data "{ + \"metricSourceId\": \"ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:metric-source/90bb0329-f6c5-429a-abbc-8d174535ad21/f2a60ca2-5065-4c10-ae99-cb844715b5e3\", + \"value\": $METRIC_VALUE, + \"timestamp\": \"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" + }" + - name: Upload complexity to Compass + run: | + METRIC_VALUE=$(poetry run radon cc src --total-average | grep 'Average complexity:' | awk '{print $NF}' | sed 's/[\(\)]//g') + curl --request POST \ + --url https://jacksonlaboratory.atlassian.net/gateway/api/compass/v1/metrics \ + --user "${{ vars.ATLASSIAN_COMPASS_EMAIL }}:${{ secrets.ATLASSIAN_COMPASS_KEY }}" \ + --header "Accept: application/json" \ + --header "Content-Type: application/json" \ + --data "{ + \"metricSourceId\": \"ari:cloud:compass:44257862-6c68-4d47-8211-da38d2bb001b:metric-source/90bb0329-f6c5-429a-abbc-8d174535ad21/480dd6d8-7e86-492f-b929-3cea59711691\", + \"value\": $METRIC_VALUE, + \"timestamp\": \"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" + }" comment-coverage-report: needs: [ check_coverage ] runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9f5bdf5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,15 @@ +The full contribution guide can be found at [Geneweaver Documentation](https://thejacksonlaboratory.github.io/geneweaver-docs/reference/contributing-guide/). + +This package is developed and maintained by the Computational Sciences department at +the Jackson Laboratory. + +For more information, please visit +[our website](https://www.jax.org/research-and-faculty/resources/scientific-research-services/computational-sciences). + +For questions, comments, bug reports and security vulnerability reporting, please reach +out to us as cssc@jax.org. + +Other Geneweaver packages are community developed and can be found at on GitHub: +- [Geneweaver Testing](https://github.com/bergsalex/geneweaver-testing) +- [Geneweaver Tools](https://github.com/bergsalex/geneweaver-tools) +- [Geneweaver AON](https://github.com/bergsalex/geneweaver-aon) \ No newline at end of file diff --git a/README.md b/README.md index 5e73ce1..2cfa5bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Geneweaver 3 API +[![GitHub deployments](https://img.shields.io/github/deployments/thejacksonlaboratory/geneweaver-api/jax-cluster-prod-10--prod?style=for-the-badge&label=Deployment%20Status)](https://geneweaver.jax.org/aon/api/docs) +[![Website](https://img.shields.io/website?url=https%3A%2F%2Fgeneweaver.jax.org%2Fapi%2Fdocs&up_message=available&down_message=down&style=for-the-badge&logo=swagger&label=Swagger%20Page&link=https%3A%2F%2Fgeneweaver.jax.org%2Fapi%2Fdocs)](https://geneweaver.jax.org/api/docs) +[![Website](https://img.shields.io/website?url=https%3A%2F%2Fthejacksonlaboratory.github.io%2Fgeneweaver-docs%2F&up_message=AVAILABLE&style=for-the-badge&logo=materialformkdocs&label=Documentation)](https://thejacksonlaboratory.github.io/geneweaver-docs/) + Description: The API for the Geneweaver v3 application ecosystem. ## Setup diff --git a/deploy/k8s/base/global-labels.yaml b/deploy/k8s/base/global-labels.yaml new file mode 100644 index 0000000..7c06767 --- /dev/null +++ b/deploy/k8s/base/global-labels.yaml @@ -0,0 +1,14 @@ +apiVersion: builtin +kind: LabelTransformer +metadata: + name: global-labels +labels: + jax.org/owner-team: geneweaver + jax.org/owner-team-id: 0d1a489d-e157-4c61-8d94-7e5c651eb9cc + jax.org/billing-group: geneweaver + jax.org/system-group: geneweaver + jax.org/component-id: ac8655e4-ce94-4576-adb6-15a785b0161b + jax.org/component-tier: 2 +fieldSpecs: +- path: metadata/labels + create: true \ No newline at end of file diff --git a/deploy/k8s/base/ingress.yaml b/deploy/k8s/base/ingress.yaml deleted file mode 100644 index a67cc78..0000000 --- a/deploy/k8s/base/ingress.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: geneweaver-api-ingress - annotations: - # NOTE: When deploying a new instance, make sure to use the staging issuer first - # so that you don't hit the rate limit for the production issuer. - cert-manager.io/cluster-issuer: "letsencrypt-staging" - # cert-manager.io/cluster-issuer: "letsencrypt-prod" - nginx.ingress.kubernetes.io/auth-url: "http://oauth2-proxy.oauth2-proxy.svc.cluster.local/oauth2/auth" - nginx.ingress.kubernetes.io/auth-signin: "https://auth.jax-cluster-dev-10.jax.org/oauth2/start?rd=https://$http_host$escaped_request_uri" -spec: - ingressClassName: nginx diff --git a/deploy/k8s/base/kustomization.yaml b/deploy/k8s/base/kustomization.yaml index 4a836d7..7ebc9f9 100644 --- a/deploy/k8s/base/kustomization.yaml +++ b/deploy/k8s/base/kustomization.yaml @@ -1,9 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - +transformers: + - global-labels.yaml resources: - configmap.yaml - deployment.yaml - service.yaml - # TODO: Uncomment the following line to enable ingress - # - ingress.yaml \ No newline at end of file diff --git a/deploy/k8s/overlays/jax-cluster-dev-10--dev/kustomization.yaml b/deploy/k8s/overlays/jax-cluster-dev-10--dev/kustomization.yaml index f6fa11b..28b3b30 100644 --- a/deploy/k8s/overlays/jax-cluster-dev-10--dev/kustomization.yaml +++ b/deploy/k8s/overlays/jax-cluster-dev-10--dev/kustomization.yaml @@ -1,15 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - namespace: dev - -bases: -- ../../base - -# NOTE: When applying production ingress, replace this with a patch resources: + - ../../base - ingress.yaml - -#patchesStrategicMerge: -# - configmap.yaml -# - ingress.yaml diff --git a/deploy/k8s/overlays/jax-cluster-dev-10--sqa/kustomization.yaml b/deploy/k8s/overlays/jax-cluster-dev-10--sqa/kustomization.yaml index dbe0633..c8421e1 100644 --- a/deploy/k8s/overlays/jax-cluster-dev-10--sqa/kustomization.yaml +++ b/deploy/k8s/overlays/jax-cluster-dev-10--sqa/kustomization.yaml @@ -1,15 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - namespace: sqa - -bases: -- ../../base - -# NOTE: When applying production ingress, replace this with a patch resources: + - ../../base - ingress.yaml - -#patchesStrategicMerge: -# - configmap.yaml -# - ingress.yaml diff --git a/deploy/k8s/overlays/jax-cluster-prod-10--prod/kustomization.yaml b/deploy/k8s/overlays/jax-cluster-prod-10--prod/kustomization.yaml index ebc9cd2..b12681d 100644 --- a/deploy/k8s/overlays/jax-cluster-prod-10--prod/kustomization.yaml +++ b/deploy/k8s/overlays/jax-cluster-prod-10--prod/kustomization.yaml @@ -1,13 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - namespace: prod - -bases: -- ../../base - +resources: + - ../../base + - ingress.yaml patchesStrategicMerge: - configmap.yaml - -resources: - - ingress.yaml \ No newline at end of file diff --git a/deploy/k8s/overlays/jax-cluster-prod-10--stage/kustomization.yaml b/deploy/k8s/overlays/jax-cluster-prod-10--stage/kustomization.yaml index 04ae5ae..7341c7d 100644 --- a/deploy/k8s/overlays/jax-cluster-prod-10--stage/kustomization.yaml +++ b/deploy/k8s/overlays/jax-cluster-prod-10--stage/kustomization.yaml @@ -1,13 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - namespace: stage - -bases: -- ../../base - +resources: + - ../../base + - ingress.yaml patchesStrategicMerge: - configmap.yaml - -resources: - - ingress.yaml \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 875bb35..a7ad678 100644 --- a/poetry.lock +++ b/poetry.lock @@ -24,33 +24,33 @@ trio = ["trio (>=0.23)"] [[package]] name = "black" -version = "23.12.1" +version = "24.3.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"}, - {file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"}, - {file = "black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0"}, - {file = "black-23.12.1-cp310-cp310-win_amd64.whl", hash = "sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3"}, - {file = "black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba"}, - {file = "black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b"}, - {file = "black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59"}, - {file = "black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50"}, - {file = "black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e"}, - {file = "black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec"}, - {file = "black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e"}, - {file = "black-23.12.1-cp312-cp312-win_amd64.whl", hash = "sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9"}, - {file = "black-23.12.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f"}, - {file = "black-23.12.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d"}, - {file = "black-23.12.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a"}, - {file = "black-23.12.1-cp38-cp38-win_amd64.whl", hash = "sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e"}, - {file = "black-23.12.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055"}, - {file = "black-23.12.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54"}, - {file = "black-23.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea"}, - {file = "black-23.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2"}, - {file = "black-23.12.1-py3-none-any.whl", hash = "sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e"}, - {file = "black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5"}, + {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, + {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, + {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, + {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, + {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, + {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, + {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, + {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, + {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, + {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, + {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, + {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, + {file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, + {file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, + {file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, + {file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, + {file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, + {file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, + {file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, + {file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, + {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, + {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, ] [package.dependencies] @@ -529,22 +529,23 @@ psycopg = {version = ">=3.1.13,<4.0.0", extras = ["binary"]} [[package]] name = "geneweaver-testing" -version = "0.0.3" +version = "0.1.2" description = "A library to standardize testing of GeneWeaver pacakges." optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "geneweaver_testing-0.0.3-py3-none-any.whl", hash = "sha256:dd9d04cd9ff6366496a9f66ea3347121d0d810d9748936db736837d6f773d7f5"}, - {file = "geneweaver_testing-0.0.3.tar.gz", hash = "sha256:e268462ced2d44ad213cae7cb2e669d5c0065e6bf82965730b7d3eb0f0f0e9a8"}, + {file = "geneweaver_testing-0.1.2-py3-none-any.whl", hash = "sha256:073fca36c9853fcf568398b199179049a241e254d12446bc1d3e25208b686fc0"}, + {file = "geneweaver_testing-0.1.2.tar.gz", hash = "sha256:0a44ab370b4284c61fc1ddbdc32a0ce00881ccc5b9bdfbb6dfd76121fadbe7c8"}, ] [package.dependencies] -black = ">=23.3.0,<24.0.0" +black = ">=24.2.0,<25.0.0" isort = ">=5.12.0,<6.0.0" mypy = ">=1.4.1,<2.0.0" -pytest = ">=7.4.0,<8.0.0" +pytest = ">=7.4.0,<9.0.0" pytest-cov = ">=4.1.0,<5.0.0" -ruff = ">=0.0.277,<0.0.278" +radon = ">=6.0.1,<7.0.0" +ruff = ">=0.2.2,<0.3.0" tomli = ">=2.0.1,<3.0.0" [[package]] @@ -715,6 +716,23 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] +[[package]] +name = "mando" +version = "0.7.1" +description = "Create Python CLI apps with little to no effort at all!" +optional = false +python-versions = "*" +files = [ + {file = "mando-0.7.1-py2.py3-none-any.whl", hash = "sha256:26ef1d70928b6057ee3ca12583d73c63e05c49de8972d620c278a7b206581a8a"}, + {file = "mando-0.7.1.tar.gz", hash = "sha256:18baa999b4b613faefb00eac4efadcf14f510b59b924b66e08289aa1de8c3500"}, +] + +[package.dependencies] +six = "*" + +[package.extras] +restructuredtext = ["rst2ansi"] + [[package]] name = "markupsafe" version = "2.1.5" @@ -1417,7 +1435,6 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -1425,16 +1442,8 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {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"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -1451,7 +1460,6 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -1459,12 +1467,29 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] +[[package]] +name = "radon" +version = "6.0.1" +description = "Code Metrics in Python" +optional = false +python-versions = "*" +files = [ + {file = "radon-6.0.1-py2.py3-none-any.whl", hash = "sha256:632cc032364a6f8bb1010a2f6a12d0f14bc7e5ede76585ef29dc0cecf4cd8859"}, + {file = "radon-6.0.1.tar.gz", hash = "sha256:d1ac0053943a893878940fedc8b19ace70386fc9c9bf0a09229a44125ebf45b5"}, +] + +[package.dependencies] +colorama = {version = ">=0.4.1", markers = "python_version > \"3.4\""} +mando = ">=0.6,<0.8" + +[package.extras] +toml = ["tomli (>=2.0.1)"] + [[package]] name = "requests" version = "2.31.0" @@ -1502,28 +1527,28 @@ pyasn1 = ">=0.1.3" [[package]] name = "ruff" -version = "0.0.277" -description = "An extremely fast Python linter, written in Rust." +version = "0.2.2" +description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.0.277-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:3250b24333ef419b7a232080d9724ccc4d2da1dbbe4ce85c4caa2290d83200f8"}, - {file = "ruff-0.0.277-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:3e60605e07482183ba1c1b7237eca827bd6cbd3535fe8a4ede28cbe2a323cb97"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7baa97c3d7186e5ed4d5d4f6834d759a27e56cf7d5874b98c507335f0ad5aadb"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:74e4b206cb24f2e98a615f87dbe0bde18105217cbcc8eb785bb05a644855ba50"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:479864a3ccd8a6a20a37a6e7577bdc2406868ee80b1e65605478ad3b8eb2ba0b"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:468bfb0a7567443cec3d03cf408d6f562b52f30c3c29df19927f1e0e13a40cd7"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f32ec416c24542ca2f9cc8c8b65b84560530d338aaf247a4a78e74b99cd476b4"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:14a7b2f00f149c5a295f188a643ac25226ff8a4d08f7a62b1d4b0a1dc9f9b85c"}, - {file = "ruff-0.0.277-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9879f59f763cc5628aa01c31ad256a0f4dc61a29355c7315b83c2a5aac932b5"}, - {file = "ruff-0.0.277-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f612e0a14b3d145d90eb6ead990064e22f6f27281d847237560b4e10bf2251f3"}, - {file = "ruff-0.0.277-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:323b674c98078be9aaded5b8b51c0d9c424486566fb6ec18439b496ce79e5998"}, - {file = "ruff-0.0.277-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3a43fbe026ca1a2a8c45aa0d600a0116bec4dfa6f8bf0c3b871ecda51ef2b5dd"}, - {file = "ruff-0.0.277-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:734165ea8feb81b0d53e3bf523adc2413fdb76f1264cde99555161dd5a725522"}, - {file = "ruff-0.0.277-py3-none-win32.whl", hash = "sha256:88d0f2afb2e0c26ac1120e7061ddda2a566196ec4007bd66d558f13b374b9efc"}, - {file = "ruff-0.0.277-py3-none-win_amd64.whl", hash = "sha256:6fe81732f788894a00f6ade1fe69e996cc9e485b7c35b0f53fb00284397284b2"}, - {file = "ruff-0.0.277-py3-none-win_arm64.whl", hash = "sha256:2d4444c60f2e705c14cd802b55cd2b561d25bf4311702c463a002392d3116b22"}, - {file = "ruff-0.0.277.tar.gz", hash = "sha256:2dab13cdedbf3af6d4427c07f47143746b6b95d9e4a254ac369a0edb9280a0d2"}, + {file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:0a9efb032855ffb3c21f6405751d5e147b0c6b631e3ca3f6b20f917572b97eb6"}, + {file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:d450b7fbff85913f866a5384d8912710936e2b96da74541c82c1b458472ddb39"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ecd46e3106850a5c26aee114e562c329f9a1fbe9e4821b008c4404f64ff9ce73"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e22676a5b875bd72acd3d11d5fa9075d3a5f53b877fe7b4793e4673499318ba"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1695700d1e25a99d28f7a1636d85bafcc5030bba9d0578c0781ba1790dbcf51c"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b0c232af3d0bd8f521806223723456ffebf8e323bd1e4e82b0befb20ba18388e"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f63d96494eeec2fc70d909393bcd76c69f35334cdbd9e20d089fb3f0640216ca"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a61ea0ff048e06de273b2e45bd72629f470f5da8f71daf09fe481278b175001"}, + {file = "ruff-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1439c8f407e4f356470e54cdecdca1bd5439a0673792dbe34a2b0a551a2fe3"}, + {file = "ruff-0.2.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:940de32dc8853eba0f67f7198b3e79bc6ba95c2edbfdfac2144c8235114d6726"}, + {file = "ruff-0.2.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0c126da55c38dd917621552ab430213bdb3273bb10ddb67bc4b761989210eb6e"}, + {file = "ruff-0.2.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3b65494f7e4bed2e74110dac1f0d17dc8e1f42faaa784e7c58a98e335ec83d7e"}, + {file = "ruff-0.2.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1ec49be4fe6ddac0503833f3ed8930528e26d1e60ad35c2446da372d16651ce9"}, + {file = "ruff-0.2.2-py3-none-win32.whl", hash = "sha256:d920499b576f6c68295bc04e7b17b6544d9d05f196bb3aac4358792ef6f34325"}, + {file = "ruff-0.2.2-py3-none-win_amd64.whl", hash = "sha256:cc9a91ae137d687f43a44c900e5d95e9617cb37d4c989e462980ba27039d239d"}, + {file = "ruff-0.2.2-py3-none-win_arm64.whl", hash = "sha256:c9d15fc41e6054bfc7200478720570078f0b41c9ae4f010bcc16bd6f4d1aacdd"}, + {file = "ruff-0.2.2.tar.gz", hash = "sha256:e62ed7f36b3068a30ba39193a14274cd706bc486fad521276458022f7bccb31d"}, ] [[package]] @@ -1931,4 +1956,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "4a24797f92af83b759743f097eb4d3a1ef72ec1a454cf981beb6f17e3eb31270" +content-hash = "0b636eb0714996bfcfd7d91e017583743372c4a0bf07db753cd55d78077860c9" diff --git a/pyproject.toml b/pyproject.toml index ed35169..a6fa625 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "geneweaver-api" -version = "0.4.0a6" +version = "0.4.0a7" description = "The Geneweaver API" authors = [ "Alexander Berger ", @@ -27,7 +27,7 @@ requests = "^2.31.0" python-jose = {extras = ["cryptography"], version = "^3.3.0"} [tool.poetry.group.dev.dependencies] -geneweaver-testing = "^0.0.3" +geneweaver-testing = "^0.1.2" pytest-asyncio = "^0.21.0" [tool.ruff] diff --git a/src/geneweaver/api/__init__.py b/src/geneweaver/api/__init__.py index 401ee36..67dd392 100644 --- a/src/geneweaver/api/__init__.py +++ b/src/geneweaver/api/__init__.py @@ -1,4 +1,5 @@ """The Geneweaver API Module.""" + try: from importlib import metadata except ImportError: diff --git a/src/geneweaver/api/controller/api.py b/src/geneweaver/api/controller/api.py index 808d4b4..823fe6d 100644 --- a/src/geneweaver/api/controller/api.py +++ b/src/geneweaver/api/controller/api.py @@ -3,6 +3,7 @@ This file defines the root API for the GeneWeaver API. It is responsible for defining the FastAPI application and including all other API routers. """ + from fastapi import APIRouter, FastAPI, Security from geneweaver.api import __version__ from geneweaver.api import dependencies as deps diff --git a/src/geneweaver/api/controller/batch.py b/src/geneweaver/api/controller/batch.py index 5646852..6c16c1c 100644 --- a/src/geneweaver/api/controller/batch.py +++ b/src/geneweaver/api/controller/batch.py @@ -1,4 +1,5 @@ """API Controller definition for batch processing.""" + from typing import Optional from fastapi import APIRouter, Security, UploadFile diff --git a/src/geneweaver/api/controller/genes.py b/src/geneweaver/api/controller/genes.py index 8187212..c099e2d 100644 --- a/src/geneweaver/api/controller/genes.py +++ b/src/geneweaver/api/controller/genes.py @@ -1,4 +1,5 @@ """Endpoints related to genes.""" + from typing import Optional from fastapi import APIRouter, Depends, Path, Query diff --git a/src/geneweaver/api/controller/genesets.py b/src/geneweaver/api/controller/genesets.py index 52c73d7..ee9f3fd 100644 --- a/src/geneweaver/api/controller/genesets.py +++ b/src/geneweaver/api/controller/genesets.py @@ -1,4 +1,5 @@ """Endpoints related to genesets.""" + import json import os import time diff --git a/src/geneweaver/api/controller/message.py b/src/geneweaver/api/controller/message.py index 05d461f..31c42fe 100644 --- a/src/geneweaver/api/controller/message.py +++ b/src/geneweaver/api/controller/message.py @@ -1,11 +1,11 @@ """Constants key/value messages.""" - ##Errors ACCESS_FORBIDDEN = "Forbidden" UNEXPECTED_ERROR = "Unexpected Error" GENE_IDENTIFIER_TYPE_VALUE_ERROR = "Invalid gene identifier type" RECORD_NOT_FOUND_ERROR = "Record not found" +INVALID_PUBMED_ID_ERROR = "Invalid pubmed id" ##FORM field descriptions GENE_REFERENCE = "The reference id to search for" diff --git a/src/geneweaver/api/controller/publications.py b/src/geneweaver/api/controller/publications.py index 0a5a6be..8651627 100644 --- a/src/geneweaver/api/controller/publications.py +++ b/src/geneweaver/api/controller/publications.py @@ -1,4 +1,5 @@ """Endpoints related to publications.""" + from typing import Optional from fastapi import APIRouter, Depends, HTTPException, Path diff --git a/src/geneweaver/api/controller/species.py b/src/geneweaver/api/controller/species.py index 18660e2..85c1fb6 100644 --- a/src/geneweaver/api/controller/species.py +++ b/src/geneweaver/api/controller/species.py @@ -1,4 +1,5 @@ """Endpoints related to species.""" + from typing import List, Optional from fastapi import APIRouter, Depends, Query diff --git a/src/geneweaver/api/core/config.py b/src/geneweaver/api/core/config.py index 9bfbeff..4a24fd1 100644 --- a/src/geneweaver/api/core/config.py +++ b/src/geneweaver/api/core/config.py @@ -1,4 +1,5 @@ """A namespace for the initialized Geneweaver API configuration.""" + from geneweaver.api.core.config_class import GeneweaverAPIConfig settings = GeneweaverAPIConfig() diff --git a/src/geneweaver/api/core/config_class.py b/src/geneweaver/api/core/config_class.py index 5791d4a..fd7eb05 100644 --- a/src/geneweaver/api/core/config_class.py +++ b/src/geneweaver/api/core/config_class.py @@ -1,4 +1,5 @@ """Namespace for the config class for the Geneweaver API.""" + from typing import Any, Dict, List, Optional from geneweaver.db.core.settings_class import Settings as DBSettings diff --git a/src/geneweaver/api/core/exceptions.py b/src/geneweaver/api/core/exceptions.py index 684140c..77db374 100644 --- a/src/geneweaver/api/core/exceptions.py +++ b/src/geneweaver/api/core/exceptions.py @@ -1,4 +1,5 @@ """Exceptions for the GeneWeaver API.""" + from fastapi import HTTPException diff --git a/src/geneweaver/api/core/security.py b/src/geneweaver/api/core/security.py index d974be5..5cae34a 100644 --- a/src/geneweaver/api/core/security.py +++ b/src/geneweaver/api/core/security.py @@ -1,4 +1,5 @@ """Code to authenticate a user to the API.""" + # ruff: noqa: B008 import urllib.parse from typing import Dict, Optional, Type, Union diff --git a/src/geneweaver/api/dependencies.py b/src/geneweaver/api/dependencies.py index 96eb67e..f9a1219 100644 --- a/src/geneweaver/api/dependencies.py +++ b/src/geneweaver/api/dependencies.py @@ -1,4 +1,5 @@ """Dependency injection capabilities for the GeneWeaver API.""" + # ruff: noqa: B008 import logging from contextlib import asynccontextmanager diff --git a/src/geneweaver/api/main.py b/src/geneweaver/api/main.py index 0907858..a2e652f 100644 --- a/src/geneweaver/api/main.py +++ b/src/geneweaver/api/main.py @@ -1,2 +1,3 @@ """The main entrypoint to running the api.""" + from geneweaver.api.controller.api import app # noqa: F401 diff --git a/src/geneweaver/api/schemas/apimodels.py b/src/geneweaver/api/schemas/apimodels.py index 066339e..58398cf 100644 --- a/src/geneweaver/api/schemas/apimodels.py +++ b/src/geneweaver/api/schemas/apimodels.py @@ -1,4 +1,5 @@ """Models for API requests.""" + from typing import Iterable, List, Optional from geneweaver.core.enum import GeneIdentifier, Species diff --git a/src/geneweaver/api/schemas/auth.py b/src/geneweaver/api/schemas/auth.py index 18dfffa..13f50f0 100644 --- a/src/geneweaver/api/schemas/auth.py +++ b/src/geneweaver/api/schemas/auth.py @@ -1,4 +1,5 @@ """Authentication Related Schemas.""" + from enum import Enum from typing import List, Optional diff --git a/src/geneweaver/api/schemas/batch.py b/src/geneweaver/api/schemas/batch.py index ec5fa31..9e82766 100644 --- a/src/geneweaver/api/schemas/batch.py +++ b/src/geneweaver/api/schemas/batch.py @@ -1,4 +1,5 @@ """Module for defining schemas for batch endpoints.""" + from typing import List from geneweaver.api.schemas.messages import MessageResponse diff --git a/src/geneweaver/api/schemas/messages.py b/src/geneweaver/api/schemas/messages.py index f751106..95f226d 100644 --- a/src/geneweaver/api/schemas/messages.py +++ b/src/geneweaver/api/schemas/messages.py @@ -1,4 +1,5 @@ """Namespace for defining schemas related to messaging.""" + import enum from typing import List, Optional diff --git a/src/geneweaver/api/schemas/score.py b/src/geneweaver/api/schemas/score.py index a459999..9aafbed 100644 --- a/src/geneweaver/api/schemas/score.py +++ b/src/geneweaver/api/schemas/score.py @@ -2,6 +2,7 @@ NOTE: These schemas might be duplicates of schemas available in geneweaver.core. """ + from enum import Enum from typing import Optional diff --git a/src/geneweaver/api/services/batch.py b/src/geneweaver/api/services/batch.py index 705938e..6717608 100644 --- a/src/geneweaver/api/services/batch.py +++ b/src/geneweaver/api/services/batch.py @@ -1,4 +1,5 @@ """Service functions for dealing with batch files.""" + from typing import List, Tuple from fastapi import UploadFile diff --git a/src/geneweaver/api/services/geneset.py b/src/geneweaver/api/services/geneset.py index de5ed6e..970e555 100644 --- a/src/geneweaver/api/services/geneset.py +++ b/src/geneweaver/api/services/geneset.py @@ -1,4 +1,5 @@ """Service functions for dealing with genesets.""" + from typing import Iterable from fastapi.logger import logger diff --git a/src/geneweaver/api/services/io.py b/src/geneweaver/api/services/io.py index 530fe49..61b9c68 100644 --- a/src/geneweaver/api/services/io.py +++ b/src/geneweaver/api/services/io.py @@ -1,4 +1,5 @@ """Services for reading and writing files.""" + from fastapi import UploadFile diff --git a/src/geneweaver/api/services/parse/batch.py b/src/geneweaver/api/services/parse/batch.py index 0a75172..8667e84 100644 --- a/src/geneweaver/api/services/parse/batch.py +++ b/src/geneweaver/api/services/parse/batch.py @@ -4,6 +4,7 @@ geneweaver.core module. This module contains functions for reading the contents of a file and passing those contents to the core module for processing. """ + from typing import List, Tuple from fastapi import UploadFile diff --git a/tests/controllers/conftest.py b/tests/controllers/conftest.py index 2eba450..dfed6d6 100644 --- a/tests/controllers/conftest.py +++ b/tests/controllers/conftest.py @@ -1,4 +1,5 @@ """Fixtures for the controller tests.""" + from unittest.mock import Mock import psycopg diff --git a/tests/controllers/test_api_standards.py b/tests/controllers/test_api_standards.py index 8711749..48057a5 100644 --- a/tests/controllers/test_api_standards.py +++ b/tests/controllers/test_api_standards.py @@ -2,6 +2,7 @@ https://devops.jax.org/Development/Best_Practices/API_Standards/http_standards/ """ + import re import pytest diff --git a/tests/controllers/test_genes.py b/tests/controllers/test_genes.py index e1f9bfa..5a1f92d 100644 --- a/tests/controllers/test_genes.py +++ b/tests/controllers/test_genes.py @@ -1,4 +1,5 @@ """Tests for geneset API.""" + import json from unittest.mock import patch diff --git a/tests/controllers/test_genesets.py b/tests/controllers/test_genesets.py index f8d718e..a0bdb3c 100644 --- a/tests/controllers/test_genesets.py +++ b/tests/controllers/test_genesets.py @@ -1,4 +1,5 @@ """Tests for geneset API.""" + from unittest.mock import patch import pytest diff --git a/tests/controllers/test_publications.py b/tests/controllers/test_publications.py index c3c9048..d14fc77 100644 --- a/tests/controllers/test_publications.py +++ b/tests/controllers/test_publications.py @@ -1,4 +1,5 @@ """Tests for geneset API.""" + from unittest.mock import patch from geneweaver.api.controller import message diff --git a/tests/controllers/test_species.py b/tests/controllers/test_species.py index 6081aac..cf0182a 100644 --- a/tests/controllers/test_species.py +++ b/tests/controllers/test_species.py @@ -1,4 +1,5 @@ """Tests for species API.""" + from unittest.mock import patch from tests.data import test_species_data diff --git a/tests/services/conftest.py b/tests/services/conftest.py index d65df3e..5c722b2 100644 --- a/tests/services/conftest.py +++ b/tests/services/conftest.py @@ -1,4 +1,5 @@ """Pytest fixtures for the batch parsing service tests.""" + from unittest.mock import AsyncMock import pytest diff --git a/tests/services/const.py b/tests/services/const.py index 0e5319d..b8c389c 100644 --- a/tests/services/const.py +++ b/tests/services/const.py @@ -1,4 +1,5 @@ """Constants for batch parsing tests.""" + # ruff: noqa: E501 EXAMPLE_BATCH_FILE = """ # This is an example batch upload file for GeneWeaver. diff --git a/tests/services/io/test_read_file_contents.py b/tests/services/io/test_read_file_contents.py index a9e5068..8b35750 100644 --- a/tests/services/io/test_read_file_contents.py +++ b/tests/services/io/test_read_file_contents.py @@ -1,4 +1,5 @@ """"Unit tests for the read_file_contents function in the io module.""" + import pytest from geneweaver.api.services import io