-
Notifications
You must be signed in to change notification settings - Fork 34
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
Hide main functionality behind a flag #84
Comments
Two thoughts:
|
I'm not sure what you mean. The flag would hide basically all of the current functionality that gets configured in the
It certainly would be a minority case currently. If you're not using this feature in the current package, there's really nothing less. That's why I brought up the future feature of reporting jobs to GitHub. That's one case that I can readily see a desire to have Tox work as it does normally, and just use a particular feature that we're adding to it. A positive flag would keep feature usage consistent. If the negative flag is preferred, and likely even if it is not, I think a |
The current flag is There's one more case that I just thought of to consider, and that's if we wanted to add options to match these flags in the [travis]
envlist = False
after = True This makes sense, but conflicts with an idea that's been floated before of using the [travis]
features =
envlist: False
after: True This solves the conflicting key problem, but I think it looks ugly, and it would be more annoying to parse. What do you think? |
Right, I was saying flag but thinking config option. I'd argue that the config options makes more sense:
As to features, maybe something like: [travis]
features =
envlist
after
Additionally, it might be helpful if feature mismatch printed a warning in the tox output (both local and CI). [travis]
features =
after
[travis:env]
DJANGO =
1.8: django18
1.11: django111
[travis:after]
travis = python: 3.6
env = DJANGO: 1.11 In the above, we could notify the user that they've provided a |
In the typical case, I believe you're right. However, the build for tox-travis, for example, runs the tests twice for each matrix job. Once with the sdist, and the other with the wheel. Because of that, we only want to wait on after on the second tox run (using the wheel). This is a use-case that I find quite valid and want to continue to support through CLI flags. |
I'm concluding this issue by thinking that with feature flags we'll want to have pairs. For this one, I'd like the flags to be spelled If in the future we wish to allow the list of active features to be configured in the config file, which I'd be fine with but probably would not use myself, I'd want it to be as @rpkilby described above, with The feature names should match the flags, so |
I'm debating whether it would be wise to require the detection to be behind a flag, the same way that after all is behind a flag, and that any other feature would also be behind a flag. Magic is best used sparingly and judiciously.
There are some places that I think magic is the only thing that makes sense. In particular, our hacks, of which there is currently only one, that allows the pypy3 pre-releases to work on Travis. There's no sense in doing that less magically.
The argument for the general detection behavior being behind a flag, however, is that it allows tox to run the same on Travis as it does locally. It's easy enough to add a flag in
tox_addoption
. Explicit opt-in allows users to decide exactly what they do (and don't) want overridden.A future case where this might play out is if someone wishes to Tox-Travis for its ability to report back to GitHub (#73), but want to do all of that in a single job. It really shouldn't require a bunch of extra configuration work to do what Tox does by default.
An alternative would be a flag to disable detection. That would be a backward compatible change, and would give the needed functionality, but it would have the flag being backward from rest of the features, which are (and are going to be) opt-in.
The text was updated successfully, but these errors were encountered: