Skip to content

Commit

Permalink
Add titles to tox environments (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Feb 24, 2019
1 parent 0b37cc7 commit 7f2b5d6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
23 changes: 23 additions & 0 deletions title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""
Simple script to print concole-wide title.
Ex. usage:
title.py "My cool title"
"""
import shutil
import sys


def print_title(text):
"""Print given text as title."""
nc, _ = shutil.get_terminal_size((80, 24))
print("\033[1;37;40m")
print("-" * nc)
print((" " + text + " ").center(nc, "#"))
print("-" * nc + "\033[0;37;40m")


if __name__ == "__main__":
print_title(sys.argv[1])
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ envlist =
sanity,docs,pylint,flake8,coverage,benchmark

[testenv]
commands_pre =
python3 title.py "Environment: {envname}"
commands =
python -m pip -q install numpy wheel
python -m pip -q install pycuda
Expand All @@ -15,6 +17,8 @@ deps =

[testenv:coverage]
basepython = python3.6
commands_pre =
python3 title.py "Coverage"
commands =
python -m pip -q install numpy wheel
python -m pip -q install pycuda
Expand All @@ -27,6 +31,8 @@ setenv =
COVERAGE_FILE=.coverage

[testenv:docs]
commands_pre =
python3 title.py "Documentation"
basepython = python3.6
whitelist_externals = make
commands =
Expand All @@ -38,6 +44,8 @@ deps =
sphinx_rtd_theme

[testenv:flake8]
commands_pre =
python3 title.py "Codestyle Check"
basepython = python3.6
deps =
flake8
Expand All @@ -46,20 +54,26 @@ commands =
flake8 .

[testenv:pylint]
commands_pre =
python3 title.py "Static Analysis"
basepython = python3.6
deps =
pylint
commands =
pylint xentica examples docs tests

[testenv:benchmark]
commands_pre =
python3 title.py "Benchmark"
basepython = python3.6
commands =
python -m pip -q install numpy wheel
python -m pip -q install pycuda
python3 tests/benchmark.py

[testenv:sanity]
commands_pre =
python3 title.py "Sanity Checks"
basepython = python3.6
commands =
check-manifest --ignore tox*.ini,tests*,data*
Expand Down

0 comments on commit 7f2b5d6

Please sign in to comment.