From b617b8ff3095146ae5b0ce0a20faf59282d7b0f3 Mon Sep 17 00:00:00 2001 From: Henrik Stranneheim Date: Tue, 5 Mar 2024 14:30:53 +0100 Subject: [PATCH 1/6] feat(sendmail.container): Remove (#80) ### Changed - Remove sendmail-container as it is not used. --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8b9b107..d268008 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,5 @@ python-jose[cryptography] bcrypt numpy aiofiles -sendmail-container python-dotenv google-auth From dddc3b0197432235c877681a4d04b7e1440d5064 Mon Sep 17 00:00:00 2001 From: Clinical Genomics Bot Date: Tue, 5 Mar 2024 13:31:19 +0000 Subject: [PATCH 2/6] =?UTF-8?q?Bump=20version:=202.0.2=20=E2=86=92=202.0.3?= =?UTF-8?q?=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- genotype_api/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c7540f9..d9a1830 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.2 +current_version = 2.0.3 commit = True tag = True tag_name = v{new_version} diff --git a/genotype_api/__init__.py b/genotype_api/__init__.py index 0309ae2..5fa9130 100644 --- a/genotype_api/__init__.py +++ b/genotype_api/__init__.py @@ -1 +1 @@ -__version__ = "2.0.2" +__version__ = "2.0.3" diff --git a/setup.py b/setup.py index 9f1ea87..d3cafd8 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="genotype_api", - version="2.0.2", + version="2.0.3", description="", long_description=long_description, long_description_content_type="text/markdown", From 3b9d944718260b15f560472eb27272107ebb4cd4 Mon Sep 17 00:00:00 2001 From: Henrik Stranneheim Date: Wed, 6 Mar 2024 09:18:08 +0100 Subject: [PATCH 3/6] fix(pydantic) (#81) ### Fixed - Missing imports --- requirements.txt | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/requirements.txt b/requirements.txt index d268008..3e66597 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,22 +1,26 @@ -click -pyyaml -coloredlogs -bump2version -pymysql -sqlmodel -openpyxl -SQLAlchemy==1.4.30 # server stuff -passlib +SQLAlchemy==1.4.30 +aiofiles +bcrypt +bump2version +click +coloredlogs +email-validator fastapi==0.75.0 -uvicorn -uvloop -httptools +google-auth gunicorn -python-jose[cryptography] -bcrypt +httptools numpy -aiofiles +openpyxl +passlib +pydantic==1.10.14 +pymysql python-dotenv -google-auth +python-jose[cryptography] +python-multipart +pyyaml +requests +sqlmodel +uvicorn +uvloop From ba109e38000606f5f91b70d367b2cca4f1890cf9 Mon Sep 17 00:00:00 2001 From: Clinical Genomics Bot Date: Wed, 6 Mar 2024 08:18:32 +0000 Subject: [PATCH 4/6] =?UTF-8?q?Bump=20version:=202.0.3=20=E2=86=92=202.0.4?= =?UTF-8?q?=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- genotype_api/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d9a1830..7200908 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.3 +current_version = 2.0.4 commit = True tag = True tag_name = v{new_version} diff --git a/genotype_api/__init__.py b/genotype_api/__init__.py index 5fa9130..f6bb6f4 100644 --- a/genotype_api/__init__.py +++ b/genotype_api/__init__.py @@ -1 +1 @@ -__version__ = "2.0.3" +__version__ = "2.0.4" diff --git a/setup.py b/setup.py index d3cafd8..1619136 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="genotype_api", - version="2.0.3", + version="2.0.4", description="", long_description=long_description, long_description_content_type="text/markdown", From 686cef828374bb7c8d3164144126a732afc1dac6 Mon Sep 17 00:00:00 2001 From: Henrik Stranneheim Date: Wed, 6 Mar 2024 09:46:43 +0100 Subject: [PATCH 5/6] feat(black) (#79) ### Added - Added Black actions - Add pre-commit, black,isort and ruff --- .github/workflows/black.yml | 21 +++++++++++++++++++++ .github/workflows/merge_master_ci.yml | 12 ++++++------ .github/workflows/pull_request_ci.yml | 16 ++++++++-------- .github/workflows/release_ci.yml | 8 ++++---- .pre-commit-config.yaml | 16 ++++++++++++++++ genotype_api/api/app.py | 1 + genotype_api/api/endpoints/analyses.py | 1 + genotype_api/api/endpoints/plates.py | 1 + genotype_api/api/endpoints/snps.py | 1 + genotype_api/constants.py | 1 + genotype_api/database.py | 1 + requirements-dev.txt | 7 ++++--- requirements.txt | 2 -- 13 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/black.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..c49d2e7 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,21 @@ +name: Black + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out git repository + uses: actions/checkout@v4.1.1 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Set up Black + uses: psf/black@stable + with: + options: ". --check --line-length 100" + version: "~=24.1.0" diff --git a/.github/workflows/merge_master_ci.yml b/.github/workflows/merge_master_ci.yml index 867b5ca..bfdc806 100644 --- a/.github/workflows/merge_master_ci.yml +++ b/.github/workflows/merge_master_ci.yml @@ -23,7 +23,7 @@ jobs: name: Create staging image steps: - name: Check out git repository - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 - name: Extract branch name and remove illegal chars id: get_branch_name @@ -31,18 +31,18 @@ jobs: run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3.1.0 - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5.1.0 with: context: ./ file: ./Dockerfile @@ -54,12 +54,12 @@ jobs: name: Test and coveralls steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5.0.0 with: python-version: "3.10" - name: Check out genotype-api - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 with: repository: "Clinical-Genomics/genotype-api" diff --git a/.github/workflows/pull_request_ci.yml b/.github/workflows/pull_request_ci.yml index 7b98fb0..3aad712 100644 --- a/.github/workflows/pull_request_ci.yml +++ b/.github/workflows/pull_request_ci.yml @@ -9,8 +9,8 @@ jobs: runs-on: ubuntu-latest name: Black steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4.1.1 + - uses: actions/setup-python@v5.0.0 - uses: psf/black@stable with: black_args: ". --check --line-length 100" @@ -20,7 +20,7 @@ jobs: name: Create staging docker image steps: - name: Check out git repository - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 - name: Extract branch name and remove illegal chars id: get_branch_name @@ -28,18 +28,18 @@ jobs: run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3.1.0 - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5.1.0 with: context: ./ file: ./Dockerfile @@ -51,12 +51,12 @@ jobs: name: Test and coveralls steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5.0.0 with: python-version: "3.10" - name: Check out genotype-api - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 with: repository: "Clinical-Genomics/genotype-api" diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 8f74478..6a2dfcf 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -12,7 +12,7 @@ jobs: name: Push production docker image to dockerhub steps: - name: Check out git repository - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.1 - name: Extract branch name and remove illegal chars id: get_branch_name @@ -20,18 +20,18 @@ jobs: run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3.1.0 - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5.1.0 with: context: ./ file: ./Dockerfile diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e860672 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/psf/black + rev: 24.1.0 + hooks: + - id: black + args: [--line-length=100] + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + name: isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.7 + hooks: + - id: ruff + diff --git a/genotype_api/api/app.py b/genotype_api/api/app.py index b97f48d..e547a7f 100644 --- a/genotype_api/api/app.py +++ b/genotype_api/api/app.py @@ -2,6 +2,7 @@ Main functions for the genotype api """ + from fastapi import FastAPI, status, Request from fastapi.responses import JSONResponse from fastapi.middleware.cors import CORSMiddleware diff --git a/genotype_api/api/endpoints/analyses.py b/genotype_api/api/endpoints/analyses.py index acad268..93193b5 100644 --- a/genotype_api/api/endpoints/analyses.py +++ b/genotype_api/api/endpoints/analyses.py @@ -1,4 +1,5 @@ """Routes for analysis""" + from pathlib import Path from typing import List diff --git a/genotype_api/api/endpoints/plates.py b/genotype_api/api/endpoints/plates.py index b75f19c..4cd695a 100644 --- a/genotype_api/api/endpoints/plates.py +++ b/genotype_api/api/endpoints/plates.py @@ -1,4 +1,5 @@ """Routes for plates""" + from datetime import datetime from io import BytesIO from pathlib import Path diff --git a/genotype_api/api/endpoints/snps.py b/genotype_api/api/endpoints/snps.py index 988945c..ffb654a 100644 --- a/genotype_api/api/endpoints/snps.py +++ b/genotype_api/api/endpoints/snps.py @@ -1,4 +1,5 @@ """Routes for the snps""" + from genotype_api.models import SNP, User from typing import List diff --git a/genotype_api/constants.py b/genotype_api/constants.py index b79fbac..7a8431c 100644 --- a/genotype_api/constants.py +++ b/genotype_api/constants.py @@ -1,4 +1,5 @@ """Constants used over the package""" + from enum import Enum from pydantic import BaseModel diff --git a/genotype_api/database.py b/genotype_api/database.py index 82bd656..c082e69 100644 --- a/genotype_api/database.py +++ b/genotype_api/database.py @@ -1,4 +1,5 @@ """Hold the database information""" + from sqlmodel import Session, SQLModel, create_engine from genotype_api.config import settings diff --git a/requirements-dev.txt b/requirements-dev.txt index 467952e..8c2cca8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,6 @@ -pytest>=5.2 -pytest-cov +bump2version coveralls +pre-commit pylint -bump2version \ No newline at end of file +pytest-cov +pytest>=5.2< \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3e66597..c32a2ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ - -# server stuff SQLAlchemy==1.4.30 aiofiles bcrypt From 44d0c18ba85613764a22c52d394fc62f5f97dd52 Mon Sep 17 00:00:00 2001 From: Clinical Genomics Bot Date: Wed, 6 Mar 2024 08:47:13 +0000 Subject: [PATCH 6/6] =?UTF-8?q?Bump=20version:=202.0.4=20=E2=86=92=202.0.5?= =?UTF-8?q?=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- genotype_api/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7200908..cbe5759 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.4 +current_version = 2.0.5 commit = True tag = True tag_name = v{new_version} diff --git a/genotype_api/__init__.py b/genotype_api/__init__.py index f6bb6f4..34c5111 100644 --- a/genotype_api/__init__.py +++ b/genotype_api/__init__.py @@ -1 +1 @@ -__version__ = "2.0.4" +__version__ = "2.0.5" diff --git a/setup.py b/setup.py index 1619136..cbb6ceb 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="genotype_api", - version="2.0.4", + version="2.0.5", description="", long_description=long_description, long_description_content_type="text/markdown",