Skip to content

Commit

Permalink
Merge branch 'master' into toml
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage committed Feb 23, 2025
2 parents 3ba9d72 + 74622db commit 13dcccd
Show file tree
Hide file tree
Showing 42 changed files with 1,108 additions and 1,125 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
benchmarks:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
Expand Down
232 changes: 61 additions & 171 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,45 @@
name: CI
name: Test and release when tagged

on: [push, pull_request]
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
environments: lint
- run: pixi run --environment lint lint

test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
environment:
- test-py311
- test-py312
- test-py313
numpy: [null, "numpy>=1.23,<2.0.0", "numpy>=2.0.0rc1"]
uncertainties: [null, "uncertainties==3.1.6", "uncertainties>=3.1.6,<4.0.0"]
extras: [null]
include:
- python-version: "3.10" # Minimal versions
- environment: "test-py311" # Minimal versions
numpy: "numpy>=1.23,<2.0.0"
extras: matplotlib==3.5.3
- python-version: "3.10"
- environment: "test-py311"
numpy: "numpy"
uncertainties: "uncertainties"
extras: "sparse xarray netCDF4 dask[complete]==2024.5.1 graphviz babel==2.8 mip>=1.13"
- python-version: "3.10"
- environment: "test-py311"
numpy: "numpy==1.26.1"
uncertainties: null
extras: "babel==2.15 matplotlib==3.9.0"
runs-on: ubuntu-latest

env:
TEST_OPTS: "-rfsxEX -s --cov=pint --cov-config=.coveragerc --benchmark-skip"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}
environments: ${{ matrix.environment }}
- name: Install numpy
if: ${{ matrix.numpy != null }}
run: pip install "${{matrix.numpy}}"
Expand All @@ -77,164 +64,67 @@ jobs:
run: |
sudo apt install -y graphviz
pip install packaging
pip install .[testbase]
- name: Install pytest-mpl
if: contains(matrix.extras, 'matplotlib')
run: pip install pytest-mpl

- name: Run Tests
run: |
pytest $TEST_OPTS
# - name: Coverage report
# run: coverage report -m

# - name: Coveralls Parallel
# env:
# COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
# COVERALLS_PARALLEL: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls
- run: pixi run --environment ${{ matrix.environment }} test

test-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
numpy: [ "numpy>=1.23,<2.0.0" ]
runs-on: windows-latest

env:
TEST_OPTS: "-rfsxEX -s -k issue1498b --benchmark-skip"

environment:
- test-py311
- test-py312
- test-py313
numpy: [null, "numpy>=1.23,<2.0.0", "numpy>=2.0.0rc1"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-windows-${{ matrix.python-version }}
restore-keys: |
pip-windows-${{ matrix.python-version }}
environments: ${{ matrix.environment }}
- name: Install numpy
if: ${{ matrix.numpy != null }}
run: pip install "${{matrix.numpy}}"

# - name: Install uncertainties
# if: ${{ matrix.uncertainties != null }}
# run: pip install "${{matrix.uncertainties}}"
#
# - name: Install extras
# if: ${{ matrix.extras != null }}
# run: pip install ${{matrix.extras}}

- name: Install dependencies
run: |
# sudo apt install -y graphviz
pip install packaging
pip install .[testbase]
# - name: Install pytest-mpl
# if: contains(matrix.extras, 'matplotlib')
# run: pip install pytest-mpl

- name: Run tests
run: pytest -rfsxEX -s -k issue1498b --benchmark-skip
- run: pixi run --environment ${{ matrix.environment }} test

test-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
numpy: [null, "numpy>=1.23,<2.0.0" ]
runs-on: macos-latest

env:
TEST_OPTS: "-rfsxEX -s --cov=pint --cov-config=.coveragerc --benchmark-skip"

environment:
- test-py311
- test-py312
- test-py313
numpy: [null, "numpy>=1.23,<2.0.0", "numpy>=2.0.0rc1"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}
environments: ${{ matrix.environment }}
- name: Install numpy
if: ${{ matrix.numpy != null }}
run: pip install "${{matrix.numpy}}"
- run: pixi run --environment ${{ matrix.environment }} test

- name: Install dependencies
run: |
pip install packaging
pip install .[testbase]
- name: Run Tests
run: |
pytest $TEST_OPTS
# - name: Coverage report
# run: coverage report -m
publish:
if: github.ref_type == 'tag'
needs: [test-linux, test-windows, test-macos, lint]

# - name: Coveralls Parallel
# env:
# COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
# COVERALLS_PARALLEL: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pint
permissions:
id-token: write # for trusted publising to PyPI

# coveralls:
# needs: test-linux
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-python@v2
# with:
# python-version: 3.x
# - name: Coveralls Finished
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls --finish
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
environments: build
- name: Build the package
run: pixi run --environment build build
- name: Publish to PyPI
run: pixi run --environment build publish
47 changes: 11 additions & 36 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,21 @@ on: [push, pull_request]
jobs:
docbuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up minimal Python version
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
python-version: "3.10"

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup pip cache
uses: actions/cache@v2
environments: docs
- run: pixi run --environment docs docbuild
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-docs
restore-keys: pip-docs

environments: docs
- name: Install locales
run: |
sudo apt-get install language-pack-fr
sudo localedef -i fr_FR -f UTF-8 fr_FR
- name: Install dependencies
run: |
sudo apt install -y pandoc
pip install --upgrade pip setuptools wheel
pip install -r "requirements_docs.txt"
pip install docutils==0.14 commonmark==0.8.1 recommonmark==0.5.0 babel==2.8
pip install .
- name: Build documentation
run: sphinx-build -n -j auto -b html -d build/doctrees docs build/html

- name: Doc Tests
run: sphinx-build -a -j auto -b doctest -d build/doctrees docs build/doctest
- run: pixi run --environment docs doctest
46 changes: 0 additions & 46 deletions .github/workflows/lint-autoupdate.yml

This file was deleted.

Loading

0 comments on commit 13dcccd

Please sign in to comment.