Skip to content

Commit aaaca91

Browse files
authored
bump Poetry to v2.1.1 (#1534)
1 parent 16fa0cc commit aaaca91

File tree

7 files changed

+1916
-1467
lines changed

7 files changed

+1916
-1467
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Fetch base and install Poetry
1919
run: |
2020
git fetch origin ${{github.base_ref}}
21-
pipx install poetry
21+
pipx install poetry==2.1.1
2222
2323
- name: Setup Python
2424
uses: actions/setup-python@v4
@@ -31,7 +31,7 @@ jobs:
3131
cp --force designsafe/templates/base.j2 designsafe/templates/base.html
3232
3333
- run: |
34-
poetry install
34+
poetry sync
3535
3636
- name: Run Server-side unit tests and generate coverage report
3737
run: |
@@ -45,7 +45,7 @@ jobs:
4545
- name: Fetch base and install Poetry
4646
run: |
4747
git fetch origin ${{github.base_ref}}
48-
pipx install poetry
48+
pipx install poetry==2.1.1
4949
5050
- name: Setup Python
5151
uses: actions/setup-python@v4
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Install Python Packages
5757
run: |
58-
poetry install
58+
poetry sync
5959
6060
- name: Run Server-side linting with pytest
6161
# Only run on new files for now-- for all changes, filter is ACMRTUXB

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ docs/_build/
9696
.docs/build
9797
target/
9898
venv/
99+
.venv/
99100
metrics/
100-
.python-version
101101

102102
# ignore Google Drive API secrets
103103
*secrets.json

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ build:
1212
build-dev:
1313
docker compose -f ./conf/docker/docker-compose-dev.yml build
1414

15+
.PHONY: python-install
16+
python-install:
17+
pyenv local 3.11 && POETRY_VIRTUALENVS_IN_PROJECT=true poetry sync || echo \
18+
'Command failed. Do you have Poetry (https://python-poetry.org/docs/#installation) \
19+
and pyenv (https://github.com/pyenv/pyenv?tab=readme-ov-file#a-getting-pyenv) installed? \
20+
You may also need to run "pyenv install 3.11".'
21+
22+
1523
.PHONY: start
1624
start:
1725
docker compose --env-file $(NGROK_ENV_FILE) -f ./conf/docker/docker-compose-dev.all.debug.yml up

conf/docker/Dockerfile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,43 @@ ENV LC_ALL en_US.utf-8
3434
ENV LANG en_US.utf-8
3535

3636
# https://python-poetry.org/docs/configuration/#using-environment-variables
37-
ENV POETRY_VERSION=1.8.2 \
38-
POETRY_HOME="/opt/poetry" \
37+
ENV POETRY_VERSION=2.1.1 \
3938
POETRY_VIRTUALENVS_IN_PROJECT=true \
4039
PYSETUP_PATH="/opt/pysetup" \
41-
VENV_PATH="/opt/pysetup/.venv"
40+
VENV_PATH="/opt/pysetup/.venv" \
41+
PIPX_ROOT_PATH="/root/.local/bin"
4242

43-
# Prepend venv and poetry to path
44-
ENV PATH="$VENV_PATH/bin:$POETRY_HOME/bin:$PATH"
43+
# Install pipx and poetry
44+
RUN python3 -m pip install --user pipx && python3 -m pipx ensurepath
45+
ENV PATH="${PIPX_ROOT_PATH}:${VENV_PATH}/bin:$PATH"
46+
RUN pipx install poetry==2.1.1
4547

4648
RUN groupadd --gid 816877 G-816877 && \
4749
useradd --uid 458981 --gid G-816877 -m --shell /bin/bash tg458981 -d /home/tg458981
4850

49-
# Install poetry version $POETRY_VERSION to $POETRY_HOME
50-
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
51-
&& python3 -m venv "$POETRY_HOME" \
52-
&& "$POETRY_HOME/bin/pip" install --no-cache-dir poetry=="$POETRY_VERSION"
53-
5451
# Copy project requirement files here to ensure they will be cached.
5552
WORKDIR $PYSETUP_PATH
56-
COPY poetry.lock pyproject.toml ./
53+
COPY pyproject.toml poetry.lock ./
5754

5855
##############
5956
# `development` image target is used for local development
6057
FROM python-base as development
6158

62-
RUN "$POETRY_HOME/bin/poetry" install
59+
RUN poetry sync
6360

6461
# Copy in base project directory without built client assets for local development
6562
COPY --chown=tg458981:G-816877 . /srv/www/designsafe
6663

6764
USER tg458981
6865

69-
# Install dev dependencies
70-
RUN "$POETRY_HOME/bin/poetry" install --with dev
71-
7266
WORKDIR /srv/www/designsafe
7367

7468
##############
7569
# `production` image target is used for deployed runtime environments
7670
FROM python-base as production
7771

7872
# Install runtime dependencies
79-
RUN "$POETRY_HOME/bin/poetry" install --without dev
73+
RUN poetry sync --without=dev
8074

8175
# Copy in built client assets
8276
COPY --from=node_build --chown=tg458981:G-816877 /designsafe/ /srv/www/designsafe

conf/nginx/nginx.debug.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ http {
4343
}
4444

4545
server {
46-
listen 443 ssl http2;
46+
listen 443 ssl;
47+
http2 on;
4748
server_name designsafe.dev;
4849

4950
charset utf-8;

0 commit comments

Comments
 (0)