Support built-in `shutil.which`.
Closed this issue · 3 comments
Is your feature request related to a problem? Please describe.
I am trying to package ipypublish for openSUSE for python3. However, it requires the shutilwhich
package, which has been unmaintained for four years and replicates functionality that has been in python3 since 2012. I would prefer to not use unmaintained software, especially when it replicates built-in functionality.
Describe the solution you'd like
Use the built-in shutil.which
when it is available, and only fall back on shutilwhich
if that doesn't exist.
Describe alternatives you've considered
I could maintain my own patch that uses shutil
's version of which
, but we prefer to work with upstream whenever possible.
Additional context
Note that although shutilwhich
is unmaintained, backports.shutil_which
is maintained. Further, it looks like backports.shutil_which
is more widely-supported. For example, Anaconda, Fedora, and openSUSE all provide backports.shutil_which
but not shutilwhich
. This isn't really important to me since I am only planning on packaging this for python3, but it may be worth considering a switch for python2.
I notice that pathlib2
and typing
are also both backports of built-in python tools.
oset
is not built-in, but it hasn't been updated since 2012, while ordereset and ordered-set are both well-maintained. Further, we like to run the tests on packages we include, but I can't run the tests on oset
because the sdist is missing the test file and the upstream repository no longer exists.
Hey @toddrme2178 sorry for the slow reply, but I've now implemented this in v0.10.2
. If you look in the requirements.txt
now, you'll see that pathlib2
, typing
and shutilwhich
are only required for older python versions, and oset
has been switched to ordered-set
. Let me know if this is all good ta.