Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local installation failures #532

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions activate.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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