Skip to content

Commit

Permalink
Update build dependencies (#168)
Browse files Browse the repository at this point in the history
* Update build dependencies

* Update pyproject.toml

* Update tests.yml

* Update pyproject.toml
  • Loading branch information
dfm authored Jun 23, 2024
1 parent b2c44da commit 9c9d4c2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 47 deletions.
83 changes: 37 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
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 }}"
runs-on: ${{ matrix.os }}
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"
Expand All @@ -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
Expand All @@ -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/
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"

0 comments on commit 9c9d4c2

Please sign in to comment.