Remove uv cache; add dependency groups again #183
Workflow file for this run
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 single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
push: | |
# If you don't have a "branches: [...]" entry here, the action runs on any push. | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
# By default, GitHub will maximize the number of jobs run in parallel | |
# depending on the available runners on GitHub-hosted virtual machines. | |
# max-parallel: 8 | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: 3.9 | |
- python-version: 3.13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Cache wasn't working. Need a better understanding before we turn this on: | |
# enable-cache: true | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Lint with flake8 and ruff (only on most recent Python version) | |
if: ${{ matrix.python-version == 3.13 }} | |
run: | | |
# Stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude nonstandard | |
# Run ruff, but don't fail tests regarless of result. | |
ruff check --preview || ruff check --preview --statistics --exit-zero | |
- name: Test with pytest | |
run: pytest | |
- name: Run doctests (only on most recent Python version) | |
if: ${{ matrix.python-version == 3.13 }} | |
run: | | |
uv sync --all-extras --group docs | |
cd doc | |
make clean | |
make doctest | |
# TO DO: generate docs automatically and deploy them. | |
# | |
# The following comes from the old bitbucket-pipelines.yml. | |
# It shows how to make and deploy documentation. We'll need to use pages.nist.gov when we re-enable this. | |
# - pip install recommonmark sphinx | |
# - cd doc | |
# - make clean | |
# - make doctest | |
# - make html | |
# - git config --global user.email "[email protected]" | |
# - git config --global user.name "Bitbucket Pipeline Doc Deploy" | |
# - ./deploy_docs_bitbucket.sh $BITBUCKET_BRANCH |