Coder Social home page Coder Social logo

tox-py's Introduction

tox-py

https://img.shields.io/github/workflow/status/adamchainz/tox-py/CI/main?style=for-the-badge https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge https://img.shields.io/pypi/v/tox-py.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge 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:

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:

$ tox -f py310

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

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 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:

tox --py 39

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

tox --py current

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

tox-py's People

Contributors

adamchainz avatar dependabot[bot] avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tox-py's Issues

Migrate to tox-dev and v4 support

Python Version

No response

Package Version

No response

Description

Hello, would you consider moving the project under the tox-dev umbrella? See documentation under https://tox.readthedocs.io/en/rewrite/plugins.html#adoption-of-a-plugin-under-tox-dev-github-organization

Furthermore, tox v4 is getting ready and we'd like to make sure this plugin is supported from day 1, we're collecting feature gaps for this under tox-dev/tox#1974. Would be great if you could join our development chat under https://discord.gg/tox so we can assist with this. If you do so please drop in a line in the #plugin chat with the name of the repository you maintain. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.