You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tvalentyn (via GitHub)" <gi...@apache.org> on 2023/04/04 21:37:15 UTC

[GitHub] [beam] tvalentyn commented on a diff in pull request #25970: Use wheels for Dataflow postcommit tests

tvalentyn commented on code in PR #25970:
URL: https://github.com/apache/beam/pull/25970#discussion_r1157793358


##########
sdks/python/build.gradle:
##########
@@ -64,6 +65,49 @@ artifacts {
   distTarBall file: file("${buildDir}/${tarball}"), builtBy: sdist
 }
 
+// Create Python wheels for given platform and Python version
+// build identifiers for cibuildwheel
+def platform_identifiers_map = [
+  linux: 'manylinux_*64*', // e.g. manylinux_x86_64, manylinux_aarch64
+  macos:'macosx_*64*',     // e.g. macosx_x86_64, macosx_arm64
+  windows: 'win_*64*',     // e.g. win_amd64, win_arm64
+]
+
+platform_identifiers_map.each { platform, idsuffix ->
+  def archs = 'auto'
+  // note: A fix for arm64 platform in gradle environment. For some reason the
+  // task fails with "Invalid archs option {<Architecture.arm64: 'arm64'>}."
+  // even though os.arch is 'aarch64'
+  // Running cibuildwheel command directly in shell it succeeded, however
+  if (platform == 'linux' && 'aarch64'.equalsIgnoreCase(System.getProperty("os.arch"))) {
+    archs = 'aarch64'
+  }
+  getVersionsAsList('python_versions').each { it ->
+    def pyversion = it.replace('.', '')
+
+    project.tasks.register("bdistPy${pyversion}${platform}") {
+      description "Build a Python wheel distribution for Py${pyversion} ${platform}"
+      dependsOn setupVirtualenv
+      // need sdist task to generate protos
+      dependsOn ':sdks:python:sdist'
+
+      // generated installable Python SDK package
+      doLast {
+        exec {
+          environment CIBW_BUILD: "cp${pyversion}-${idsuffix}"
+          environment CIBW_ENVIRONMENT: "SETUPTOOLS_USE_DISTUTILS=stdlib"
+          environment CIBW_BEFORE_BUILD: "pip install cython numpy && pip install --upgrade setuptools"
+          // note: sync cibuildwheel version with GitHub Action build_wheel

Review Comment:
   lets add a pointer to exact place where this needs to be modified  and maybe make it a inline comment, and do the same in the counterpart where wheels are built.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org