{ "info": { "author": "Miro Hron\u010dok", "author_email": "miro@hroncok.cz", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: tox", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Testing" ], "description": "===============\ntox-current-env\n===============\n---------------------------------------------------------------------------------------\n`tox `_ plugin to run tests in current Python environment\n---------------------------------------------------------------------------------------\n\nThe ``tox-current-env`` plugin adds two options:\n\n``tox --current-env``\n Runs the tox testenv's ``commands`` in the current Python environment\n (that is, the environment where ``tox`` is invoked from and installed in).\n Unlike regular ``tox`` invocation, this installs no dependencies declared in ``deps``.\n An attempt to run this with a Python version that doesn't match will fail\n (if ``tox`` is invoked from an Python 3.7 environment, any non 3.7 testenv will fail).\n\n``tox --print-deps-only`` / ``--print-deps-to-file``\n Instead of running any ``commands``,\n simply prints the declared dependencies in ``deps`` to the standard output or specified file.\n This is useful for preparing the current environment for the above.\n ``--print-deps-to-file`` will overwrite the file if it already exists.\n\nInvoking ``tox`` without any of the above options should behave as regular ``tox`` invocation without this plugin.\nAny deviation from this behavior is considered a bug.\n\nThe plugin disables *tox's way* of providing a testing environment,\nbut assumes that you supply one in *some other way*.\nAlways run ``tox`` with this plugin in a fresh isolated environment,\nsuch as Python virtualenv, Linux container or chroot.\n\\\nSee other caveats below.\n\n\nMotivation\n----------\n\nObviously, ``tox`` was created to run tests in isolated Python virtual environments.\nThe ``--current-env`` flag totally defeats the purpose of ``tox``.\nWhy would anybody do that, you might ask?\n\nWell, it turns out that ``tox`` became too popular and gained another purpose.\n\nThe Python ecosystem now has formal `specifications `_ for many pieces of package metadata like versions or dependencies.\nHowever, there is no standardization yet for declaring *test dependencies* or *running tests*.\nThe most popular de-facto standard for that today is ``tox``,\nand we expect a future standard to evolve from ``tox.ini``.\nThis plugin lets us use ``tox``'s dependency lists and testing commands for environments other than Python venvs.\n\nWe hope this plugin will enable community best practices around ``tox`` configuration\nto grow to better accomodate non-virtualenv environments in general \u2013 for example,\nLinux distros, Conda, or containers.\n\nSpecifically, this plugin was created for `Fedora `_'s needs.\nWhen we package Python software as RPM packages, we try to run the project's test suite during package build.\nHowever, we need to test if the software works integrated into Fedora,\nnot with packages downloaded from PyPI into a fresh environment.\nBy running the tests in *current environment*, we can achieve that.\n\nIf you are interested in the RPM packaging part of this,\nsee Fedora's `%pyproject RPM macros `_.\n\n\nInstallation\n------------\n\nInstall this via ``pip``:\n\n.. code-block:: console\n\n $ python -m pip install tox-current-env\n\nOr install the development version by cloning `the git repository `_\nand ``pip``-installing locally:\n\n.. code-block:: console\n\n $ git clone https://github.com/fedora-python/tox-current-env\n $ cd tox-current-env\n $ python -m pip install -e .\n\n\nUsage\n-----\n\nWhen the plugin is installed, use ``tox`` with ``--current-env`` or ``--print-deps-only`` and all the other options as usual. Assuming your ``tox`` is installed on Python 3.7:\n\n.. code-block:: console\n\n $ tox -e py37 --current-env\n py37 create: /home/pythonista/projects/holy-grail/tests/.tox/py37\n py37 installed: ...list of packages from the current environment...\n py37 run-test-pre: PYTHONHASHSEED='3333333333'\n py37 run-test: commands...\n ...runs tests in current environment's Python...\n ___________________________________ summary ____________________________________\n py37: commands succeeded\n congratulations :)\n\nAttempting to run the ``py36`` environment's test will fail:\n\n.. code-block:: console\n\n $ tox -e py36 --current-env\n py36 create: /home/pythonista/projects/holy-grail/tests/.tox/py36\n ERROR: InterpreterMismatch: tox_current_env: interpreter versions do not match:\n in current env: (3, 7, 4, 'final', 0)\n requested: (3, 6, 9, 'final', 0)\n ___________________________________ summary ____________________________________\n ERROR: py36: InterpreterMismatch: tox_current_env: interpreter versions do not match:\n in current env: (3, 7, 4, 'final', 0)\n requested: (3, 6, 9, 'final', 0)\n\nTo get list of test dependencies, run:\n\n.. code-block:: console\n\n $ tox -e py37 --print-deps-only\n py37 create: /home/pythonista/projects/holy-grail/tests/.tox/py37\n py37 installed: ...you can see almost anything here...\n py37 run-test-pre: PYTHONHASHSEED='3333333333'\n dep1\n dep2\n ...\n ___________________________________ summary ____________________________________\n py37: commands succeeded\n congratulations :)\n\n\nCaveats, warnings and limitations\n---------------------------------\n\nUse an isolated environment\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRunning (especially third party software's) tests in your system Python environment is dangerous.\nAlways use this plugin in an isolated environment,\nsuch as Python virtualenv, Linux container, virtual machine or chroot.\nYou have been warned.\n\nDo not rely on virtualenv details\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn order to support the ``python`` command in the ``commands`` section,\nthe current environment invocation of ``tox`` creates a fake virtual environment\nthat just has a symbolic link to the Python executable.\nThe link is named ``python`` even if the real interpreter's name is different\n(such as ``python3.7`` or ``pypy``).\nAny other commands are not linked anywhere and it is the users' responsibility\nto make sure such commands are in ``$PATH`` and use the correct Python.\nThis can lead to slightly different results of tests than invoking them directly,\nespecially if you have assumptions about ``sys.executable`` or other commands\nin your tests.\n\nAs a specific example, tests should invoke ``python -m pytest`` rather than assuming\nthe ``pytest`` command is present and uses the correct version of Python.\n\nDon't mix current-env and regular tox runs\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTox caches the virtualenvs it creates, and doesn't distinguish between\nregular virtualenvs and ``--current-env``.\nDon't mix ``tox --current-env`` or ``tox --print-deps-only`` runs\nand regular ``tox`` runs (without the flag).\nIf you ever need to do this, use tox's ``--recreate/-r`` flag to clear the cache.\n\nThe plugin should abort with a meaningful error message if this is detected,\nbut in some cases (such as running ``tox --current-env``, uninstalling the\nplugin, and running ``tox``), you will get undefined results\n(such as installing packages from PyPI into your current environment).\n\nEnvironment variables are not passed by default\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAlthough the plugin name suggests that current environment is used for tests,\nit means the Python environment, not Shell.\nIf you want the tests to see environment variables of the calling process,\nuse the ``TOX_TESTENV_PASSENV`` environment variable.\nRead `the documentation for passing environment variables to tox\n`_.\n\n\nOther limitations and known bugs\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe ``installed:`` line in the output of ``tox --print-deps-only`` shows irrelevant output\n(based on the content of the real or faked virtual environment).\n\nRegardless of any `Python flags `_ used in the shebang of ``tox``,\nthe tests are invoked with ``sys.executable`` without any added flags\n(unless explicitly invoked with them in the ``commands`` section).\n\nThe current environment's Python is tested for the major and minor version only.\nDifferent interpreters with the same Python version (such as CPython and PyPy) are treated as equal.\n\nOnly Linux is supported, with special emphasis on Fedora.\nThis plugin might work on other Unix-like systems,\nbut does not work on Microsoft Windows.\n\nThis is alpha quality software.\nUse it at your on your own risk.\nPull requests with improvements are welcome.\n\n\nDevelopment, issues, support\n----------------------------\n\nThe development happens on GitHub,\nat the `fedora-python/tox-current-env `_ repository.\nYou can use the `issue tracker `_ there for any discussion\nor send Pull Requests.\n\n\nTests\n~~~~~\n\nIn order to run the tests, you'll need ``tox`` and Python 3.6, 3.7 and 3.8 installed.\nThe integration tests assume all three are available.\nOn Fedora, you just need to ``dnf install tox``.\n\nRun ``tox`` to invoke the tests.\n\nRunning tests of this plugin with its own ``--current-env`` flag will most likely blow up.\n\n\nLicense\n-------\n\nThe ``tox-current-env`` project is licensed under the so-called MIT license, full text available in the `LICENSE `_ file.\n\n\nCode of Conduct\n---------------\n\nThe ``tox-current-env`` project follows the `Fedora's Code of Conduct `_.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fedora-python/tox-current-env", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tox-current-env", "package_url": "https://pypi.org/project/tox-current-env/", "platform": "", "project_url": "https://pypi.org/project/tox-current-env/", "project_urls": { "Homepage": "https://github.com/fedora-python/tox-current-env" }, "release_url": "https://pypi.org/project/tox-current-env/0.0.2/", "requires_dist": [ "tox (>=3.5)" ], "requires_python": ">=3.6", "summary": "Use current environment instead of virtualenv for tox testenvs", "version": "0.0.2" }, "last_serial": 5666992, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1cdfe5963ecd14ae00648e0efcc52716", "sha256": "012fcceda8bddc9ce316359c043f7427e654161ab0febe9f79a6888518b70fb0" }, "downloads": -1, "filename": "tox_current_env-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1cdfe5963ecd14ae00648e0efcc52716", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7121, "upload_time": "2019-07-23T10:59:03", "url": "https://files.pythonhosted.org/packages/9c/cf/ea5ae7d287c12f73d978966d971c3a1fef7e240e4938f835dd33554bbfa1/tox_current_env-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1fcb2387107e16ecf444ac212d9c40a", "sha256": "861396b0da3a58c24a1af0f5dfd81e1f2eda1668c6632de35c6ab4264796e32e" }, "downloads": -1, "filename": "tox-current-env-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f1fcb2387107e16ecf444ac212d9c40a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9334, "upload_time": "2019-07-23T10:58:37", "url": "https://files.pythonhosted.org/packages/a3/e4/67192df56bc9bb85aacfbb4afc2489017299bc530d60d209284eb4ca3ad9/tox-current-env-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0c8a288b1bef08316c5f61120299c36d", "sha256": "2d5f45321d69b95036af14c255223f88c9357403f6eae08c1e074cbba885419d" }, "downloads": -1, "filename": "tox_current_env-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0c8a288b1bef08316c5f61120299c36d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7765, "upload_time": "2019-08-12T15:05:41", "url": "https://files.pythonhosted.org/packages/36/42/f9f9ad665c1476d1d0a31b1b880089ea79e2e0f2ce3190ae9c738a55d792/tox_current_env-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c79fca48c22ca5875610def6347651aa", "sha256": "e4f434a7dd993702c18a5e8c71d917d2dbb170204f5b57351791e36cf81102cf" }, "downloads": -1, "filename": "tox-current-env-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c79fca48c22ca5875610def6347651aa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10881, "upload_time": "2019-08-12T15:05:42", "url": "https://files.pythonhosted.org/packages/19/0b/71aa41fa8eb7cd7b855b616c5b5c348c0f81cf3033f2c828960ce335bdf6/tox-current-env-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c8a288b1bef08316c5f61120299c36d", "sha256": "2d5f45321d69b95036af14c255223f88c9357403f6eae08c1e074cbba885419d" }, "downloads": -1, "filename": "tox_current_env-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0c8a288b1bef08316c5f61120299c36d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7765, "upload_time": "2019-08-12T15:05:41", "url": "https://files.pythonhosted.org/packages/36/42/f9f9ad665c1476d1d0a31b1b880089ea79e2e0f2ce3190ae9c738a55d792/tox_current_env-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c79fca48c22ca5875610def6347651aa", "sha256": "e4f434a7dd993702c18a5e8c71d917d2dbb170204f5b57351791e36cf81102cf" }, "downloads": -1, "filename": "tox-current-env-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c79fca48c22ca5875610def6347651aa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10881, "upload_time": "2019-08-12T15:05:42", "url": "https://files.pythonhosted.org/packages/19/0b/71aa41fa8eb7cd7b855b616c5b5c348c0f81cf3033f2c828960ce335bdf6/tox-current-env-0.0.2.tar.gz" } ] }