From 2d2634594ef4e5036e5c931adde4b44597808cfd Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 6 May 2022 02:23:39 -0400 Subject: [PATCH] Added basic cibuildwheel configuration and github actions file --- .github/workflows/cibuildwheels.yaml | 65 ++++++++++++++++++++++++++++ pyproject.toml | 10 +++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/cibuildwheels.yaml diff --git a/.github/workflows/cibuildwheels.yaml b/.github/workflows/cibuildwheels.yaml new file mode 100644 index 0000000000..07926efcef --- /dev/null +++ b/.github/workflows/cibuildwheels.yaml @@ -0,0 +1,65 @@ +name: Build wheels + +on: + pull_request: + branches: + - main + # paths-ignore: + # - "examples/**" + # - "doc/**" + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + # TODO: Add logic to run/ignore on [wheels-build] or [wheels-skip] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019, macos-10.15] + + steps: + - uses: actions/checkout@v2 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.5.0 + # to supply options, put them in 'env', like: + # env: + # CIBW_SOME_OPTION: value + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + + # upload_pypi: + # needs: [build_wheels, build_sdist] + # runs-on: ubuntu-latest + # # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # # alternatively, to publish when a GitHub Release is created, use the following rule: + # # if: github.event_name == 'release' && github.event.action == 'published' + # steps: + # - uses: actions/download-artifact@v2 + # with: + # name: artifact + # path: dist + + # - uses: pypa/gh-action-pypi-publish@v1.4.2 + # with: + # user: __token__ + # password: ${{ secrets.pypi_password }} + # # To test: repository_url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index f8498fde94..14d8cb4f91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,3 +90,13 @@ module = [ ignore_errors = true warn_unused_ignores = false + +[tool.cibuildwheel] +before-test = "" +test-requires = "pytest pytest-xdist" +# Need to change root directory, otherisw the plugin won't find setup.cfg +test-command = "(cd {project}; pytest --trace-config; pytest -n2 -q test --nomemory --notimingintensive)" + +build = "*" +skip = "cp36-* pp*" +test-skip = "" -- 2.47.3