tox-py


Nametox-py JSON
Version 1.3.1 PyPI version JSON
download
home_pagehttps://github.com/adamchainz/tox-py
SummaryAdds the --py flag to tox to run environments matching a given Python interpreter.
upload_time2022-12-08 01:26:03
maintainer
docs_urlNone
authorAdam Johnson
requires_python>=3.7
licenseMIT License
keywords tox
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ======
tox-py
======

.. image:: https://img.shields.io/github/workflow/status/adamchainz/tox-py/CI/main?style=for-the-badge
   :target: https://github.com/adamchainz/tox-py/actions?workflow=CI

.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
   :target: https://github.com/adamchainz/tox-py/actions?workflow=CI

.. image:: https://img.shields.io/pypi/v/tox-py.svg?style=for-the-badge
   :target: https://pypi.org/project/tox-py/

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
   :target: https://github.com/psf/black

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge
   :target: https://github.com/pre-commit/pre-commit
   :alt: pre-commit

Unmaintained (2022-12-08)
-------------------------

With the release of tox 4, this package is no longer necessary, and so is not being maintained.
You can instead use tox 4’s ``-f`` option - see below.

----

Adds the ``--py`` flag to tox to run environments matching a given Python interpreter.

Installation
============

Use **pip**:

.. code-block:: bash

    python -m pip install tox-py

Python 3.7 to 3.11 supported.

Only tox 3 is supported.

On tox 4, you can use the new |-f factor option|__ to select environments by Python version:

.. |-f factor option| replace:: ``-f`` factor option
__ https://tox.wiki/en/latest/cli_interface.html#tox-run-select-target-environment(s)

.. code-block:: console

    $ tox -f py310

On GitHub Actions, you can use ``-f`` with your matrix python version like so:

.. code-block:: yaml

    jobs:
      tests:
        name: Python ${{ matrix.python-version }}

        strategy:
          matrix:
            python-version:
            - 3.7
            - 3.8
            - 3.9
            - '3.10'
            - '3.11'

        steps:
        - ...

        - name: Run tox targets for ${{ matrix.python-version }}
          run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

----

**Testing a Django project?**
Check out my book `Speed Up Your Django Tests <https://adamchainz.gumroad.com/l/suydt>`__ which covers loads of ways to write faster, more accurate tests.

----

Usage
=====

After installation, the plugin will be automatically picked up by ``tox``.
It adds one argument: ``--py``, which takes the version to filter environments against.
The version can be specified either as a ``tox.ini``-style dotless version number, or the special string ``current`` for the version of Python that ``tox`` is running under.

For example, to run all Python 3.9 environments:

.. code-block:: sh

    tox --py 39

Or to run all environments matching the version of Python that ``tox`` is running under:


.. code-block:: sh

    tox --py current

This makes configuring CI really easy: configure your CI to trigger each Python version in parallel, running ``tox --py current``.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/adamchainz/tox-py",
    "name": "tox-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "tox",
    "author": "Adam Johnson",
    "author_email": "me@adamj.eu",
    "download_url": "https://files.pythonhosted.org/packages/0d/b5/a6a46d87686e2b6d306aafde6424348ce789b0bd3c2ae28aa24dfc13749f/tox-py-1.3.1.tar.gz",
    "platform": null,
    "description": "======\ntox-py\n======\n\n.. image:: https://img.shields.io/github/workflow/status/adamchainz/tox-py/CI/main?style=for-the-badge\n   :target: https://github.com/adamchainz/tox-py/actions?workflow=CI\n\n.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge\n   :target: https://github.com/adamchainz/tox-py/actions?workflow=CI\n\n.. image:: https://img.shields.io/pypi/v/tox-py.svg?style=for-the-badge\n   :target: https://pypi.org/project/tox-py/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\n   :target: https://github.com/psf/black\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n\nUnmaintained (2022-12-08)\n-------------------------\n\nWith the release of tox 4, this package is no longer necessary, and so is not being maintained.\nYou can instead use tox 4\u2019s ``-f`` option - see below.\n\n----\n\nAdds the ``--py`` flag to tox to run environments matching a given Python interpreter.\n\nInstallation\n============\n\nUse **pip**:\n\n.. code-block:: bash\n\n    python -m pip install tox-py\n\nPython 3.7 to 3.11 supported.\n\nOnly tox 3 is supported.\n\nOn tox 4, you can use the new |-f factor option|__ to select environments by Python version:\n\n.. |-f factor option| replace:: ``-f`` factor option\n__ https://tox.wiki/en/latest/cli_interface.html#tox-run-select-target-environment(s)\n\n.. code-block:: console\n\n    $ tox -f py310\n\nOn GitHub Actions, you can use ``-f`` with your matrix python version like so:\n\n.. code-block:: yaml\n\n    jobs:\n      tests:\n        name: Python ${{ matrix.python-version }}\n\n        strategy:\n          matrix:\n            python-version:\n            - 3.7\n            - 3.8\n            - 3.9\n            - '3.10'\n            - '3.11'\n\n        steps:\n        - ...\n\n        - name: Run tox targets for ${{ matrix.python-version }}\n          run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)\n\n----\n\n**Testing a Django project?**\nCheck out my book `Speed Up Your Django Tests <https://adamchainz.gumroad.com/l/suydt>`__ which covers loads of ways to write faster, more accurate tests.\n\n----\n\nUsage\n=====\n\nAfter installation, the plugin will be automatically picked up by ``tox``.\nIt adds one argument: ``--py``, which takes the version to filter environments against.\nThe version can be specified either as a ``tox.ini``-style dotless version number, or the special string ``current`` for the version of Python that ``tox`` is running under.\n\nFor example, to run all Python 3.9 environments:\n\n.. code-block:: sh\n\n    tox --py 39\n\nOr to run all environments matching the version of Python that ``tox`` is running under:\n\n\n.. code-block:: sh\n\n    tox --py current\n\nThis makes configuring CI really easy: configure your CI to trigger each Python version in parallel, running ``tox --py current``.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Adds the --py flag to tox to run environments matching a given Python interpreter.",
    "version": "1.3.1",
    "split_keywords": [
        "tox"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "207b4f02decfc2a05fcdce21b4416c08",
                "sha256": "51393c6df0b0d16c4d0acdfba947820a028c673f7b9e3ff1fd06146827884daf"
            },
            "downloads": -1,
            "filename": "tox_py-1.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "207b4f02decfc2a05fcdce21b4416c08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4320,
            "upload_time": "2022-12-08T01:26:01",
            "upload_time_iso_8601": "2022-12-08T01:26:01.944241Z",
            "url": "https://files.pythonhosted.org/packages/7b/e7/f9cb516fc144aa2129f0fb24a4c4d8ee4590873942b6ba5c6ce79742ec5b/tox_py-1.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "af3e52f1726771d8948460f32a0abb41",
                "sha256": "749ceb27062db13268881ec2f9bb0d8673839ea75feb0957f74756025737e256"
            },
            "downloads": -1,
            "filename": "tox-py-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "af3e52f1726771d8948460f32a0abb41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4794,
            "upload_time": "2022-12-08T01:26:03",
            "upload_time_iso_8601": "2022-12-08T01:26:03.417070Z",
            "url": "https://files.pythonhosted.org/packages/0d/b5/a6a46d87686e2b6d306aafde6424348ce789b0bd3c2ae28aa24dfc13749f/tox-py-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-08 01:26:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "adamchainz",
    "github_project": "tox-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "tox-py"
}
        
Elapsed time: 0.02078s