Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P8804
tox-wikimedia draft 1
Active
Public
Actions
Authored by
Legoktm
on Jul 24 2019, 9:58 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F29864054: raw.txt
Jul 24 2019, 9:58 PM
2019-07-24 21:58:09 (UTC+0)
Subscribers
None
import pluggy
from pprint import pprint as print
from tox.config import DepConfig
hookimpl = pluggy.HookimplMarker("tox")
TOOLS = {
'pytest': {
'commands': ['pytest'],
'deps': ['pytest'],
},
'flake8': {
'commands': ['flake8'],
'deps': ['flake8'],
}
}
@hookimpl
def tox_addoption(parser):
"""Add a command line option for later use"""
pass
@hookimpl
def tox_configure(config):
"""Access your option during configuration"""
# print(config.envconfigs)
for envname, config in config.envconfigs.items():
for factor in config.factors:
try:
fconfig = TOOLS[factor]
except KeyError:
continue
# print(config.deps)
config.deps.extend([DepConfig(dep) for dep in fconfig['deps']])
if not config.commands:
config.commands.append(fconfig['commands'])
# print(config.factors)
# print(config.deps)
# print(config.commands)
@hookimpl
def tox_runtest_post(venv):
pass
Event Timeline
Legoktm
created this paste.
Jul 24 2019, 9:58 PM
2019-07-24 21:58:09 (UTC+0)
Log In to Comment