ccontavalli / ssh-ident

Different agents and different keys for different projects, with ssh.
Other
963 stars 71 forks source link

Replace deprecated distutils usage with shutil.which(). Fixes Issue #65 #66

Closed zapp42 closed 2 years ago

zapp42 commented 2 years ago

Replace all distutils.spawn.find_executable() calls by shutil.which() as suggested in PEP632.

ccontavalli commented 2 years ago

Thank you!!

Uzume commented 2 years ago

@zapp42 This breaks Python2 support, see #68. It is all well and good to port to the new APIs to fix things like #65 but you should leave the old one as a fallback so it will still execute in old environments where the new API does not exist.

You can try something like ssh-ident/ssh-ident1@8215da9b7480483beb8771bcfa5cb2a445bf8734 but be wary as that was done in the wrong order. Write/port to the new APIs and provide fallbacks to the old when the new are not available. Old APIs are old and should not change so then you will never have to touch your fallback code in the future (except maybe to add more fallbacks when you port forward again).

cstich commented 1 year ago

@Uzume python2 is end-of-life as of January 1, 2020. I really don't think any effort should be made anymore to keep python2 support.

Uzume commented 1 year ago

@cstich: I do not have a problem with jettisoning Python2 support but it should be a conscious decision and not just because software was poorly maintained.

If that is the end goal, I recommend someone make another pull request that "fixes" #68 by means to removing Python2 support, including documenting such and that it now only supports Python3+ (or even something later like a specific Python3.x+, e. g. Python3.8+, since Python3.7 will be end-of-life later this month on 2023-06-27).

maddes-b commented 1 year ago

Do not remove Python2 support, desüite being End-of-Life. Admins are stuck on machines with Python2 only due to special cases. Also Python2 does not disturb any functionality.