-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize development dependencies / refactor GHA workflow (#153)
* Standardize development dependencies There seems to be a preference towards using `requirements-dev.txt` vs. a `dev` extra for development dependencies, but right now neither `pip install -r requirements-dev.txt` nor `pip install -e ".[dev]" is enough to install all development dependencies. I’ve added any dependencies listed in the `dev` extra to `requirements-dev.txt` and removed the `dev` extra so that we only have one list of dev dependencies to maintain. This also pins the `moto` package (used to mock S3 in tests) to version 4.x as version 5 release a few days ago contains breaking changes. * Remove unnecessary setup in GitHub Actions workflow This seems to be left over from when we still used to run tests directly in GHA runners. * Install servicelayer before running tests Tests in `test_extensions.py` rely on `servicelayer` being installed as they ultimately read information from the egg info that is created during installation. This is basically equivalent to the previous setup which executed `pip install -e .` outside of the container. As the entire directory is mounted into the container, the egg info subsequently was also available inside of the container. While that worked I found the fact that installing something outside of the container could make the tests fail or pass quite confusing. This should be a little more explicit. * Run everything inside of the docker container Running some steps outside and some inside of the container leads to weird behavior, e.g. when file permissions/owners do not match across steps. * Slim down Docker image This uses a pre-built Python image based on Debian as this should be much faster than building a custom image on top of a full-feature Ubuntu. * Add separate Makefile target to run tests without starting a Docker container
- Loading branch information
1 parent
fc56a38
commit d242b89
Showing
6 changed files
with
23 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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 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,20 +1,10 @@ | ||
FROM ubuntu:20.04 | ||
ENV DEBIAN_FRONTEND noninteractive | ||
FROM python:3.12-slim | ||
|
||
RUN apt-get -qq -y update \ | ||
&& apt-get -qq -y install python3-pip \ | ||
pkg-config libicu-dev \ | ||
&& apt-get -qq -y autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN pip3 install --no-binary=:pyicu: pyicu | ||
|
||
ENV LANG='en_US.UTF-8' | ||
RUN apt-get update | ||
RUN apt-get install make | ||
|
||
COPY . /opt/servicelayer | ||
WORKDIR /opt/servicelayer | ||
RUN pip3 install -q --no-cache-dir -e /opt/servicelayer[dev] | ||
RUN pip3 install -r requirements.txt | ||
RUN make dev | ||
|
||
CMD /bin/bash | ||
CMD /bin/bash |
This file contains 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 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 |
---|---|---|
|
@@ -5,3 +5,6 @@ pytest-env==1.1.3 | |
pytest-cov==5.0.0 | ||
pytest-mock==3.14.0 | ||
wheel==0.43.0 | ||
twine==4.0.2 | ||
moto==4.2.14 | ||
boto3==1.34.32 |
This file contains 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 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