Patchwork D10462: heptapod-ci: enable pytype checking

login
register
mail settings
Submitter phabricator
Date April 18, 2021, 5:36 a.m.
Message ID <differential-rev-PHID-DREV-kq74sudahmoaiwrkkswp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48779/
State Superseded
Headers show

Comments

phabricator - April 18, 2021, 5:36 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Python 3.6 isn't available at the moment in the image, so I hacked the test to
  use whatever version of python is available.  But it should probably be locked
  to the earliest supported version after fixing the image.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10462

AFFECTED FILES
  contrib/heptapod-ci.yml
  tests/test-check-pytype.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t
--- a/tests/test-check-pytype.t
+++ b/tests/test-check-pytype.t
@@ -55,7 +55,7 @@ 
 TODO: use --no-cache on test server?  Caching the files locally helps during
 development, but may be a hinderance for CI testing.
 
-  $ pytype -V 3.6 --keep-going --jobs auto mercurial \
+  $ pytype -V `"$PYTHON" -c 'import sys; print("%s.%s" % (sys.version_info[0], sys.version_info[1]))'` --keep-going --jobs auto mercurial \
   >    -x mercurial/bundlerepo.py \
   >    -x mercurial/changegroup.py \
   >    -x mercurial/chgserver.py \
diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml
--- a/contrib/heptapod-ci.yml
+++ b/contrib/heptapod-ci.yml
@@ -117,3 +117,17 @@ 
         PYTHON: python3
         RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
         TEST_HGMODULEPOLICY: "c"
+
+check-pytype-py3:
+    extends: .runtests_template
+    before_script:
+      - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
+      - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
+      - cd /tmp/mercurial-ci/
+      - make local PYTHON=$PYTHON
+      - $PYTHON -m pip install --user -U pytype==2021.04.09 cffi
+    variables:
+        RUNTEST_ARGS: " --allow-slow-tests tests/test-check-pytype.t"
+        PYTHON: python3
+        TEST_HGMODULEPOLICY: "c"
+        TEST_HGTESTS_ALLOW_NETIO: "1"