-
Notifications
You must be signed in to change notification settings - Fork 0
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
Switch to poetry for dependency management #208
Changes from all commits
fca4f4d
2531def
398bd1c
f2533fc
0a55679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
FROM python:3.12-slim | ||
|
||
# Install GNU Parallel and other dependencies | ||
# Install GNU Parallel for benchmark runs | ||
RUN apt-get update && apt-get install -y parallel | ||
|
||
# Copy the entire project into the container | ||
COPY . /ucc | ||
# Install Poetry | ||
RUN pip3 install poetry==2.0.1 | ||
Comment on lines
+6
to
+7
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. Any reason not to use the "official installer" here? 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. Only (minor reason) was to avoid needing to 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.
ahh yeah true. I guess if it works, then 🤷🏻. I was just hesitant about using |
||
|
||
# Set the working directory to the root of your project | ||
WORKDIR /ucc | ||
|
||
# Set up the virtual environment | ||
RUN python3 -m venv /venv | ||
# Copy the entire project into the container | ||
COPY . /ucc | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=true \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
# Install (rarely changing) dependencies only using Poetry to leverage docker caching | ||
RUN --mount=type=cache,target=/tmp/poetry_cache poetry install --no-root | ||
|
||
# Install the `ucc` package itself | ||
RUN poetry install | ||
|
||
# Ensure the virtual environment is properly activated | ||
ENV VIRTUAL_ENV=/ucc/.venv | ||
ENV PATH="/ucc/.venv/bin:$PATH" | ||
|
||
# Install the required dependencies and the ucc package itself | ||
RUN /venv/bin/pip install --no-cache-dir -r /ucc/requirements.txt | ||
RUN /venv/bin/pip install -e . && /venv/bin/pip show ucc | ||
# Show installed package details | ||
RUN poetry run pip show ucc | ||
|
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.
Nice that you can use
poetry run
to run bash scripts!