Improve support without virtualenv
Pull Request Check List
Resolves: #6994
- [ ] Added tests for changed code.
- [ ] Updated documentation for changed code.
The change looks trivial, so I only did a couple of tests, with virtualenv and without. Beware, I'm not familiar with the codebase!
I make no comment on the wisdom or correctness of this change - to be honest I'm suspicious about it, but working without a virtual environment very much doesn't interest me so I'll leave that to others.
However the code is kinda icky: instead of horrid isinstance() checks, you should implement a method on the Env, with an override on the SystemEnv or whatever as needed
As isinstance determines if SystemEnv is used, are you suggesting that the method return true if bound to SystemEnv, otherwise false? Why should we encode this piece of information in two different places in the class definitions? Using isinstance may be frowned upon, but the only alternative in my humble opinion in this case seems to be functools.singledispatch, which requires major refactoring or redesign of the code.
The idea is to add a new @property on the Env classes, instead of trying to isinstance() them later, you just call envinstance.src_path.
Stale issue. If there is a real need for this, please re-create a new PR.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.