poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Improve support without virtualenv

Open auxsvr opened this issue 3 years ago • 3 comments

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!

auxsvr avatar Nov 10 '22 14:11 auxsvr

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

dimbleby avatar Nov 10 '22 19:11 dimbleby

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.

auxsvr avatar Nov 15 '22 17:11 auxsvr

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.

neersighted avatar Nov 15 '22 17:11 neersighted

Stale issue. If there is a real need for this, please re-create a new PR.

abn avatar Jan 17 '25 03:01 abn

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.

github-actions[bot] avatar Feb 17 '25 00:02 github-actions[bot]