-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
split code into separate module and tool #79
Conversation
Currently http://www.jefftk.com/icdiff has "install for mac/linux" with:
I'd really like to keep an installation option like this available, where people can run a simple command and end up with an I'm not really sure what the right way to do this is? |
My approach would be to upload the new split icdiff package to PyPI and thd then change the icdiff web page to suggest using pip:
This would install both the module and the executable (into |
sudo pip install icdiff This is already working. With having both option. icdiff working as commandline tool and as module. |
I'd also very much prefer that icdiff could be used in both ways. I agree that pip is "quite common nowadays", though, on my production machines I still refuse to run pip as root. Here I prefer single file scripts that I can easily review, install and update by means of http and cat. In fact, I wouldn't be following Jeff's icdiff if it wasn't for the fact that he offered a single file solution. |
Ah, I see (concerning #75)... so if I understand the |
You got it right @satta |
FYI the "proper" way to do this is using setuptools, see http://python-packaging.readthedocs.io/en/latest/command-line-scripts.html and also codespell-project/codespell#136 as this allows it to work from the command-line on all platforms (e.g. by automatically creating |
This PR restructures the code of icdiff to provide a separate
icdiff
module which is installed separately in a Python module directory as well as as scripticdiff
which is meant to go into the$PATH
. This is IMHO another (cleaner?) way to address #72, #73 etc. without having to add the.py
extension to the main script.My changed variant still runs the tests successfully in the local cloned as well as the installed version.
Comments? Maybe there is a more Pythonic way to do this ;)