-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use poetry for dependency management #394
Changes from 13 commits
9e80e5a
6d08089
fddffdb
3e2d305
95cf532
d495a90
6096b99
e8d2353
cf2bcd0
71f979e
ee34451
cd9d8a1
ab3eb5b
88da5d4
b4e853a
6108cf3
e20df57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
grahamalama marked this conversation as resolved.
Show resolved
Hide resolved
grahamalama marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
version: 2 | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
jobs: | ||
post_create_environment: | ||
- pip install poetry | ||
- poetry config virtualenvs.create false | ||
post_install: | ||
- poetry install --only docs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
FROM python:3.11.2 as compile | ||
|
||
ENV VIRTUAL_ENV=/opt/venv | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
ENV PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
POETRY_HOME="/opt/poetry" \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=true \ | ||
VIRTUAL_ENV=/opt/.venv \ | ||
PATH="/opt/.venv/bin:$PATH" | ||
|
||
# Install Poetry | ||
RUN python -m venv $POETRY_HOME && \ | ||
$POETRY_HOME/bin/pip install poetry==1.4.1 && \ | ||
$POETRY_HOME/bin/poetry --version | ||
|
||
WORKDIR /opt | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt && \ | ||
COPY ./poetry.lock ./pyproject.toml ./ | ||
RUN $POETRY_HOME/bin/poetry install --only main --no-root && \ | ||
uwsgi --build-plugin https://github.com/Datadog/uwsgi-dogstatsd | ||
|
||
# though we have kinto-remote-settings specified as a dependency in | ||
# pyproject.toml, we have it configured to install in editable mode for local | ||
# development. For building the container, we only install the "main" | ||
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.
because we use 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. I think |
||
# dependency group so that we can use pip to install the packages in | ||
# non-editable mode | ||
COPY ./kinto-remote-settings ./kinto-remote-settings | ||
COPY VERSION . | ||
RUN pip install --no-cache-dir ./kinto-remote-settings | ||
RUN pip install ./kinto-remote-settings | ||
|
||
FROM python:3.11.2-slim as production | ||
|
||
ENV KINTO_INI=config/local.ini \ | ||
PATH="/opt/venv/bin:$PATH" \ | ||
PATH="/opt/.venv/bin:$PATH" \ | ||
PORT=8888 \ | ||
PYTHONUNBUFFERED=1 \ | ||
VIRTUAL_ENV=/opt/venv | ||
VIRTUAL_ENV=/opt/.venv | ||
|
||
COPY /bin/update_and_install_system_packages.sh /opt | ||
RUN /opt/update_and_install_system_packages.sh \ | ||
|
This file was deleted.
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.
is there a tag
cimg/python:3.11
? ie. do we want to tag minor here?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.
There is, but I thought it'd be good to make sure we use the same patch version that we use in our Dockerfile. Or is that being too careful?
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.
Being careful is good :) I was thinking that we could have a test that verifies that both versions are in sync. I doubt that dependabot will upgrade this line. Will it?
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.
Yeah, I don't think it will update this line.
We're actually in an interesting situation now where there's a
python:3.11.3
published, but there isn't acimg/python:3.11.3
yetThere 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.
#406