From af854f448b525ba4a558b5898f61ae3e8d325eb8 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Fri, 22 Sep 2023 18:56:17 -0400 Subject: [PATCH] Adding helper functions for dependency management --- requirements.in | 11 ++++++----- requirements.txt | 8 +++++++- tasks.py | 12 ++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/requirements.in b/requirements.in index 1d1ece6..8ab06f6 100644 --- a/requirements.in +++ b/requirements.in @@ -1,5 +1,6 @@ -alembic -flask -pydantic -pydantic-settings -sqlalchemy +alembic>=1.12.0,<2.0 +flask>=2.3.3,<3.0 +flask-login>=0.6.2,<1.0 +pydantic>=2.3.0,<3.0 +pydantic-settings>=2.0.3,<3.0 +sqlalchemy>=2.0.20<3.0 diff --git a/requirements.txt b/requirements.txt index 71c0344..770890c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,6 +13,10 @@ blinker==1.6.2 click==8.1.7 # via flask flask==2.3.3 + # via + # -r requirements.in + # flask-login +flask-login==0.6.2 # via -r requirements.in greenlet==2.0.2 # via sqlalchemy @@ -48,4 +52,6 @@ typing-extensions==4.7.1 # pydantic-core # sqlalchemy werkzeug==2.3.7 - # via flask + # via + # flask + # flask-login diff --git a/tasks.py b/tasks.py index 11f1542..b93ee66 100644 --- a/tasks.py +++ b/tasks.py @@ -4,6 +4,18 @@ from invoke import Failure from invoke import task +@task +def update_deps(c): + """Resolves production requirements.""" + c.run("pip-compile requirements.in", pty=True) + + +@task +def install_deps(c): + """Installs dev and production requirements.""" + c.run("pip-sync requirements.txt dev-requirements.txt", pty=True) + + @task def serve_dev(c, debugger=True, reload=True, threads=True, port=8888, host="0.0.0.0"): """Serves the htmx_contact.app locally"""