Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support glob patterns and factors in 'depends' option #1152

Open
ziima opened this issue Jan 28, 2019 · 7 comments
Open

Support glob patterns and factors in 'depends' option #1152

ziima opened this issue Jan 28, 2019 · 7 comments
Labels
feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. level:medium rought estimate that this might be neither easy nor hard to implement

Comments

@ziima
Copy link
Contributor

ziima commented Jan 28, 2019

Addition of parallel runs and dependencies is awesome, but we quite miss any support for factors or glob patterns in the depends option.

In case we have several environments

[tox]
envlist = clean-coverage,py27,py35,py36,py37,compute-coverage

we have to set dependencies for compute-coverage individually

[testenv:compute-coverage]
depends = py27,py35,py36,py37

which is error prone and not quite comfortable.

I suggest to allow glob patterns

[testenv:compute-coverage]
depends = py*

and factors similarly to other parts of configuration.

I don't quite feel I would be able to provide a PR.

@gaborbernat
Copy link
Member

Factors are supported (or anything that works within envlist that is). Patterns AFAIK not so much. In principle, I'm not against this. Could be non-trivial to implement it for the general case though.

@gaborbernat gaborbernat added feature:new something does not exist yet, but should level:medium rought estimate that this might be neither easy nor hard to implement help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. labels Jan 29, 2019
@tpazderka
Copy link

Handling of factors is probably not working, see MWE below.

[tox]
minversion = 3.7.0
envlist =
    py27-test
    py37-test
    compute-coverage

[testenv]
skip_install = True
whitelist_externals = 
    sleep
    echo
commands =
    sleep 5
    echo "Test ..."

[testenv:compute-coverage]
depends = test
commands =
    echo "Compute ..."

and the output:

tox -p all
✔ OK compute-coverage in 0.611 second
✔ OK py37-test in 5.526 seconds
✔ OK py27-test in 5.552 seconds
_____________________________________________________________________________________________________ summary _____________________________________________________________________________________________________
  py27-test: commands succeeded
  py37-test: commands succeeded
  compute-coverage: commands succeeded
  congratulations :)

@gaborbernat
Copy link
Member

Ah, like that will not work. That actually is not the factor syntax, that's the mark syntax. Here's what I am referring to when I see factor support:

[tox]
envlist={py27,py37}-{test,notest}-{a, b}, other

[testenv:compute-coverage]
depends = {py27,py37}-{test,notest}-{a, b}

What you're implying there resembles more along the lines of environment markers:

[tox]
envlist={py27,py37}-{test,notest}-{a, b}, other

[testenv]
deps = test: a
       notest: b

That way on its own cannot work because what if there is also a test env. Does test refer to that one env, or all envs having the test factor? At best I could see something like {test} which would indicate it's a factor. This would be though expending the syntax for factor specification, that would only exist for depends.

@ziima
Copy link
Contributor Author

ziima commented Jan 29, 2019

According to tox documentation: Parts of an environment name delimited by hyphens are called factors ..., we meant factors (I hope so). But the way we want to use them is different from all other keywords. Thanks for pointing it out. That really would not be easy.

The main problem we want to resolve is the need to copy sublists of environments. When new environment is added, but forgotten in depends, spurious race conditions may occur. That's why we want to use glob patterns, e.g. py*, or factors (sort of), e.g. quality for quality-*.

@gaborbernat
Copy link
Member

Agreed is a gap, contributions are welcome, otherwise, hopefully, we'll get to this at some point.

@rpkilby
Copy link
Member

rpkilby commented Mar 13, 2019

An implementation here might also be able to solve #318 at the same time.

@gaborbernat gaborbernat added this to the 4.2 milestone Jan 13, 2022
@gaborbernat
Copy link
Member

Currently, we do support factors and label based selection. Glob pattern could be added, perhaps would be under the -g flag 👍

@gaborbernat gaborbernat removed this from the P-2 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. level:medium rought estimate that this might be neither easy nor hard to implement
Projects
None yet
Development

No branches or pull requests

4 participants