Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
exclude = .git,.tox,build,dist,venv,docs,*.egg-info,tests/conftest.py
max-line-length = 120
max-complexity = 10
select = E,W,F,C
ignore = E121,E123,E126,E226,E24,E704,W503,W504
92 changes: 61 additions & 31 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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 package

on:
Expand All @@ -9,38 +6,71 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install flake8
run: python -m pip install flake8
- name: Stop the build on syntax errors and undefined names
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Report the other findings without failing
run: flake8 . --count --exit-zero --statistics

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
python-version: ["3.10", "3.11", "3.12"]
env:
MPLBACKEND: Agg
TF_CPP_MIN_LOG_LEVEL: "2"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install the package and its test dependencies
run: python -m pip install -e ".[test]"
- name: Test with coverage and pytest
run: |
coverage run --source glmdisc/ -m pytest
coverage report
coverage xml
- name: Upload the coverage report
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
fail_ci_if_error: false

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --skip-lock
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
pipenv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=tests/conftest.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pipenv run flake8 . --count --exit-zero --extend-ignore=W503,W50 --max-complexity=10 --max-line-length=120 --statistics --exclude=tests/conftest.py
- name: Test with coverage and pytest
run: |
pipenv run coverage run --source glmdisc/ -m pytest
pipenv run coverage report
- name: Build and check package
run: |
pipenv run pipenv-setup sync --dev
pipenv run pip install --upgrade keyring keyrings.alt
python setup.py build sdist bdist_wheel
pipenv run twine check dist/*
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build and check the distributions
run: |
python -m pip install build twine
python -m build
twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

31 changes: 0 additions & 31 deletions Pipfile

This file was deleted.

Loading
Loading