From ce759a3d45dec5b68c4afc8dd50ee73db4609bb1 Mon Sep 17 00:00:00 2001 From: David Carmichael Date: Mon, 5 Aug 2024 22:42:57 +0100 Subject: [PATCH] feat: adjusted docker testing --- Dockerfile | 10 +++++----- flask_imp/config/imp_config.py | 4 ++-- requirements/main.txt | 3 +-- test_docker/Dockerfile_Python_3_10 | 6 +++--- test_docker/Dockerfile_Python_3_11 | 6 +++--- test_docker/Dockerfile_Python_3_12 | 6 +++--- test_docker/Dockerfile_Python_3_13 | 6 +++--- test_docker/Dockerfile_Python_3_8 | 6 +++--- test_docker/Dockerfile_Python_3_9 | 6 +++--- test_docker/__main__.py | 2 -- 10 files changed, 26 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39e959e0..42a85030 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ FROM python:3.11-alpine WORKDIR /flask-imp COPY app app -COPY src src +COPY flask_imp flask_imp COPY .env .env COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY setup.py setup.py -RUN pip install -r requirements.txt -RUN python3 setup.py install +COPY requirements/development.txt development.txt +COPY requirements/main.txt main.txt +RUN pip install -r development.txt +RUN flit install --symlink ENTRYPOINT ["flask", "run", "--debug", "--host=0.0.0.0"] \ No newline at end of file diff --git a/flask_imp/config/imp_config.py b/flask_imp/config/imp_config.py index d4fed85c..8887e554 100644 --- a/flask_imp/config/imp_config.py +++ b/flask_imp/config/imp_config.py @@ -11,13 +11,13 @@ class ImpConfig: IMP_INIT_SESSION: t.Optional[dict] = None IMP_DATABASE_MAIN: t.Optional[DatabaseConfig] = None - IMP_DATABASE_BINDS: t.Optional[list[DatabaseConfig]] = None + IMP_DATABASE_BINDS: t.Optional[t.List[DatabaseConfig]] = None def __init__( self, init_session: dict = None, database_main: t.Optional[DatabaseConfig] = None, - database_binds: t.Optional[list[DatabaseConfig]] = None + database_binds: t.Optional[t.List[DatabaseConfig]] = None ): self.IMP_INIT_SESSION = init_session self.IMP_DATABASE_MAIN = database_main diff --git a/requirements/main.txt b/requirements/main.txt index f1bd942c..93faca4e 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -1,3 +1,2 @@ Flask -Flask-SQLAlchemy -toml \ No newline at end of file +Flask-SQLAlchemy \ No newline at end of file diff --git a/test_docker/Dockerfile_Python_3_10 b/test_docker/Dockerfile_Python_3_10 index 43a5f5ba..b7aa8ee6 100644 --- a/test_docker/Dockerfile_Python_3_10 +++ b/test_docker/Dockerfile_Python_3_10 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/Dockerfile_Python_3_11 b/test_docker/Dockerfile_Python_3_11 index 7e99eb6e..42104e3d 100644 --- a/test_docker/Dockerfile_Python_3_11 +++ b/test_docker/Dockerfile_Python_3_11 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/Dockerfile_Python_3_12 b/test_docker/Dockerfile_Python_3_12 index 5ee19e3c..1be49f44 100644 --- a/test_docker/Dockerfile_Python_3_12 +++ b/test_docker/Dockerfile_Python_3_12 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/Dockerfile_Python_3_13 b/test_docker/Dockerfile_Python_3_13 index 4217e5b1..03de1b9c 100644 --- a/test_docker/Dockerfile_Python_3_13 +++ b/test_docker/Dockerfile_Python_3_13 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/Dockerfile_Python_3_8 b/test_docker/Dockerfile_Python_3_8 index 2f4fe0d1..2a83ac33 100644 --- a/test_docker/Dockerfile_Python_3_8 +++ b/test_docker/Dockerfile_Python_3_8 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/Dockerfile_Python_3_9 b/test_docker/Dockerfile_Python_3_9 index 7fd23505..a740e98f 100644 --- a/test_docker/Dockerfile_Python_3_9 +++ b/test_docker/Dockerfile_Python_3_9 @@ -6,11 +6,11 @@ ENV FLIT_ROOT_INSTALL=1 COPY tests tests COPY flask_imp flask_imp COPY pyproject.toml pyproject.toml -COPY requirements.txt requirements.txt -COPY requirements_dev.txt requirements_dev.txt +COPY requirements/development.txt requirements/development.txt +COPY requirements/main.txt requirements/main.txt COPY pyproject.toml pyproject.toml COPY README.md README.md COPY LICENSE LICENSE -RUN pip install -r requirements_dev.txt +RUN pip install -r requirements/development.txt RUN flit install ENTRYPOINT ["pytest"] diff --git a/test_docker/__main__.py b/test_docker/__main__.py index 1a95313b..2fdcb56e 100644 --- a/test_docker/__main__.py +++ b/test_docker/__main__.py @@ -36,7 +36,6 @@ def __exit__(self, exc_type, exc_value, traceback): "flask-imp-python-3-10:latest": "test_docker/Dockerfile_Python_3_10", "flask-imp-python-3-11:latest": "test_docker/Dockerfile_Python_3_11", "flask-imp-python-3-12:latest": "test_docker/Dockerfile_Python_3_12", - "flask-imp-python-3-13:latest": "test_docker/Dockerfile_Python_3_13", } enabled_tags = [ @@ -45,7 +44,6 @@ def __exit__(self, exc_type, exc_value, traceback): "flask-imp-python-3-10:latest", "flask-imp-python-3-11:latest", "flask-imp-python-3-12:latest", - # "flask-imp-python-3-13:latest", ] if __name__ == "__main__":