Skip to content

Commit

Permalink
tox: runner for tox command "runtox" added to avoid to much typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jqb committed Jul 21, 2013
1 parent 75cc0d5 commit 6ee2d3f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions runtox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import re
import sys
import subprocess


section_re = re.compile(r'\[testenv\:(.*)\]')


def runtox(tox_ini_file_name):
with open(tox_ini_file_name, 'r') as toxini:
envs = [
section_re.findall(line)[0]
for line in map(str.strip, toxini.readlines())
if section_re.match(line)
]
cmd = ['tox', '-e', ','.join(envs)]

print("")
print(" Running command: %s" % ' '.join(cmd))
print("")

subprocess.call(cmd)


if __name__ == '__main__':
runtox('tox.ini' if len(sys.argv) == 1 else sys.argv[2])

0 comments on commit 6ee2d3f

Please sign in to comment.