From 2a5764f7d5d8c684295850aa009b37fb402e9ada Mon Sep 17 00:00:00 2001 From: Ruben Di Battista Date: Mon, 27 Nov 2023 11:21:20 -0800 Subject: [PATCH 1/2] :green_heart: Deploy to official PyPI --- .github/workflows/wheels.yml | 327 +++++++++++++++++------------------ 1 file changed, 163 insertions(+), 164 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e7ecda1b..5fe778ea 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -2,169 +2,168 @@ name: Python wheels on: push: tags: - - 'v*.*.*' + - "v*.*.*" jobs: - test_linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Upgrade pip - run: pip install -U setuptools wheel pip - - - name: Install package for testing - run: pip install ".[test]" - - - name: Run tests - run: > - export MPP_DIRECTORY=$(pwd) && - export MPP_DATA_DIRECTORY=$MPP_DIRECTORY/data && - pytest - - test_mac: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Upgrade pip - run: pip install -U setuptools wheel pip - - - name: Install package for testing - run: pip install ".[test]" - - - name: Run tests - run: > - export MPP_DIRECTORY=$(pwd) && - export MPP_DATA_DIRECTORY=$MPP_DIRECTORY/data && - pytest - - linux_wheels: - strategy: - matrix: - python-version: - - cp36-cp36m - - cp37-cp37m - - cp38-cp38 - - cp39-cp39 - - needs: test_linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Upgrade pip - run: pip install -U setuptools wheel pip - - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2010_x86_64 - with: - python-versions: "${{ matrix.python-version }}" - - - uses: actions/upload-artifact@v2 - with: - name: linux_wheels - path: "dist/*-manylinux*.whl" - retention-days: 1 - - mac_wheels: - strategy: - matrix: - python-version: - - 3.6 - - 3.7 - - 3.8 - - 3.9 - needs: test_mac - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: actions/setup-python@v2 - with: - python-version: "${{ matrix.python-version }}" - - - name: Upgrade pip - run: pip install -U setuptools wheel pip - - - name: Build wheels - run: pip wheel . -w dist/ - - - uses: actions/upload-artifact@v2 - with: - name: mac_wheels - path: "dist/*.whl" - retention-days: 1 - - sdist: - needs: test_linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Upgrade pip - run: pip install -U setuptools wheel pip scikit-build - - - name: Build sdist - run: python setup.py sdist - - - uses: actions/upload-artifact@v2 - with: - name: sdist - path: "dist/*.tar.gz" - retention-days: 1 - - upload_wheels: - runs-on: ubuntu-latest - needs: [linux_wheels, mac_wheels] - steps: - - uses: actions/download-artifact@v2 - with: - name: linux_wheels - path: dist - - - uses: actions/download-artifact@v2 - with: - name: mac_wheels - path: dist - - - uses: actions/download-artifact@v2 - with: - name: sdist - path: dist - - - name: Upgrade pip - run: pip install -U setuptools wheel pip - - - name: Install twine - run: pip install twine - - - name: Upload wheels - run: twine upload -u __token__ -p "${{ secrets.TESTPYPI_TOKEN }}" --repository testpypi dist/* - + test_linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Upgrade pip + run: pip install -U setuptools wheel pip + + - name: Install package for testing + run: pip install ".[test]" + + - name: Run tests + run: > + export MPP_DIRECTORY=$(pwd) && + export MPP_DATA_DIRECTORY=$MPP_DIRECTORY/data && + pytest + + test_mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Upgrade pip + run: pip install -U setuptools wheel pip + + - name: Install package for testing + run: pip install ".[test]" + + - name: Run tests + run: > + export MPP_DIRECTORY=$(pwd) && + export MPP_DATA_DIRECTORY=$MPP_DIRECTORY/data && + pytest + + linux_wheels: + strategy: + matrix: + python-version: + - cp36-cp36m + - cp37-cp37m + - cp38-cp38 + - cp39-cp39 + + needs: test_linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Upgrade pip + run: pip install -U setuptools wheel pip + + - name: Build manylinux Python wheels + uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2010_x86_64 + with: + python-versions: "${{ matrix.python-version }}" + + - uses: actions/upload-artifact@v2 + with: + name: linux_wheels + path: "dist/*-manylinux*.whl" + retention-days: 1 + + mac_wheels: + strategy: + matrix: + python-version: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + needs: test_mac + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: "${{ matrix.python-version }}" + + - name: Upgrade pip + run: pip install -U setuptools wheel pip + + - name: Build wheels + run: pip wheel . -w dist/ + + - uses: actions/upload-artifact@v2 + with: + name: mac_wheels + path: "dist/*.whl" + retention-days: 1 + + sdist: + needs: test_linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Upgrade pip + run: pip install -U setuptools wheel pip scikit-build + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + name: sdist + path: "dist/*.tar.gz" + retention-days: 1 + + upload_wheels: + runs-on: ubuntu-latest + needs: [linux_wheels, mac_wheels] + steps: + - uses: actions/download-artifact@v2 + with: + name: linux_wheels + path: dist + + - uses: actions/download-artifact@v2 + with: + name: mac_wheels + path: dist + + - uses: actions/download-artifact@v2 + with: + name: sdist + path: dist + + - name: Upgrade pip + run: pip install -U setuptools wheel pip + + - name: Install twine + run: pip install twine + + - name: Upload wheels + run: twine upload -u __token__ -p "${{ secrets.PYPI_TOKEN }}" dist/* From 98f7de3f39d9b484e732867997ecc08e8bb9db72 Mon Sep 17 00:00:00 2001 From: Ruben Di Battista Date: Sat, 6 Jul 2024 12:04:00 +0100 Subject: [PATCH 2/2] :wrench: Use scikit build backend --- pyproject.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7bd830f8..f7206bec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,12 @@ [build-system] -requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja"] -build-backend = "setuptools.build_meta" +requires = ["scikit-build-core", "setuptools-scm", "pybind11"] +build-backend = "scikit_build_core.build" + +[project] +name = "mutationpp" +dynamic = ["version"] + +[tool.setuptools_scm] [tool.pytest.ini_options] -testpaths = [ - "tests/python", -] +testpaths = ["tests/python"]