-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply linting, add missing type hints
- add missing type hints - remove mypy: checks weren't running - configure ruff checks - remove black; use ruff instead - add 'format' tox command - optimise Dockerfile to avoid rebuilding the venv on any source change
- Loading branch information
Showing
16 changed files
with
138 additions
and
67 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,6 +1,6 @@ | ||
clones | ||
.tox | ||
**/__pycache__/ | ||
/.coverage | ||
/.tox | ||
/clones | ||
/config.toml | ||
.coverage | ||
tests_output | ||
/tests_output |
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,27 +1,32 @@ | ||
FROM python:3.12-slim | ||
|
||
WORKDIR /app | ||
|
||
RUN groupadd --gid 10001 app \ | ||
&& useradd -m -g app --uid 10001 -s /usr/sbin/nologin app | ||
&& useradd -m -g app --uid 10001 -d /app -s /usr/sbin/nologin app | ||
|
||
RUN apt-get update && \ | ||
apt-get install --yes git mercurial curl vim && \ | ||
apt-get -q --yes autoremove && \ | ||
apt-get clean && \ | ||
rm -rf /root/.cache | ||
|
||
WORKDIR /app | ||
|
||
# git-cinnabar | ||
COPY install_git-cinnabar.sh . | ||
RUN ./install_git-cinnabar.sh | ||
RUN mv git-cinnabar git-remote-hg /usr/bin/ | ||
|
||
# install test dependencies | ||
RUN pip install -U pip pytest pytest-mock pytest-cov | ||
RUN pip install -U pip pytest pytest-mock pytest-cov pip-tools | ||
|
||
# Copy local code to the container image. | ||
COPY . /app | ||
RUN chown -R app: /app | ||
# setup just the venv so changes to the source won't require a full venv | ||
# rebuild | ||
COPY --chown=app:app README.md . | ||
COPY --chown=app:app pyproject.toml . | ||
RUN pip-compile --verbose pyproject.toml | ||
RUN pip install -r requirements.txt | ||
|
||
# copy app and install | ||
COPY --chown=app:app . /app | ||
RUN pip install /app | ||
USER app | ||
RUN pip install -e . |
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
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
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
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
Oops, something went wrong.