-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade infrastructure to pixi/uv/ruff, bump minimum python version to 3.11 Develop #2132
Changes from 16 commits
1e5f0c7
46f8c91
282941f
43adf97
b1ad8eb
8bc6369
a01033a
dc5473d
da0e9d6
c9aaee1
1b5689d
be61d6f
a9631e5
1958fab
74b8a08
fcb0196
85303e5
629d38f
e946bf9
57a55b9
c28eab5
1297186
b494c56
80b390f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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/[email protected] | ||
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] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dunno if its still relevant to test multiple versions of uncertainties There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure. My suggestion is that we use this commit to migrate as is, and the use future commits to do this. |
||
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/[email protected] | ||
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}}" | ||
|
@@ -82,159 +69,63 @@ jobs: | |
- 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 | ||
- uses: actions/checkout@v4 | ||
- uses: prefix-dev/[email protected] | ||
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-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 | ||
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/[email protected] | ||
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/[email protected] | ||
with: | ||
environments: build | ||
- name: Build the package | ||
run: pixi run --environment build build | ||
- name: Publish to PyPI | ||
run: pixi run --environment build publish |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to use
os
in the matrix so that we define everything in one job.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but My I will use this commit to migrate as is, and then use future commits to do this.