diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1933b6..7b4d79d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,21 @@ name: Tests on: push: - branches: [main] + branches: + - main + tags: + - "*" pull_request: - branches: [main] - release: - types: - - published + branches: + - main + workflow_dispatch: + inputs: + prerelease: + description: "Run a pre-release, testing the build" + required: false + type: boolean + default: false + jobs: tests: name: "py${{ matrix.python-version }} / ${{ matrix.os }}" @@ -14,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] os: [ubuntu-latest] include: - python-version: "3.10" @@ -38,49 +47,27 @@ jobs: - name: Run tests run: python -m pytest -v tests - coverage: - name: "Run tests with coverage" - runs-on: ubuntu-latest - steps: - - name: Clone the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install -U pip pytest-cov - python -m pip install -e . - - name: Run tests - run: python -m pytest --cov george -v tests - - name: Coveralls - uses: AndreMiras/coveralls-python-action@v20201129 - build_wheels: - name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: + - "ubuntu-22.04" + - "macos-12" + - "macos-14" + - "windows-latest" steps: - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - uses: pypa/cibuildwheel@v2.19.1 - env: - CIBW_SKIP: "*-win32 *_i686" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - uses: actions/upload-artifact@v4 with: + name: binary-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: - name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -90,28 +77,32 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: "3.9" - - name: Build sdist + python-version: "3.10" + - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -U build - python -m build --sdist . + python -m pip install -U build twine + - name: Build sdist + run: python -m build --sdist . + - name: Check the sdist + run: python -m twine check dist/*.tar.gz - uses: actions/upload-artifact@v4 with: + name: sdist path: dist/*.tar.gz upload_pypi: - needs: [tests, build_wheels, build_sdist] + environment: + name: pypi + url: https://pypi.org/p/george + permissions: + id-token: write + needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 with: - name: artifact path: dist - + merge-multiple: true - uses: pypa/gh-action-pypi-publish@v1.9.0 - 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 09f373d..969c04a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "george" description = "Blazingly fast Gaussian Processes for regression." readme = "README.rst" authors = [{ name = "Daniel Foreman-Mackey", email = "foreman.mackey@gmail.com" }] -requires-python = ">=3.8" +requires-python = ">=3.9" license = { file = "LICENSE" } urls = { Homepage = "https://github.com/dfm/george" } dependencies = ["numpy", "scipy"] @@ -22,3 +22,6 @@ build-dir = "build/{wheel_tag}" [tool.setuptools_scm] write_to = "src/george/george_version.py" + +[tool.cibuildwheel] +skip = "pp* *-win32 *-musllinux_* *-manylinux_i686"