Skip to content

Commit

Permalink
Added CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-pok committed Jul 8, 2024
1 parent 51a5992 commit 5f7d35e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 68 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run all tox jobs using python3

on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10]
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 setuptools
pip install tox-gh-actions
- name: Run tox
run: |
tox -e lint
tox -e coverage
tox -e py
- name: Upload to codecov
if: ${{matrix.python-version == '3.10'}}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: pytest
name: "connectome-manipulator-py310"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.black]
line-length = 100
target-version = [
'py39',
'py310',
]
include = 'connectome_manipulator\/.*\.py$|tests\/.*\.py$|doc\/source\/conf\.py$|setup\.py$'

Expand Down
71 changes: 4 additions & 67 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,18 @@ testdeps =

[tox]
envlist =
check-version
check-packaging
lint
py{39,310}
coverage
py310

minversion = 3.1.0
minversion = 4

# ignore basepython for envs that already specify a version
ignore_basepython_conflict = true

[testenv]
setenv =
PIP_INDEX_URL = https://bbpteam.epfl.ch/repository/devpi/simple
deps = {[base]testdeps}
commands = pytest -vv tests/unit {posargs}

[testenv:functional]
commands = pytest -vv tests/functional {posargs}

[testenv:integration]
passenv =
SLURM_ACCOUNT
MODULESHOME
MODULEPATH
LOADEDMODULES
_LMFILES_
changedir =
tests/integration
allowlist_externals =
bash
echo
find
cat
commands =
echo "Testing with Dask"
connectome-manipulator -v manipulate-connectome wiring_config.json \
--output-dir {temp_dir}/integration_dask \
--profile --convert-to-sonata \
--parallel \
--splits 4 \
-a processes=1 \
-a n_workers=2 \
-a threads_per_worker=1
find {temp_dir}/integration_dask/logs -type f -name '*.task-*.log' -exec cat -n {} \;
bash -c 'h5ls -S {temp_dir}/integration_dask/edges.h5/edges/All__All__chemical/target_node_id | grep "{127}" -q'


[testenv:check-version]
skip_install = true
deps = bbp-nse-ci
commands = do_release.py -p . check-version

[testenv:check-packaging]
deps =
wheel
twine
commands =
python setup.py sdist bdist_wheel -d {envtmpdir}/dist
twine check {envtmpdir}/dist/*
commands = pytest -vv tests/unit

[testenv:lint]
deps =
Expand All @@ -80,10 +33,6 @@ commands =
pylint {[base]name}
black --check .

[testenv:format]
deps = black
commands = black .

[testenv:coverage]
usedevelop=True
deps =
Expand All @@ -92,18 +41,6 @@ deps =
commands =
pytest --cov-report term-missing --cov-report xml --cov={[base]name} tests/unit

[testenv:docs]
changedir = doc
extras = docs
# set warnings as errors using the -W sphinx option
commands = make html SPHINXOPTS=-W
allowlist_externals = make

# E731: do not assign a lambda expression, use a def
# W503: line break after binary operator
# W504: line break before binary operator
# E261 at least two spaces before inline comment
# E501: long line: THIS SHOULD BE TEMPARARY
[pycodestyle]
ignore = E731,W503,W504,E261,E501,E203
max-line-length = 100
Expand Down

0 comments on commit 5f7d35e

Please sign in to comment.