-
Notifications
You must be signed in to change notification settings - Fork 66
[ENG-7411] poetry and assorted cleanup #852
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
Merged
aaxelb
merged 19 commits into
CenterForOpenScience:feature/share-cleanupgrade-2025
from
aaxelb:mob/2025-03-26
Apr 18, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8465f08
wip: poetry
aaxelb 8a1ebac
wip
aaxelb 7b92a4f
wip
aaxelb 2b137f6
shtrove not installable (...yet)
aaxelb 68bf437
wip (poetry run)
aaxelb 512f89d
try specifying source for coverage
aaxelb bb24a8e
wip (python version range)
aaxelb 2514ad6
remove py3.10 tests
aaxelb 636de98
bump deps; fix build after py-upgrade merge
aaxelb 95790ca
poetry config: explicit package-mode
aaxelb 2448562
remove elasticsearch5 use
aaxelb 3b7176b
remove trove_indexcard_flats index strategy
aaxelb 2a50077
use python deps from the built image
aaxelb 28e507f
Revert "use python deps from the built image"
aaxelb 8502306
fix requirements in docker-compose
aaxelb 25bf800
clarify poetry venv usage
aaxelb bd055bb
finish removing elasticsearch5
aaxelb 19344e1
fix: dockerfile warnings
aaxelb e698c8d
add toml (for coveralls)
aaxelb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ docker-compose.yml | |
.gitignore | ||
celerybeat.pid | ||
/static/ | ||
.venv/ | ||
|
||
/au.*/ | ||
/be.*/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.13-slim-bullseye as app | ||
FROM python:3.13-slim-bullseye AS app | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
|
@@ -25,35 +25,49 @@ RUN update-ca-certificates | |
RUN mkdir -p /code | ||
WORKDIR /code | ||
|
||
RUN pip install -U pip | ||
RUN pip install uwsgi==2.0.27 | ||
### | ||
# python dependencies | ||
|
||
COPY ./requirements.txt /code/requirements.txt | ||
COPY ./constraints.txt /code/constraints.txt | ||
# note: installs dependencies on the system, roundabouts `/usr/local/lib/python3.13/site-packages/` | ||
|
||
RUN pip install --no-cache-dir -c /code/constraints.txt -r /code/requirements.txt | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_OPTIONS_ALWAYS_COPY=1 \ | ||
POETRY_VIRTUALENVS_CREATE=0 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=0 \ | ||
POETRY_CACHE_DIR=/tmp/poetry-cache \ | ||
POETRY_HOME=/tmp/poetry-venv | ||
|
||
RUN python -m venv $POETRY_HOME | ||
|
||
RUN $POETRY_HOME/bin/pip install poetry==2.1.1 | ||
|
||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
|
||
RUN $POETRY_HOME/bin/poetry install --compile | ||
|
||
RUN apt-get remove -y \ | ||
gcc \ | ||
zlib1g-dev | ||
zlib1g-dev \ | ||
&& apt-get autoremove -y | ||
|
||
COPY ./ /code/ | ||
|
||
RUN python manage.py collectstatic --noinput | ||
|
||
ARG GIT_TAG= | ||
ARG GIT_COMMIT= | ||
ENV VERSION ${GIT_TAG} | ||
ENV GIT_COMMIT ${GIT_COMMIT} | ||
|
||
RUN python setup.py develop | ||
ENV VERSION=${GIT_TAG} | ||
ENV GIT_COMMIT=${GIT_COMMIT} | ||
|
||
CMD ["python", "manage.py", "--help"] | ||
|
||
### Dist | ||
FROM app AS dist | ||
|
||
RUN $POETRY_HOME/bin/poetry install --compile --only deploy | ||
|
||
### Dev | ||
FROM app AS dev | ||
|
||
RUN pip install --no-cache-dir -c /code/constraints.txt -r /code/dev-requirements.txt | ||
RUN $POETRY_HOME/bin/poetry install --compile --only dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. Docker build had a few nitpicks, but these aren't dealbreakers:
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be pinned to the same version as the Dockerfile (2.1.1)? I don't have a strong opinion. It might be worth to leave unpinned as a canary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also no strong opinion -- leaving it unpinned as canary seems a fine idea