Closed wookayin closed 2 years ago
Hi @wookayin I agree relying on pwgen is not ideal so I'm willing to hear alternatives.
I'm not sure that assuming python is installed is any better though? I'm guessing most installations have it by default, but would it be any higher than pwgen? If the answer is yes, then I would agree that it would be a better alternative but I have not done my research here :)
This plugin is meant for python, so we can assume that python's availability is very likely. What's the point of using this plugin if they didn't have python3 on PATH? Also, most of the reasonable distribution OS would have python3 available. Windows, might be an exception, though..
😂 sorry had some wires crossed when I wrote this message and thought I was posting for another zsh plugin I maintain.
Yes python sounds perfectly reasonable to me. Feel free to open a PR :)
This will be solved by #166 once merged
I was thinking of submitting a PR directly, but prior to that I wanted to discuss with the owner and make a consensus about the change.
Since v3.3.0
pwgen
has became a requirement. However, I don't think it is good idea to require pwgen to make this plugin working.First,
pwgen
is only required duringmkvenv
(with plain virtualenv). Users who are already using pipenv, poetry, conda would never need it. However the startup message sayingpwgen
is required is annoying for those who actually doesn't need it. Even providedpwgen
would be still required, the error could be raised only when it's actually being used.Second, what
pwgen 8 1
does is to simply generate random strings of length 8 (with one numbers). Requiring installing external software for this simple feature would be too much in my opinion. Instead, this could be simply done using python, for example, without any dependencies, as follows:Although it may look a little verbose and it's not precisely same behavior (e.g., number of digits), but it does the right job of generating a random string.
Third, installing
pwgen
can be quite confusing in some use cases; it can be installed viaapt
orbrew
, but if one installespwgen
via pip (which can happen accidentally), it will not work. Making the plugin fool-proof would be another virtue.What do you think? Thank you!