diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 541717a..91be0af 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,12 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: check-ast - types: [python] - id: check-json - types: [json] - id: check-toml - types: [toml] - id: check-xml - types: [xml] - id: check-yaml - types: [yaml] - id: end-of-file-fixer - id: check-merge-conflict - id: pretty-format-json @@ -22,12 +17,12 @@ repos: args: - --markdown-linebreak-ext=md - repo: https://github.com/timothycrosley/isort - rev: 5.9.2 + rev: 5.10.1 hooks: - id: isort types: [python] - repo: https://github.com/psf/black - rev: 21.6b0 + rev: 22.1.0 hooks: - id: black types: [python] diff --git a/.python-version b/.python-version index edb51eb..e9bec68 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -tcl-filtrage +tcl diff --git a/Dockerfile b/Dockerfile index 3e80fa6..03a60d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ ## Build venv -FROM python:3.10.1-buster AS venv +FROM python:3.10.4-buster AS venv # https://python-poetry.org/docs/#installation -ENV POETRY_VERSION=1.1.11 +ENV POETRY_VERSION=1.1.13 RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - ENV PATH /root/.local/bin:$PATH @@ -26,7 +26,7 @@ RUN git rev-parse HEAD | tee /version ## Beginning of runtime image -FROM python:3.10.1-slim-buster as final +FROM python:3.10.4-slim-buster as final RUN echo "Europe/Paris" > /etc/timezone diff --git a/main.py b/main.py index 78a9e89..4e7f8da 100644 --- a/main.py +++ b/main.py @@ -118,7 +118,7 @@ def get_delai(heure_passage: str) -> str: dt = datetime.strptime(heure_passage, "%Y-%m-%d %H:%M:%S") now = datetime.now() if now > dt: - return "Proche" + return "Passé" delai = dt - now minutes = delai.seconds // 60 if minutes <= 0: diff --git a/tasks.py b/tasks.py index 1b29bd7..9d7ceef 100644 --- a/tasks.py +++ b/tasks.py @@ -4,3 +4,13 @@ from invoke import task @task def run(ctx): ctx.run("uvicorn main:app --reload", pty=True, echo=True) + + +@task +def test(ctx): + ctx.run("pytest", pty=True, echo=True) + + +@task +def deploy(ctx): + ctx.run("ssh ubuntu /home/gaugendre/tcl-filtrage/update", pty=True, echo=True)