-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
TOX DELETED ALL OF MY CODE #352
Comments
Original comment by @obestwalter
I agree and I would venture a guess that this is a bug and not a feature. |
Original comment by @obestwalter Hi Andrew, I have not much experience with the codebase and the backwards compatibility implications mentioned by @pjdelport so I went for the easy way out, to make sure that it's simply not possible to delete the project dir, whatever happens, as I am sure nobody wants that. |
Original comment by andrew-tipton-cgg Oliver, thanks for the PR. I think it's a good idea to have a sanity check for this specific situation. I still believe that the
The "principle of least surprise" suggests that this snippet should be interpreted as "if the environment name contains It's stunningly non-obvious that the actual semantics are "set |
(NOTE: tox just moved from bitbucket and the automatic links are not resolved correctly (yet) - there are also some PR leftovers on Bitbucket. This PR is still open here: https://bitbucket.org/hpk42/tox/pull-requests/204/catch-project-deletion-if-envdir-toxinidir/diff instead). Original comment by @obestwalter See pull request #204 |
Original comment by @obestwalter I agree. This should never happen. This is basically the worst thing that can happen during development, especially because it makes it very probable that you lose hours of work because you are testing the changes locally and have not pushed them to the remote yet. |
Original comment by andrew-tipton-cgg My understanding was that if the "environment" didn't match either Note that the following does not work:
Again, let me reiterate that UNDER NO CIRCUMSTANCES SHOULD TOX EVER DELETE MY PROJECT DIRECTORY. There is absolutely no reason for anyone to ever intentionally configure tox in such a manner, and it should therefore refuse to proceed if such a situation arises due to misconfiguration. Are we 100% clear on this particular aspect of the issue? |
Original comment by @pjdelport The problem here is that the
I don't think there's anything that Tox can reasonably do about this misconfiguration except maybe raising an overridable warning if |
@pjdelport that's what I thought. We should make sure at the very least, that a user can't delete the whole project as a result of a misconfiguration. See #352 (comment) |
fixed in 3e66f01 - part of 2.4.0 release. |
TL;DR: due to a (slightly) wrong
tox
invocation... tox punished me by deleting all of the files in my project.Transcript of my shell session:
Here's a minimal
tox.ini
that will reproduce the problem:Did you see what happened there? I meant to run
tox -e py34-tests
, but instead rantox -e tests
. This somehow resulted in{toxworkdir}
getting set to{toxinidir}
(!!!) and as a result tox helpfully deleted my project's code and replaced it with a tox working directory....THIS IS NOT ACCEPTABLE BEHAVIOUR.
In case you're wondering "why configure things in this particular manner?", my full configuration has additional environments e.g.
py27-tests
,py34-docs
,py34-build
, etc. and I want to speed things up by sharing the working directory between these different targets. (That is, I want exactly onetoxworkdir
per Python version.)The text was updated successfully, but these errors were encountered: