From 2b47cdf7b57ecf9614d184be393ff1b503bd8ccd Mon Sep 17 00:00:00 2001 From: Marcelo Duarte Date: Sun, 29 May 2022 03:33:49 -0300 Subject: [PATCH] Support for using embedded manylinux static libraries (#1504) --- .github/workflows/build-wheel.yml | 29 +++++++++++++++++++++++++---- pyproject.toml | 9 +++++++++ requirements-dev.txt | 1 + setup.cfg | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 0f4af75c9..e569c73f4 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -6,13 +6,14 @@ on: workflow_dispatch: jobs: - windows: - runs-on: windows-latest + build_wheel_windows: strategy: matrix: + os: [windows-latest] python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] architecture: [x86, x64] - name: Build [Windows ${{ matrix.architecture }}][Python ${{ matrix.python-version }}] + name: Build [${{ matrix.os }} ${{ matrix.architecture }}][Python ${{ matrix.python-version }}] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Setup Python @@ -40,9 +41,29 @@ jobs: with: name: cx-freeze-wheelhouse path: wheelhouse + build_wheel_unix: + strategy: + matrix: + os: [ubuntu-latest] + name: Build [${{ matrix.os }}] using cibuildwheel + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install cibuildwheel==2.5.0 + - name: Build the wheel + run: python -m cibuildwheel + - name: Upload the artifact + uses: actions/upload-artifact@v2 + with: + name: cx-freeze-wheelhouse + path: wheelhouse publish: needs: windows - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Publish package to PyPI steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index a0044231f..2825a0f21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,3 +49,12 @@ reports.output-format = "colorized" minversion = "6.0" addopts = "-ra" testpaths = ["tests"] + +[tool.cibuildwheel] +build-frontend = "build" +build-verbosity = "1" + +[tool.cibuildwheel.linux] +before-build = "(cd /opt/_internal && tar -xvf static-libs-for-embedding-only.tar.xz)" +build = "cp3*-manylinux_x86_64" +repair-wheel-command = "auditwheel repair -L /bases/lib -w {dest_dir} {wheel}" diff --git a/requirements-dev.txt b/requirements-dev.txt index 266eadc1c..f83cf77d7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,6 +12,7 @@ patchelf>=0.12 ;sys_platform == 'linux' bump2version>=1.0.1 pre-commit>=2.17.0 pylint>=2.13.0 +cibuildwheel==2.5.0 ;sys_platform == 'linux' #doc sphinx==4.5.0 sphinx-rtd-theme==1.0.0 diff --git a/setup.cfg b/setup.cfg index 0208140ba..461053295 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,6 +58,7 @@ dev = bump2version>=1.0.1 pre-commit>=2.17.0 pylint>=2.13.0 + cibuildwheel==2.5.0 ;sys_platform == 'linux' doc = sphinx==4.5.0 sphinx-rtd-theme==1.0.0