Reword past passages
This commit is contained in:
parent
96e3efac94
commit
122da21a07
5 changed files with 18 additions and 13 deletions
|
@ -1,17 +1,12 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.0.1
|
rev: v4.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-ast
|
- id: check-ast
|
||||||
types: [python]
|
|
||||||
- id: check-json
|
- id: check-json
|
||||||
types: [json]
|
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
types: [toml]
|
|
||||||
- id: check-xml
|
- id: check-xml
|
||||||
types: [xml]
|
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
types: [yaml]
|
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: pretty-format-json
|
- id: pretty-format-json
|
||||||
|
@ -22,12 +17,12 @@ repos:
|
||||||
args:
|
args:
|
||||||
- --markdown-linebreak-ext=md
|
- --markdown-linebreak-ext=md
|
||||||
- repo: https://github.com/timothycrosley/isort
|
- repo: https://github.com/timothycrosley/isort
|
||||||
rev: 5.9.2
|
rev: 5.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
types: [python]
|
types: [python]
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 21.6b0
|
rev: 22.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
tcl-filtrage
|
tcl
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
## Build venv
|
## Build venv
|
||||||
FROM python:3.10.1-buster AS venv
|
FROM python:3.10.4-buster AS venv
|
||||||
|
|
||||||
# https://python-poetry.org/docs/#installation
|
# 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 -
|
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
|
||||||
|
|
||||||
ENV PATH /root/.local/bin:$PATH
|
ENV PATH /root/.local/bin:$PATH
|
||||||
|
@ -26,7 +26,7 @@ RUN git rev-parse HEAD | tee /version
|
||||||
|
|
||||||
|
|
||||||
## Beginning of runtime image
|
## 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
|
RUN echo "Europe/Paris" > /etc/timezone
|
||||||
|
|
||||||
|
|
2
main.py
2
main.py
|
@ -118,7 +118,7 @@ def get_delai(heure_passage: str) -> str:
|
||||||
dt = datetime.strptime(heure_passage, "%Y-%m-%d %H:%M:%S")
|
dt = datetime.strptime(heure_passage, "%Y-%m-%d %H:%M:%S")
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
if now > dt:
|
if now > dt:
|
||||||
return "Proche"
|
return "Passé"
|
||||||
delai = dt - now
|
delai = dt - now
|
||||||
minutes = delai.seconds // 60
|
minutes = delai.seconds // 60
|
||||||
if minutes <= 0:
|
if minutes <= 0:
|
||||||
|
|
10
tasks.py
10
tasks.py
|
@ -4,3 +4,13 @@ from invoke import task
|
||||||
@task
|
@task
|
||||||
def run(ctx):
|
def run(ctx):
|
||||||
ctx.run("uvicorn main:app --reload", pty=True, echo=True)
|
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)
|
||||||
|
|
Reference in a new issue