Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafal-Cichowski authored Dec 15, 2022
2 parents e0d42f4 + 4224ccf commit e573f05
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 41 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: CI

on: [pull_request]
on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
container:
image: themattrix/tox
image: python:3.10
steps:
- name: Checkout
uses: actions/[email protected]
- name: Tests
run: |
- name: Packages
run: pip install tox
- name: Checkout
uses: actions/checkout@v3
- name: Tox
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
tox -v
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The main branch works with **python 3.7**.
- [Adam Pawlowski](https://github.com/adampawl)
- [Daniel Szulc](http://szulc.xyz/)
- [Sylwia Majchrowska](https://majsylw.netlify.app/)
- [Karol Tarnowski](http://www.if.pwr.wroc.pl/~tarnowski/)
- [Karol Tarnowski](http://www.tarnowski.wppt.pwr.edu.pl/)

## Acknowledgement

Expand Down
71 changes: 37 additions & 34 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = examples,pep8,autopep8,docs
envlist = docs,examples,doc8,pep8,autopep8

[testenv]
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}

[testenv:autopep8]
description = Print autopep8 suggestions.
envdir = {toxworkdir}/linters
deps = -r test-requirements.txt
commands = autopep8 --recursive --aggressive --diff --exit-code .

[testenv:doc8]
description = Style guide enforcement with doc8.
envdir = {toxworkdir}/linters
deps = -r test-requirements.txt
commands = doc8 {posargs}

[testenv:docs]
description = Build project documentation.
envdir = {toxworkdir}/sphinx
deps = -r docs/requirements.txt
allowlist_externals = rm
commands =
rm -rf docs/_build
sphinx-build -W -b html docs docs/_build

[testenv:examples]
description =
Run all python scripts from examples directory - physics check.
# Env variable MPLBACKEND=Agg prevents display of windows during tests
description = Run all python scripts from examples directory - physics check.
envdir = {toxworkdir}/build
deps = -r requirements.txt
setenv =
MPLBACKEND=Agg
commands =
bash -ex -c 'for FILE in examples/*.py; do python $FILE; done'
# Env variable MPLBACKEND=Agg prevents display of windows during tests
setenv = MPLBACKEND=Agg
allowlist_externals = bash
commands = bash -ex -c 'for FILE in examples/*.py; do python $FILE; done'

[testenv:pep8]
description =
Style guide enforcement with flake8 and doc8.
deps =
-r test-requirements.txt
commands =
flake8
doc8

[testenv:autopep8]
description =
Check autopep8 suggestions.
deps =
-r test-requirements.txt
commands =
python -m autopep8 --recursive --aggressive --diff --exit-code .
description = Style guide enforcement with flake8.
envdir = {toxworkdir}/linters
deps = -r test-requirements.txt
commands = flake8 {posargs}

[doc8]
# D000 - invalid rst format
# D002 - no trailing whitespace
# D004 - no carriage returns (use unix newlines)
ignore = D000,D002,D004
ignore-path = .venv,.git,.tox,gnlse.egg*,docs/_build
ignore-path = .git,.tox,.venv,docs/_build,*.egg-info

[flake8]
exclude = .venv,.git,.tox,docs,*egg,build

[testenv:docs]
description =
Build main documentation: html and pdf file.
deps =
-r docs/requirements.txt
commands =
rm -rf docs/_build
sphinx-build -W -b html docs docs/_build
exclude = .git,.tox,.venv,build,docs,*.egg-info

0 comments on commit e573f05

Please sign in to comment.