diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b50170d..ce1b10c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.9, 3.12] + python-version: [3.11] steps: - uses: actions/checkout@v4 @@ -46,3 +46,19 @@ jobs: - name: Package and check run: make dist + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.11.2 + + - name: Build wheels + run: python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: "cp311-*" + + - name: Check Wheels + run: twine check dist/* + + - uses: actions/upload-artifact@v4 + with: + path: ./dist/*.whl + name: wheel-test-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c909173..941d798 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,7 @@ on: push: tags: - 'v*' + workflow_dispatch: jobs: build: @@ -12,11 +13,68 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, '3.10', 3.11, 3.12] + os: + - ubuntu-22.04 + - macos-12 + - windows-2019 + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + cibuildwheel: + - "cp38" + - "cp39" + - "cp310" + - "cp311" + - "cp312" + exclude: + - python-version: "3.8" + cibuildwheel: "cp39" + - python-version: "3.8" + cibuildwheel: "cp310" + - python-version: "3.8" + cibuildwheel: "cp311" + - python-version: "3.8" + cibuildwheel: "cp312" + - python-version: "3.9" + cibuildwheel: "cp38" + - python-version: "3.9" + cibuildwheel: "cp310" + - python-version: "3.9" + cibuildwheel: "cp311" + - python-version: "3.9" + cibuildwheel: "cp312" + - python-version: "3.10" + cibuildwheel: "cp38" + - python-version: "3.10" + cibuildwheel: "cp39" + - python-version: "3.10" + cibuildwheel: "cp311" + - python-version: "3.10" + cibuildwheel: "cp312" + - python-version: "3.11" + cibuildwheel: "cp38" + - python-version: "3.11" + cibuildwheel: "cp39" + - python-version: "3.11" + cibuildwheel: "cp310" + - python-version: "3.11" + cibuildwheel: "cp312" + - python-version: "3.12" + cibuildwheel: "cp38" + - python-version: "3.12" + cibuildwheel: "cp39" + - python-version: "3.12" + cibuildwheel: "cp310" + - python-version: "3.12" + cibuildwheel: "cp311" steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -27,18 +85,79 @@ jobs: make develop python -m pip install -U wheel twine setuptools - - name: Lint - run: make lint + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.11.2 - - name: Test - run: make test + - name: Python Wheel Steps (Linux - cibuildwheel) + run: python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: "${{ matrix.cibuildwheel }}-manylinux*" + CIBW_BUILD_VERBOSITY: 3 + if: ${{ runner.os == 'Linux' }} - - name: Package and check - run: make dist + - name: Python Build Steps (Macos x86) + run: python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*" + CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_BUILD_VERBOSITY: 3 + if: ${{ matrix.os == 'macos-12' }} - - name: Publish distribution 📦 to PyPI - if: ${{ startsWith(github.ref, 'refs/tags') && matrix.os != 'ubuntu-latest' }} + - name: Python Build Steps (Windows 2019) + run: python -m cibuildwheel --output-dir dist env: - TWINE_USERNAME: ${{ secrets.PYPI_UN }} - TWINE_PASSWORD: ${{ secrets.PYPI_PW }} - run: make upload + CIBW_BUILD: "${{ matrix.cibuildwheel }}-win_amd64" + if: ${{ matrix.os == 'windows-2019' }} + + - name: Check Wheels + run: twine check dist/* + + - name: Upload Wheel + uses: actions/upload-artifact@v4 + with: + name: wheel-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }} + path: dist/*.whl + + # - name: Publish distribution 📦 to PyPI + # if: ${{ startsWith(github.ref, 'refs/tags') && matrix.os != 'ubuntu-latest' }} + # env: + # TWINE_USERNAME: ${{ secrets.PYPI_UN }} + # TWINE_PASSWORD: ${{ secrets.PYPI_PW }} + # run: make upload + build_sdist: + strategy: + matrix: + os: + - ubuntu-22.04 + python-version: + - 3.9 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + make develop + python -m pip install -U wheel twine setuptools + + - name: Python SDist Steps + run: python setup.py sdist + + - name: Check sdist + run: twine check dist/*.tar.gz + + - name: Upload SDist + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/*.tar.gz diff --git a/Makefile b/Makefile index 790ef29..25f507c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ fix: python -m ruff format bt setup.py docs/source/conf.py dist: - python setup.py sdist bdist_wheel + python setup.py sdist python -m twine check dist/* upload: dist diff --git a/pyproject.toml b/pyproject.toml index f309d81..fa5ab7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "cython>0.25"] +requires = ["setuptools", "wheel", "cython>=0.29.25"] [tool.ruff] line-length = 180 diff --git a/setup.py b/setup.py index 170fcbd..acb8813 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ def local_file(filename): ], extras_require={ "dev": [ - "cython>=0.25", + "cython>=0.29.25", "ffn>=1.0.0", "matplotlib>=2", "numpy>=1",