diff options
author | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2016-09-17 20:30:13 +0200 |
---|---|---|
committer | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2016-09-17 20:30:13 +0200 |
commit | 07fdce28e407b0ec10b5fee682f134550eae335b (patch) | |
tree | 74baed3d9a1daa2ecd8d4bb3f00ff1e47c9f88d4 /doc/plugins.txt | |
parent | 2237fc53240f8892577b3a54016dfcfe8be7fd56 (diff) | |
download | tox-master.tar.gz |
Diffstat (limited to 'doc/plugins.txt')
-rw-r--r-- | doc/plugins.txt | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/doc/plugins.txt b/doc/plugins.txt deleted file mode 100644 index be3665a..0000000 --- a/doc/plugins.txt +++ /dev/null @@ -1,88 +0,0 @@ -.. be in -*- rst -*- mode! - -tox plugins -=========== - -.. versionadded:: 2.0 - -With tox-2.0 a few aspects of tox running can be experimentally modified -by writing hook functions. The list of of available hook function is -to grow over time on a per-need basis. - - -writing a setuptools entrypoints plugin ---------------------------------------- - -If you have a ``tox_MYPLUGIN.py`` module you could use the following -rough ``setup.py`` to make it into a package which you can upload to the -Python packaging index:: - - # content of setup.py - from setuptools import setup - - if __name__ == "__main__": - setup( - name='tox-MYPLUGIN', - description='tox plugin decsription', - license="MIT license", - version='0.1', - py_modules=['tox_MYPLUGIN'], - entry_points={'tox': ['MYPLUGIN = tox_MYPLUGIN']}, - install_requires=['tox>=2.0'], - ) - -If installed, the ``entry_points`` part will make tox see and integrate -your plugin during startup. - -You can install the plugin for development ("in-place") via:: - - pip install -e . - -and later publish it via something like:: - - python setup.py sdist register upload - - -Writing hook implementations ----------------------------- - -A plugin module defines one or more hook implementation functions -by decorating them with tox's ``hookimpl`` marker:: - - from tox import hookimpl - - @hookimpl - def tox_addoption(parser): - # add your own command line options - - - @hookimpl - def tox_configure(config): - # post process tox configuration after cmdline/ini file have - # been parsed - -If you put this into a module and make it pypi-installable with the ``tox`` -entry point you'll get your code executed as part of a tox run. - - - -tox hook specifications and related API ---------------------------------------- - -.. automodule:: tox.hookspecs - :members: - -.. autoclass:: tox.config.Parser() - :members: - -.. autoclass:: tox.config.Config() - :members: - -.. autoclass:: tox.config.TestenvConfig() - :members: - -.. autoclass:: tox.venv.VirtualEnv() - :members: - -.. autoclass:: tox.session.Session() - :members: |