chore: modernize build backend and require Python 3.8+ (#137) #426
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv pip install --system -e .[test,boost,uproot,rich] pandas | |
- name: Run tests | |
run: python -m pytest -s | |
- name: Run CLI | |
run: | | |
histoprint tests/data/1D.txt | |
histoprint tests/data/1D.txt -c 40 -l 40 | |
histoprint tests/data/2D.txt | |
histoprint tests/data/3D.txt -s -l A -l B -l C -t "HISTOPRINT" | |
histoprint tests/data/3D.txt -s -f 0 -l A -f 2 -l C -C 'data[1] > 2.' | |
histoprint tests/data/3D.csv -s -f x -f z -C 'y > 2.' | |
wget --quiet http://scikit-hep.org/uproot3/examples/Event.root | |
histoprint -s Event.root -f T/event/fTracks/fTracks.fYfirst -f T/event/fTracks/fTracks.fYlast[:,0] | |
histoprint -s Event.root -f T/fTracks.fYfirst -f T/event/fTracks/fTracks.fYlast[:,0] -C 'fNtrack > 5' | |
histoprint -s Event.root -f htime | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files --hook-stage manual |