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

Ordering of envvars #22

Closed
Julian opened this issue Oct 1, 2020 · 7 comments
Closed

Ordering of envvars #22

Julian opened this issue Oct 1, 2020 · 7 comments

Comments

@Julian
Copy link
Contributor

Julian commented Oct 1, 2020

(I forget whether the below is true, if not obviously feel free to close)

git clone https://github.com/Julian/regret && cd regret && tox-ini-fmt tox.ini

turns

setenv =
    {[testenv]setenv}
    COVERAGE_DEBUG_FILE={envtmpdir}/coverage-debug
    COVERAGE_FILE={envtmpdir}/coverage-data

into

setenv =
  COVERAGE_DEBUG_FILE = {envtmpdir}/coverage-debug
  COVERAGE_FILE = {envtmpdir}/coverage-data
  {[testenv]setenv = {[testenv]setenv}

is that a safe change?

What if the parent setenv contained those envvars? Presumably those are processed in order right, and the original way, the overridden values win, whereas after sorting, the parent values will win?

(Again if that's false feel free to close :)

@gaborbernat
Copy link
Member

The order does not matter. In old pip it might... But with pip having a resolver it's irrelevant.

@gaborbernat
Copy link
Member

If you're relying on ordering of these you're doing something wrong 🤔I feel like .

@Julian
Copy link
Contributor Author

Julian commented Oct 1, 2020

I'm talking about tox, not pip, and how tox decides to break ties in sections.

@gaborbernat
Copy link
Member

I still stand by of if you're relying on ordering of these you're doing something wrong 🤔I feel like .

@gaborbernat gaborbernat reopened this Oct 1, 2020
@Julian
Copy link
Contributor Author

Julian commented Oct 1, 2020

I don't know of any other solution really. tox's configuration format only has this, so if you want a default value and to override it in some testenvs I don't think you really have another choice. You could give up on sharing between sections entirely I guess. Maybe that's indeed the thing to do in that situation.

@gaborbernat
Copy link
Member

I mean we can swap it to the beginning always 🤠 to support override.

@Julian
Copy link
Contributor Author

Julian commented Oct 1, 2020

Yeah that maybe was what I was thinking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants