Skip to content

Commit

Permalink
feat: adjusted docker testing
Browse files Browse the repository at this point in the history
  • Loading branch information
CheeseCake87 committed Aug 5, 2024
1 parent f1e6310 commit ce759a3
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 29 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
4 changes: 2 additions & 2 deletions flask_imp/config/imp_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions requirements/main.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Flask
Flask-SQLAlchemy
toml
Flask-SQLAlchemy
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_10
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_11
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_12
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_13
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_8
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions test_docker/Dockerfile_Python_3_9
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 0 additions & 2 deletions test_docker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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__":
Expand Down

0 comments on commit ce759a3

Please sign in to comment.