Skip to content

Bump numpy from 2.4.1 to 2.4.2 (#393) #962

Bump numpy from 2.4.1 to 2.4.2 (#393)

Bump numpy from 2.4.1 to 2.4.2 (#393) #962

Workflow file for this run

name: Python package
on:
push:
branches: master
tags: v*
pull_request:
branches: master
jobs:
lint:
runs-on: ubuntu-slim
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v3
- run: ruff format
typecheck:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: |
pipx install 'poetry>=2'
- name: Install package with dev dependencies
run: poetry install -v --all-extras
- name: Run mypy type checking
run: poetry run mypy tact
build:
needs: [lint, typecheck]
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Install apt packages
run: |
sudo apt update
sudo apt install libopenblas-dev
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pipx install 'poetry>=2'
- name: Check tags
if: startsWith(github.event.ref, 'refs/tags')
id: tag
run: |
# double echo to strip whitespace
gitd=$(echo $(git describe --tags))
echo "tag=$gitd" >> $GITHUB_OUTPUT
poetryv=$(echo v$(poetry version --short))
echo $gitd
echo $poetryv
- name: Install package for testing
run: poetry install -v --all-extras
- name: Test with pytest
run: poetry run pytest --script-launch-mode=subprocess -W error::DeprecationWarning
- name: Reinstall package for production
run: |
poetry env list --full-path | xargs rm -rf
poetry install -v
- name: Build distribution package
id: build
run: |
set -eux
# Torture git-describe into an acceptable Python version format
new_tag=$(git describe --tags | cut -c2- | sed 's/-/+/' | sed 's/-/./g')
echo $new_tag
echo "version=$new_tag" >> $GITHUB_OUTPUT
poetry version $new_tag
poetry build
- uses: actions/upload-artifact@v6
if: matrix.python-version == '3.13'
with:
name: ${{ steps.build.outputs.version }}
path: dist
publish-to-pypi:
name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/tact
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v7
with:
name: ${{ steps.build.outputs.version }}
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1