From c17d34684fbcfde65dabe7a78f519a4b3ee1414a Mon Sep 17 00:00:00 2001 From: henrikstranneheim Date: Wed, 28 Feb 2024 17:27:19 +0100 Subject: [PATCH] feat(black) --- .github/workflows/black.yml | 21 +++++++++++++++++++++ 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 + 7 files changed, 27 insertions(+) create mode 100644 .github/workflows/black.yml 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/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