Patchwork D9724: ci: build python wheels

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-skrxyw36b3nvuwi533ys-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48035/
State New
Headers show

Comments

phabricator - Jan. 12, 2021, 12:07 p.m.
danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The wheels are merely attached to the job as artifacts. We could
  upload them to Heptapod or PyPI, but that's left for a possible followup.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/heptapod-ci.yml

CHANGE DETAILS




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

Patch

diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml
--- a/contrib/heptapod-ci.yml
+++ b/contrib/heptapod-ci.yml
@@ -1,5 +1,6 @@ 
 stages:
   - tests
+  - packages
   - phabricator
 
 image: registry.heptapod.net/mercurial/ci-images/mercurial-core
@@ -120,3 +121,42 @@ 
         PYTHON: python3
         RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
         TEST_HGMODULEPOLICY: "c"
+
+build-wheels-x86:
+    stage: packages
+    image: quay.io/pypa/${PLATFORM}
+    script:
+        - yum install -y gettext
+        - |
+            for pythondir in /opt/python/*
+            do
+                $pythondir/bin/pip install docutils pygments
+                $pythondir/bin/pip wheel --no-binary :all: -w wheelhouse/ .
+            done
+        - |
+            for whl in wheelhouse/*-linux_*.whl
+            do
+                auditwheel repair --plat "$PLATFORM" $whl
+            done
+        - rm -v wheelhouse/*-linux_*.whl
+        - mv -v wheelhouse/*.whl .
+    artifacts:
+        paths:
+            - "*.whl"
+    parallel:
+        matrix:
+            - PLATFORM:
+                    - manylinux1_i686
+                    - manylinux2010_i686
+                    # - manylinux2010_x86_64
+                    - manylinux2014_i686
+                    - manylinux2014_x86_64
+
+build-wheels-arm:
+    extends: build-wheels-x86
+    tags:
+        - arm64
+    parallel:
+        matrix:
+            - PLATFORM:
+                    - manylinux2014_aarch64