# HG changeset patch # User Anton Shestakov # Date 1704473905 10800 # Node ID da3fd8644ad9fe151d666c370a7fe8bc2d20b419 # Parent 9ceca9a4fb525ff9bd1b52f5e86ef9d02e39360c contrib: add a Dockerfile to run pytype using our CI setup locally diff -r 9ceca9a4fb52 -r da3fd8644ad9 contrib/docker/pytype/Dockerfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/docker/pytype/Dockerfile Fri Jan 05 13:58:25 2024 -0300 @@ -0,0 +1,14 @@ +FROM registry.heptapod.net/mercurial/ci-images/py3-hgext3rd:v2.0 + +USER ci-runner + +ENV PATH=/home/ci-runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PYTHONPATH=/home/ci-runner/.local/lib/python3.11/site-packages + +RUN python3 -m pip install --user --break-system-packages --upgrade pytype==2023.11.21 + +ADD --chown=ci-runner entrypoint.sh /home/ci-runner/entrypoint.sh + +RUN chmod -R a=rwX /home/ci-runner/.local/ /home/ci-runner/entrypoint.sh + +CMD /home/ci-runner/entrypoint.sh diff -r 9ceca9a4fb52 -r da3fd8644ad9 contrib/docker/pytype/README.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/docker/pytype/README.rst Fri Jan 05 13:58:25 2024 -0300 @@ -0,0 +1,10 @@ +Pytype in Docker +================ + +To build the container:: + + $ docker build --tag evolve-pytype-checker "$(hg root)/contrib/docker/pytype/" + +To check the code with pytype:: + + $ docker run --rm -it -u "$(id -u):$(id -g)" -v "$(hg root):/tmp/evolve-ci" -v "/path/to/mercurial-repo:/tmp/mercurial-ci" evolve-pytype-checker diff -r 9ceca9a4fb52 -r da3fd8644ad9 contrib/docker/pytype/entrypoint.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/docker/pytype/entrypoint.sh Fri Jan 05 13:58:25 2024 -0300 @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cd /tmp/mercurial-ci/ +make local +./contrib/setup-pytype.sh + +cd /tmp/evolve-ci/ +pytype --version +pytype --keep-going --jobs auto -P /tmp/mercurial-ci/:hgext3rd hgext3rd