Skip to content

Commit

Permalink
BLD: Update base dockerfile to use pyproject.toml (#1332)
Browse files Browse the repository at this point in the history
* BLD: Update base dockerfile to use pyproject.toml

This should have been done when migrating the project requirements
from the old setup to pyproject.

* Update base Dockerfile

* Update development Dockerfile

* Update base Dockerfile

* Update stable Dockerfile
  • Loading branch information
keileg authored Feb 13, 2025
1 parent 37f7e92 commit 226d588
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
10 changes: 8 additions & 2 deletions dockerfiles/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ RUN git clone https://github.com/pmgbergen/porepy.git ${POREPY_HOME}
# Move to PorePy sub-directory
WORKDIR ${POREPY_HOME}

# Fetch the dependencies from the pyproject.toml file, including testing and development, and install them.
RUN pip install -e .[testing,development]

# Install pypardiso. This will also install mkl and some other packages, all of which
# are useful for achieving good performance.
RUN pip install pypardiso

# Install dependencies
RUN pip install -r ./requirements.txt
# Run a pip freeze to know what been installed.
RUN pip freeze

# Add PorePy home to the pythonpath. This may or may not be necessary.
ENV PYTHONPATH $POREPY_HOME:$PYTHONPATH

# Move back to code directory
WORKDIR ${HOME}
Expand Down
11 changes: 1 addition & 10 deletions dockerfiles/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,10 @@ WORKDIR ${POREPY_HOME}
# Make sure we're on the develop branch
RUN git checkout develop && git pull

# Do the install
RUN pip install -e .

# Run a pip freeze. It is always good to know what been installed
RUN pip freeze

# Add PorePy home to the pythonpath. This may or may not be necessary.
ENV PYTHONPATH $POREPY_HOME:$PYTHONPATH

# Run tests to check that everything works.
# NOTE: When run as a GH action (presumably after a PR to the develop branch
# was accepted, e.g., when the tests have already been run on GH), this should
# only fail if the docker image itself is flawed.
WORKDIR ${POREPY_HOME}/tests
RUN pytest
WORKDIR ${POREPY_HOME}
WORKDIR ${POREPY_HOME}
11 changes: 1 addition & 10 deletions dockerfiles/stable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,10 @@ WORKDIR ${POREPY_HOME}
# Make sure we're on the main branch
RUN git checkout main && git pull

# Do the install
RUN pip install -e .

# Run a pip freeze. It is always good to know what been installed.
RUN pip freeze

# Add PorePy home to the pythonpath. This may or may not be necessary.
ENV PYTHONPATH $POREPY_HOME:$PYTHONPATH

# Run tests to check that everything works.
# NOTE: When run as a GH action (presumably after a PR to the develop branch
# was accepted, e.g., when the tests have already been run on GH), this should
# only fail if the docker image itself is flawed.
WORKDIR ${POREPY_HOME}/tests
RUN pytest
WORKDIR ${POREPY_HOME}
WORKDIR ${POREPY_HOME}

0 comments on commit 226d588

Please sign in to comment.