diff --git a/Makefile b/Makefile index d35afc79..223df2e7 100644 --- a/Makefile +++ b/Makefile @@ -68,12 +68,11 @@ install-frontend: # Install Python dependencies. install-python: - python3 -m venv env - . env/bin/activate; pip install --upgrade pip - . env/bin/activate; pip install -r requirements.txt + uv venv env + . env/bin/activate && uv pip install --upgrade pip && uv pip install -r requirements.txt # Fetch and build all i18n files. -install-i18n: py-venv-check +install-i18n: python -m ambuda.scripts.fetch_i18n_files # Force a build with `-f`. Transifex files have a `fuzzy` annotation, so if # we build without this flag, then all of the files will be skipped with: @@ -87,7 +86,7 @@ install-i18n: py-venv-check # Upgrade an existing setup. upgrade: make install-frontend install-python - . env/bin/activate; make install-i18n + ./activate.sh install-i18n . env/bin/activate; alembic upgrade head . env/bin/activate; python -m ambuda.seed.lookup diff --git a/README.md b/README.md index 1096a56e..47c22f33 100644 --- a/README.md +++ b/README.md @@ -15,20 +15,23 @@ database. Quickstart ---------- -(This setup process requires Docker. If you don't have Docker installed on your -machine, you can install it [here][docker].) +(This setup process requires Docker and UV. If you don't have Docker installed on your +machine, you can install it [here][docker] and [here][uv].) To install and run Ambuda locally, please run the commands below: ``` $ git clone https://github.com/ambuda-org/ambuda.git $ cd ambuda +$ uv venv env +$ source env/bin/activate && uv pip install --upgrade pip && uv pip install -r requirements.txt $ make devserver ``` Then, navigate to `http://localhost:5000` in your web browser. [docker]: https://docs.docker.com/get-docker/ +[uv]: https://github.com/astral-sh/uv Documentation diff --git a/activate.sh b/activate.sh new file mode 100755 index 00000000..c5182571 --- /dev/null +++ b/activate.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -euo pipefail + +# Activate the virtual environment. +source env/bin/activate + +# "$@" expands to all arguments passed to the script +make "$@" +deactivate diff --git a/requirements.txt b/requirements.txt index ffb68c72..6a4bd747 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ babel==2.12.1 backports-functools-lru-cache==1.6.4 bcrypt==4.0.0 black==22.12.0 -celery==5.2.7 +celery==5.4.0 click==8.1.3 conllu==4.5.2 cryptography==38.0.1 @@ -23,19 +23,19 @@ google-api-core[grpc]==2.8.2 google-auth==2.9.0 google-cloud-vision==3.1.1 googleapis-common-protos==1.56.3 -greenlet==1.1.2 +greenlet==3.1.1 gunicorn==20.1.0 indic-transliteration==2.3.31 jinja2==3.1.2 -kombu==5.2.4 +kombu==5.4.2 linkify-it-py==2.0.0 -lxml==4.9.1 +lxml==5.3.0 mako==1.2.2 markdown-it-py==2.1.0 markupsafe==2.1.1 mypy-extensions==0.4.3 pillow==9.1.1 -pymupdf==1.20.2 +pymupdf==1.25.0 pytest==7.2.2 pytest-cov==4.0.0 python-dateutil==2.8.2 @@ -46,7 +46,7 @@ redis==4.3.4 regex==2022.6.2 requests==2.27.1 ruff==0.0.260 -sentry-sdk==1.6.0 +sentry-sdk==2.19.2 sphinx-rtd-theme==1.0.0 sphinx==5.0.2 sphinxcontrib-applehelp==1.0.2 @@ -57,5 +57,5 @@ sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 sqlalchemy==1.4.37 werkzeug==2.1.2 -wtforms==3.0.1 -wtforms-sqlalchemy==0.3 +wtforms==3.2.1 +wtforms-sqlalchemy==0.4.2