Coder Social home page Coder Social logo

Comments (8)

adamchainz avatar adamchainz commented on June 16, 2024

Yes I'd be happy to move under the tox-dev organization.

This plugin is very small, so a good test bed. (I find it a bit surprising the functionality isn't even built-in.)

I've added testing of the plugin against tox 4 in #35 and it works perfectly. I also checked with a mini project locally and that worked fine.

mini project

tox.ini

[tox]
skipsdist = True
envlist =
    py{36,39}-{a,b}

[testenv]
commands = python -c "print('hi')"

shell

$ tox --py current
...
  py39-a: commands succeeded
  py39-b: commands succeeded
  congratulations :)

$ tox --py 36
...
  py36-a: commands succeeded
  py36-b: commands succeeded
  congratulations :)

$ tox --py 38  # matches no envs
...
  congratulations :)

from tox-py.

gaborbernat avatar gaborbernat commented on June 16, 2024

Currently, tox_configure is not called at all in v4. If it works then it must work out of the box 🤔 For what's worth I'm not against adding this functionality to the core though in v4.

from tox-py.

adamchainz avatar adamchainz commented on June 16, 2024

Right you are. I made a mistake in #35 and tox 3 was still being installed. I have fixed that now in #36.

Getting a way to do this in tox core would be great. I have a few suggestions for how it could be added:

  • -e could support a special form for "environments matching the the current python version / version x", such as a glob or regex.
  • A new argument could be added.
  • More simply, --skip-missing-interpreters could return a non-zero exit code if no environments run.

from tox-py.

gaborbernat avatar gaborbernat commented on June 16, 2024
  • -e could support a special form for "environments matching the the current python version / version x", such as a glob or regex.

-e is defined as a list of environments to run, there's no space here to overload it with additional content.

  • A new argument could be added.

It could be though mutually exclusive with a --py flag 🤔 However, some environments might not use a python runner in which case this makes less sense (think node environments). So that might need more thought 🤔

  • More simply, --skip-missing-interpreters could return a non-zero exit code if no environments run.

If --skip-missing-interpreters is False we already fail with a non-zero exit code.

from tox-py.

adamchainz avatar adamchainz commented on June 16, 2024

If --skip-missing-interpreters is False we already fail with a non-zero exit code.

I mean if one runs tox --skip-missing-interpreters, but that ends up not matching any environments, the exit code is currently 0 even though nothing has run. Instead, it could be non-zero in that case.

This would fit my use case of launching one CI run per Python version. My fear with the current behaviour of --skip-missing-interepreters is that I'd accidentally configure CI to run nothing and end up with green checkmarks.

from tox-py.

gaborbernat avatar gaborbernat commented on June 16, 2024

That feels something we could do 👍

from tox-py.

gaborbernat avatar gaborbernat commented on June 16, 2024

Done via tox-dev/tox#2206

from tox-py.

adamchainz avatar adamchainz commented on June 16, 2024

Thanks to that change, this plugin won't support tox 4. Instead users will be encouraged to use --skip-missing-interpreters, which I'm adding to the README. Thanks again @gaborbernat .

from tox-py.

Related Issues (1)

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.