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

For discussion only: Updates for macOS dev #196

Draft
wants to merge 4 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
4 changes: 2 additions & 2 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.12
- name: Configure cache
id: python-cache
uses: actions/cache@v2
Expand Down
27 changes: 26 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,29 @@ pytest

Transliteration requires installing the [PyICU](https://pypi.org/project/PyICU/) bindings.

See the documentation ["Installing PyICU"](https://gitlab.pyicu.org/main/pyicu#installing-pyicu) for additional instructions for your operating system.
See the documentation ["Installing PyICU"](https://gitlab.pyicu.org/main/pyicu#installing-pyicu) for additional instructions for your operating system.

For macOS, you can try the following:

Install `icu4c`:
```
brew install icu4c
```

Determine the installed version:
```
ls $HOMEBREW_CELLAR/icu4c
```

In my case, it was 73.2

Set up required environment variables for the PyICU build process.

```
export ICU_VERSION=73 # required because PyICU detects this using
# pkg-config, but icu4c does not register
# itself with pkg-config in recent versions
export PYICU_INCLUDES=$HOMEBREW_CELLAR/icu4c/73.2/include
export PYICU_LFLAGS=-L$HOMEBREW_CELLAR/icu4c/73.2/lib
pip install "PyICU>=2.9,<3"
```
4 changes: 2 additions & 2 deletions backend/backend-dev.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9 AS build
FROM python:3.12 AS build
WORKDIR /opt/scaife-stack/src/
RUN pip install --disable-pip-version-check --upgrade pip setuptools wheel virtualenv
ENV PATH="/opt/scaife-stack/bin:${PATH}" VIRTUAL_ENV="/opt/scaife-stack"
Expand All @@ -7,7 +7,7 @@ RUN set -x \
&& virtualenv /opt/scaife-stack \
&& pip install -r requirements-dev.txt

FROM python:3.9
FROM python:3.12
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/opt/scaife-stack/src/ \
Expand Down
4 changes: 2 additions & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ gunicorn==20.0.0
# TODO: Package in scaife-viewer-atlas
jsonlines==2.0.0
more_itertools==8.12.0
pandas==1.5.2
pandas<2
pygtrie==2.5.0
PyICU>=2.9,<3
requests>=2.0.6
scaife-viewer-atlas @https://github.com/scaife-viewer/backend/archive/17bb7d538e1d89a7c81574f435d292d4c1a98134.zip#subdirectory=atlas
scaife-viewer-atlas @https://github.com/scaife-viewer/backend/archive/89bb569d97e629b7e1f46f0948a321d1a42d0b59.zip#subdirectory=atlas
thefuzz==0.19.0
whitenoise==4.1.4
2 changes: 1 addition & 1 deletion heroku.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN yarn build
# # # # # # # # # # # # # # # # # # # # # # # #
# backend
# # # # # # # # # # # # # # # # # # # # # # # #
FROM python:3.9 AS backend-build
FROM python:3.12 AS backend-build
WORKDIR /opt/scaife-stack/src/
RUN pip install --disable-pip-version-check --upgrade pip setuptools wheel virtualenv
ENV PATH="/opt/scaife-stack/bin:${PATH}" VIRTUAL_ENV="/opt/scaife-stack"
Expand Down
Loading