From ad501cdd463a9a63cd1c3af10446020295847b47 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Mon, 22 Jan 2024 15:53:21 +0000 Subject: [PATCH 1/3] created ci-wheels --- .github/workflows/ci-wheels.yml | 139 ++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 .github/workflows/ci-wheels.yml diff --git a/.github/workflows/ci-wheels.yml b/.github/workflows/ci-wheels.yml new file mode 100644 index 0000000..edacae0 --- /dev/null +++ b/.github/workflows/ci-wheels.yml @@ -0,0 +1,139 @@ +# Reference: +# - https://github.com/actions/checkout +# - https://github.com/actions/download-artifact +# - https://github.com/actions/upload-artifact +# - https://github.com/pypa/cibuildwheel +# - https://github.com/pypa/build +# - https://github.com/pypa/gh-action-pypi-publish +# - https://test.pypi.org/help/#apitoken + +name: ci-wheels + +on: + pull_request: + + push: + branches: + - "main" + - "v*x" + - "!auto-update-lockfiles" + - "!pre-commit-ci-update-config" + - "!dependabot/*" + tags: + - "v*" + +jobs: + build_bdist: + name: "build ${{ matrix.os }} (${{ matrix.arch }}) wheels" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + arch: ["x86_64", "arm64"] + exclude: + - os: "ubuntu-latest" + arch: "arm64" + - os: "windows-latest" + arch: "x86_64" + - os: "windows-latest" + arch: "arm64" + include: + - os: "windows-latest" + arch: "AMD64" + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "build ${{ matrix.os }} (${{ matrix.arch }}) wheels" + uses: pypa/cibuildwheel@v2.16.2 + env: + CIBW_SKIP: "cp36-* cp37-* cp312-* pp* *-musllinux*" + CIBW_ARCHS: ${{ matrix.arch }} + CIBW_BUILD_FRONTEND: "build" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" + CIBW_TEST_SKIP: "*-macosx_arm64" + CIBW_TEST_REQUIRES: "pytest" + CIBW_TEST_COMMAND: > + python -m pytest --pyargs tephi + + - uses: actions/upload-artifact@v4 + with: + name: pypi-${{ matrix.os }}-${{ matrix.arch }}-artifact + path: ${{ github.workspace }}/wheelhouse/*.whl + + + build_sdist: + name: "Build sdist" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Building sdist" + shell: bash + run: | + pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: pypi-sdist + path: ${{ github.workspace }}/dist/*.tar.gz + + + show-artifacts: + needs: [build_bdist, build_sdist] + name: "Show artifacts" + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: ${{ github.workspace }}/dist + + - shell: bash + run: | + ls -l ${{ github.workspace }}/dist + + + publish-artifacts-test-pypi: + needs: [build_bdist, build_sdist] + name: "Publish to Test PyPI" + runs-on: ubuntu-latest + # upload to Test PyPI for every commit on main branch + if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' + steps: + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: ${{ github.workspace }}/dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI }} + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + print_hash: true + + + publish-artifacts-pypi: + needs: [build_bdist, build_sdist] + name: "Publish to PyPI" + runs-on: ubuntu-latest + # upload to PyPI for every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: ${{ github.workspace }}/dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI }} + print_hash: true \ No newline at end of file From 7dc33c866a80a2899d169bd20dc89c0e4a5f23a2 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Tue, 23 Jan 2024 09:18:10 +0000 Subject: [PATCH 2/3] removed build-wheel section --- .github/workflows/ci-wheels.yml | 19 ------------------- pyproject.toml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-wheels.yml b/.github/workflows/ci-wheels.yml index edacae0..72407d7 100644 --- a/.github/workflows/ci-wheels.yml +++ b/.github/workflows/ci-wheels.yml @@ -47,24 +47,6 @@ jobs: with: fetch-depth: 0 - - name: "build ${{ matrix.os }} (${{ matrix.arch }}) wheels" - uses: pypa/cibuildwheel@v2.16.2 - env: - CIBW_SKIP: "cp36-* cp37-* cp312-* pp* *-musllinux*" - CIBW_ARCHS: ${{ matrix.arch }} - CIBW_BUILD_FRONTEND: "build" - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" - CIBW_TEST_SKIP: "*-macosx_arm64" - CIBW_TEST_REQUIRES: "pytest" - CIBW_TEST_COMMAND: > - python -m pytest --pyargs tephi - - - uses: actions/upload-artifact@v4 - with: - name: pypi-${{ matrix.os }}-${{ matrix.arch }}-artifact - path: ${{ github.workspace }}/wheelhouse/*.whl - - build_sdist: name: "Build sdist" runs-on: ubuntu-latest @@ -119,7 +101,6 @@ jobs: skip_existing: true print_hash: true - publish-artifacts-pypi: needs: [build_bdist, build_sdist] name: "Publish to PyPI" diff --git a/pyproject.toml b/pyproject.toml index 94ddbee..2e83e9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,3 +12,25 @@ requires = [ # Defined by PEP 517 build-backend = "setuptools.build_meta" +[project] +authors = [ + {name = "Tephi Contributors", email = "scitools.pub@gmail.com"} +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Scientific/Engineering :: Visualization", +] \ No newline at end of file From f759c90cede7ed56cdd49d9f313c685abff19f9d Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Tue, 23 Jan 2024 09:22:44 +0000 Subject: [PATCH 3/3] returned toml --- pyproject.toml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e83e9a..7b31d31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,27 +10,4 @@ requires = [ "wheel", ] # Defined by PEP 517 -build-backend = "setuptools.build_meta" - -[project] -authors = [ - {name = "Tephi Contributors", email = "scitools.pub@gmail.com"} -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: MacOS", - "Operating System :: POSIX", - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: Visualization", -] \ No newline at end of file +build-backend = "setuptools.build_meta" \ No newline at end of file