{ "info": { "author": "Oliver Bestwalter", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: tox", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "# tox-direct\n\n[tox](https://tox.readthedocs.io) plugin: run tox envs directly in the same interpreter that tox was run in.\n\n`tox-direct` is something that you usually shouldn't need, but that can be handy in certain situations. It is not recommended to use this approach as a normal part of a tox based automation workflow. The fact that tox creates isolated virtual environments for all automation activities is one of the main reasons for its reliability and is the key to unify command line based and CI automation. \n\nHaving said that: life is messy and sometimes you just want to run a certain environment in the host interpreter. For this there is `tox-direct` now.\n\n**TODO: maybe it makes sense to extend this to being able to run in the basepython rather than in the host environment (if they differ). This is not implemented as I have no need for it (yet).**\n\n## installation\n\n pip install tox-direct\n\n## concept\n\n`tox-direct` is trying to be safe first and should also have the ability to degrade gracefully when `tox-direct` is not installed. To ensure this, no new key in `tox.ini` is introduced. It works purely over env name, command line parameters or environment variables.\n\nTo be safe the following activities will be deactivated by default in direct runs:\n\n* package build\n* deps installations\n* project installation\n\nThere are two ways to request envs being run in direct mode: **static** and **on request**. The on request variant also provides a **YOLO** option ((you only live once ;)) which means that everything is run in the host interpreter. This will change the host interpreter and is usually only safe and makes sense (or works at all) if tox is run in a virtual environment already.\n\n### static form \nif the testenv name contains the word **direct** it will be run in direct mode if tox-direct is installed. If this is part of a project that is shared you should make sure that this also works as intended if `tox-direct` is not installed (a.k.a. degrades gracefully).\n\n### on request form \n\n`tox-direct` adds command line arguments and checks environment variables to run arbitrary envs in direct mode.\n\nWith `tox-direct installed`:\n\n```text\n$ tox --help\n[...]\n\noptional arguments:\n --direct [tox-direct] deactivate venv, packaging and install steps - \n run commands directly (can also be achieved by setting\n TOX_DIRECT) (default: False)\n --direct-yolo [tox-direct] do everything in host environment that would\n otherwise happen in an isolated virtual environment \n (can also be achieved by setting TOX_DIRECT_YOLO env var\n (default: False)\n```\n\n**WARNING: `tox-direct` does not consider different basepythons, which means that running environments with different basepythons makes no sense with `tox-direct` at the moment: they would all run in the same environment where tox is installed (effectively doing the same over and over again).**\n\n## basic example\n\nLet's assume you are working in some virtualenv already which looks like this:\n\n```text\n$ which python\n~/.virtualenvs/tmp/bin/python\n\n$ pip list\npip list\nPackage Version\n------------------ -------\n[...] \ntox 3.13.1 \ntox-direct 0.2.2 \n[...] \n\n\n$ tox --version\n3.13.1 imported from ~/.virtualenvs/tmp/lib/python3.6/site-packages/tox/__init__.py\nregistered plugins:\n tox-direct-0.2.2 at ~/.virtualenvs/tmp/lib/python3.6/site-packages/tox_direct/hookimpls.py\n```\n\nYou have a project with a `tox.ini` like this:\n\n```ini\n[tox]\n; this is the default - put here to be explicit\nskipsdist = False\n\n[testenv:direct-action]\n; also the default to be explicit\nskip_install = False\ndeps = pytest\ncommands =\n pip list\n which python\n\n[testenv:normal]\nwhitelist_externals = which\nskip_install = False\nusedevelop = True\ncommands = which python\n```\n\ntun tox:\n\n```text\n$ tox -qr\nPackage Version\n------------------ -------\n[...] \ntox 3.13.1 \ntox-direct 0.2.2 \n[...] \n/home/ob/.virtualenvs/tmp/bin/python\nPackage Version\n------------------ -------\n[...]\npytest 4.6.3\nexample-project 1.3\n[...]\n/home/ob/oss/tox-dev/tplay/.tox/normal/bin/python\n_________________ summary _______________________\n direct-action: commands succeeded\n normal: commands succeeded\n congratulations :)\n```\n\nThe `direct-action` env shows the packages from the `tmp` virtual env and pytest was not installed, the project itself was also not installed.\n\n**WARNING: if something is installed in the commands (e.g. contains `pip install` calls) this will still happen as commands will be executed without further inspection.**\n\ntox still creates an envdir at `.tox/direct-action` but it does not contain a virutal environment - it is only used for internal bookkeeping and logging. The interpreter used throughout is `~/.virtualenvs/tmp` - the host interpreter that tox was started from.\n\nThe `normal` env ran in the isolated environment provided by tox. pytest was installed and so was the project itself (because no package is needed to install the project in development mode). If usedevelop was set to `False` tox would crash with a note that you can't do this in direct mode (because sdist is not built in direct mode). \n\nrun the normal environment in direct mode:\n\n```text\ntox -qre normal --direct\nPackage Version Location \n------------------ ------- --------\n[...] \ntox 3.13.1 \ntox-direct 0.2.2 \n[...] \n/home/ob/.virtualenvs/tmp/bin/python\n____________________ summary _______\n normal: commands succeeded\n congratulations :)\n```\n\nThi time it ran in the host and nothing extra was installed.\n\nAnd now the YOLO version:\n\n```text\ntox -qre normal --direct-yolo\nPackage Version Location \n------------------ ---------- --------\n[...] \nexample-project 1.3 \npytest 4.6.3 \n[...] \ntox 3.13.1 \ntox-direct 0.2.2\n[...] \n/home/ob/.virtualenvs/tmp/bin/python\n______________________ summary _________________________________\n normal: commands succeeded\n congratulations :)\n```\n\npytest and the project where installed in the host environment.\n\n**NOTE: the YOLO option is called YOLO for a reason in case you run this as root in your system python :).**\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/obestwalter/tox-direct", "keywords": "testing automation", "license": "MIT", "maintainer": "Oliver Bestwalter", "maintainer_email": "oliver@bestwalter.de", "name": "tox-direct", "package_url": "https://pypi.org/project/tox-direct/", "platform": "any", "project_url": "https://pypi.org/project/tox-direct/", "project_urls": { "Homepage": "https://github.com/obestwalter/tox-direct", "Source": "https://github.com/obestwalter/tox-direct", "Tracker": "https://github.com/obestwalter/tox-direct/issues" }, "release_url": "https://pypi.org/project/tox-direct/0.3.5/", "requires_dist": [ "tox (<4,>=3.12)", "py", "pathlib2", "twine ; extra == 'publish'", "pytest ; extra == 'test'" ], "requires_python": "", "summary": "plugin for tox - run everything directly (tox creates no virtual env)", "version": "0.3.5" }, "last_serial": 5453393, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "62e046a25fb7702e88fced5c4c433f42", "sha256": "1fee4d164395e09b6319d75ab96d63a4b3b9fddf25f5ed9f31b93f4a37609096" }, "downloads": -1, "filename": "tox-direct-0.1.0.tar.gz", "has_sig": true, "md5_digest": "62e046a25fb7702e88fced5c4c433f42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2330, "upload_time": "2019-06-24T19:10:31", "url": "https://files.pythonhosted.org/packages/f5/de/221629a9c44932d4bd203e650b93b40043dbbc06612b7e825b7cf0b1fc1c/tox-direct-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "06b60b43c508847c974e5a994108840d", "sha256": "294d07eef9b30e8799ecc8d9188c3d8115e40363ae6e3b9e5a790ca4bf4e0b0f" }, "downloads": -1, "filename": "tox-direct-0.1.1.tar.gz", "has_sig": false, "md5_digest": "06b60b43c508847c974e5a994108840d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2472, "upload_time": "2019-06-24T19:29:13", "url": "https://files.pythonhosted.org/packages/2d/fa/4e697925cd415f6833f5542de99897cceb3678fa7f58d84f22ab4d5f22be/tox-direct-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e32c1a55e5b9928f126a0c662032dee9", "sha256": "36602c44127171ed1742a6f4d690e61ca26932416b88562238b9eee3aaa30c22" }, "downloads": -1, "filename": "tox-direct-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e32c1a55e5b9928f126a0c662032dee9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2470, "upload_time": "2019-06-24T19:41:11", "url": "https://files.pythonhosted.org/packages/7b/4b/cf7f51e454321baaef374d98f9e48e95f172311339457dc21eea373ed0e2/tox-direct-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "1d3da130b1fcc4c7b0dd288035a221cf", "sha256": "cb4d07d6b62531816a676999ccf95e54a8383caa4fd0e46c876567d2ddf5822a" }, "downloads": -1, "filename": "tox-direct-0.1.3.tar.gz", "has_sig": false, "md5_digest": "1d3da130b1fcc4c7b0dd288035a221cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2585, "upload_time": "2019-06-24T20:47:53", "url": "https://files.pythonhosted.org/packages/3f/02/4c75e306c5c8965af1875b49237ad0ea30a545a857261cfb86e7b008c1fe/tox-direct-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4f6f81730687b3d3d2a3c92a79b1a085", "sha256": "70c15ef55bf150fb64b1b12656360f5472544554787d4ca462d027490622b34d" }, "downloads": -1, "filename": "tox-direct-0.2.0.tar.gz", "has_sig": true, "md5_digest": "4f6f81730687b3d3d2a3c92a79b1a085", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5872, "upload_time": "2019-06-26T14:55:04", "url": "https://files.pythonhosted.org/packages/d2/1a/396cc589882e6c7c9f1c71393372ffa025ee03d776aee6a9a848b07d5757/tox-direct-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "5d70f788275c51ed5a3cfd6eb97246e1", "sha256": "2c4c74f196fe58720021970b907e780102390e94e5e4e4cd527c93ce9ca789da" }, "downloads": -1, "filename": "tox-direct-0.2.1.tar.gz", "has_sig": true, "md5_digest": "5d70f788275c51ed5a3cfd6eb97246e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5874, "upload_time": "2019-06-26T14:57:30", "url": "https://files.pythonhosted.org/packages/54/18/25ffbe52fe37d5d8c4c21b50ee2efa16bff9ff5066cc262336c9374ced13/tox-direct-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b2c780043a3e8b0cf1797f592cc14405", "sha256": "89c5d5e509b1f9a3386dca4c8e138a115010a1ba30a3f4157d439aedd57f8939" }, "downloads": -1, "filename": "tox-direct-0.2.2.tar.gz", "has_sig": true, "md5_digest": "b2c780043a3e8b0cf1797f592cc14405", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5955, "upload_time": "2019-06-26T15:09:48", "url": "https://files.pythonhosted.org/packages/47/3c/765682d7965ca74f70485301ee74929ca0d8c255c523ca437b3f83b2ccca/tox-direct-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5f81e822fb2bc4b9ed9abd425ae35dd8", "sha256": "574a223ed372a0d2f011d360191ecff415fa14c8d1edc506fe2ea12b7cd09d13" }, "downloads": -1, "filename": "tox-direct-0.2.3.tar.gz", "has_sig": true, "md5_digest": "5f81e822fb2bc4b9ed9abd425ae35dd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5362, "upload_time": "2019-06-26T16:59:32", "url": "https://files.pythonhosted.org/packages/09/5c/67825659a4487aabff7bdbeb1b6f1143513dc87600bd264970e5c7e54225/tox-direct-0.2.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "fed8416c36004186c7c4375c8c871e07", "sha256": "1b6b3e3da8116d0c3b05100ce637dccbb5ed96530d8b151906e9bcd2c952978d" }, "downloads": -1, "filename": "tox_direct-0.3.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "fed8416c36004186c7c4375c8c871e07", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6410, "upload_time": "2019-06-26T19:37:49", "url": "https://files.pythonhosted.org/packages/2f/ed/cd6b8940fb91af78c498e0bd8033cb9287672ad4d51090b7f407328e015b/tox_direct-0.3.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "145217aac81b3b752e3df1db7544b546", "sha256": "f490242bc5c407085604b70b7bac165deac668bf8984308502a044a4fac3838e" }, "downloads": -1, "filename": "tox-direct-0.3.4.tar.gz", "has_sig": true, "md5_digest": "145217aac81b3b752e3df1db7544b546", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7480, "upload_time": "2019-06-26T19:37:52", "url": "https://files.pythonhosted.org/packages/1a/52/fcbf696df7d8529cdf7b33347b8f35818aba7dac41943cd32ab23f8eedc5/tox-direct-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "ebb1698bd5d32f6a6dfda05daf3aab52", "sha256": "5611bd86b7d55ccacca59738a2537ea4f05d054578c00548251d58bfc5162676" }, "downloads": -1, "filename": "tox_direct-0.3.5-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ebb1698bd5d32f6a6dfda05daf3aab52", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6408, "upload_time": "2019-06-26T19:40:24", "url": "https://files.pythonhosted.org/packages/55/29/6b27779863fc42fcb8a339136741dcd66f6aad23b5da00233b27dad2fd17/tox_direct-0.3.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c3ef030f2739fb3c678b799d9017c1b", "sha256": "769d4b4e922ea18893b98ea3750ec9a8534ebc66a9c22597913f32f5aa5dbd58" }, "downloads": -1, "filename": "tox-direct-0.3.5.tar.gz", "has_sig": true, "md5_digest": "4c3ef030f2739fb3c678b799d9017c1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7483, "upload_time": "2019-06-26T19:40:26", "url": "https://files.pythonhosted.org/packages/a6/33/61495e5f7972b65b20445749a8055fc321233d9e4afcb6401d10ea63a409/tox-direct-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ebb1698bd5d32f6a6dfda05daf3aab52", "sha256": "5611bd86b7d55ccacca59738a2537ea4f05d054578c00548251d58bfc5162676" }, "downloads": -1, "filename": "tox_direct-0.3.5-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ebb1698bd5d32f6a6dfda05daf3aab52", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6408, "upload_time": "2019-06-26T19:40:24", "url": "https://files.pythonhosted.org/packages/55/29/6b27779863fc42fcb8a339136741dcd66f6aad23b5da00233b27dad2fd17/tox_direct-0.3.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c3ef030f2739fb3c678b799d9017c1b", "sha256": "769d4b4e922ea18893b98ea3750ec9a8534ebc66a9c22597913f32f5aa5dbd58" }, "downloads": -1, "filename": "tox-direct-0.3.5.tar.gz", "has_sig": true, "md5_digest": "4c3ef030f2739fb3c678b799d9017c1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7483, "upload_time": "2019-06-26T19:40:26", "url": "https://files.pythonhosted.org/packages/a6/33/61495e5f7972b65b20445749a8055fc321233d9e4afcb6401d10ea63a409/tox-direct-0.3.5.tar.gz" } ] }