Skip to content

Switch build system to flit. #101

Switch build system to flit.

Switch build system to flit. #101

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "main" ]
paths-ignore:
- '.guix/**'
- 'guix.scm'
- '.img/**'
- README.md
- LICENSE
- 'scripts/**'
- 'etc/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- '.guix/**'
- 'guix.scm'
- '.img/**'
- README.md
- LICENSE
- 'scripts/**'
- 'etc/**'
jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install flit and virtualenv
run: |
pip install flit virtualenv
- name: Setup a local virtual environment
run: |
virtualenv .venv
# - uses: actions/cache@v3
# name: Define a cache for the virtual environment based on the dependencies lock file
# with:
# path: ./.venv
# key: venv-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
. ./.venv/bin/activate
export FLIT_INSTALL_PYTHON="./.venv/bin/python"
flit install
- name: Lint with flake8
run: |
. ./.venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --exclude .venv --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build wheel
run: |
. ./.venv/bin/activate
export FLIT_INSTALL_PYTHON="./.venv/bin/python"
flit build