Skip to content

Commit 375cf66

Browse files
committed
#85 + docker must have separated .venv from local because of symlinks
1 parent 66359b9 commit 375cf66

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ text_extract_api/__pycache__/*
33
.env.local
44
*.pyc
55
.venv
6+
.dvenv
67
.DS_Store
78
storage/*
89
client_secret*.json

scripts/entrypoint.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
PYPROJECT_HASH_FILE=".pyproject.hash"
44
CURRENT_HASH=$(sha256sum pyproject.toml | awk '{ print $1 }')
55

6-
if [ ! -d ".venv" ] || [ ! -f "$PYPROJECT_HASH_FILE" ] || [ "$(cat $PYPROJECT_HASH_FILE)" != "$CURRENT_HASH" ]; then
7-
echo "Dependencies have changed or .venv is missing. Reinstalling..."
8-
python -m venv .venv
9-
source .venv/bin/activate
6+
7+
if [ ! -d ".dvenv" ] || [ ! -f "$PYPROJECT_HASH_FILE" ] || [ "$(cat $PYPROJECT_HASH_FILE)" != "$CURRENT_HASH" ]; then
8+
echo "Dependencies have changed or .dvenv is missing. Reinstalling..."
9+
python -m venv .dvenv
10+
source .dvenv/bin/activate
1011
pip install --upgrade pip setuptools wheel
1112
pip install .
1213
echo "$CURRENT_HASH" > "$PYPROJECT_HASH_FILE"
1314
else
15+
python3 -m venv --upgrade /app/.dvenv # temporary :(
1416
echo "Virtual environment is up to date."
1517
fi
1618

17-
source .venv/bin/activate
19+
source .dvenv/bin/activate
1820

1921
if [ "$APP_MODE" = "celery" ]; then
2022
echo "Starting Celery worker..."

0 commit comments

Comments
 (0)