Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Make it able to install googler with pip #162

Closed
jorgesumle opened this issue Dec 28, 2016 · 7 comments
Closed

Make it able to install googler with pip #162

jorgesumle opened this issue Dec 28, 2016 · 7 comments

Comments

@jorgesumle
Copy link

pip is very popular and makes things easier when it comes to installing and updating Python programs. The best approach would be to upload googler to PyPI. Unfortunately there is already a library called googler (https://pypi.python.org/pypi/googler), so we'd have to name it google-cli or something like that in PyPI.

@jorgesumle
Copy link
Author

#161

@jarun
Copy link
Owner

jarun commented Dec 28, 2016

Hi,

The devs have taken a conscious decision not to submit googler to PyPi earlier.

@zmwangx I can't find the earlier discussion now. Can you please share it here if you manage to find it?

@zmwangx
Copy link
Collaborator

zmwangx commented Dec 28, 2016

@jarun
Copy link
Owner

jarun commented Dec 28, 2016

Thank you! 👍

@kyrias
Copy link

kyrias commented Dec 30, 2016

Not wanting to submit it to PyPI doesn't mean that it makes less sense to make it possible to install it with pip though. setuptools is the current Python-wide standard for building and installing Python software overall, and special-snowflake packages that doesn't use it often cause some friction, and it's generally more of a hassle overall to not use it.

@jarun
Copy link
Owner

jarun commented Dec 30, 2016

Please check the discussion in #87 around this.

@zmwangx
Copy link
Collaborator

zmwangx commented Dec 30, 2016

setuptools is the current Python-wide standard for building and installing Python software overall

Thanks for the intro, but I am a Python programmer and am intimately familiar with setuptools. Let me briefly (actually not so briefly, after I finished writing) state my opinions against it for current and future observers:

  1. googler is a standalone script with zero dependency other than Python 3.3+, and I don't see that changing any time soon. As long as you have /usr/bin/env and a compliant python3 in your path you can run it, from anywhere. There's nothing that setuptools can help with other than install or link the script somewhere.

  2. We have a Makefile. Is ./setup.py install easier than make install? No.

  3. setuptools deals with packages. We'll need to have the structure of a package to use the default setup mechanism, something we won't do because there's no benefit. Alternatively, we can write custom code in setup.py (instead of just making a few preps and calling setuptools.setup) to do our own thing — basically make it a Makefile, but what's the damn point?

  4. setuptools doesn't handle man pages out of box, even if we opt into a package structure.

  5. If we opted into the package structure (again, won't happen), setuptools would install googler as an entry point, a debugging nightmare for people not familiar with setuptools. I mean, what the heck is

    #!/Users/zmwang/.pyenv/virtualenvs/tmp-e5fd4ae83b9f92b/bin/python3
    # EASY-INSTALL-ENTRY-SCRIPT: 'googler==2.9','console_scripts','googler'
    __requires__ = 'googler==2.9'
    import re
    import sys
    from pkg_resources import load_entry_point
    
    if __name__ == '__main__':
        sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
        sys.exit(
            load_entry_point('googler==2.9', 'console_scripts', 'googler')()
        )

    ???

  6. We have packages for Debian/Ubuntu and macOS Homebrew, those cover a huge swath of the potential user base. If someone bothers to submit googler to an rpm-based distro, e.g. Fedora/CentOS/OpenSUSE we'll be even better.

    For the rest of the people out there, I went out of my way to make it easy to install and upgrade as a single script: https://github.com/jarun/googler#downloading-a-single-file.

    Any of these options is simpler and more robust than plain setuptools which (1) requires cloning the repo / downloading a tarball and (2) doesn't handle upgrades. (The premise here is we're not going to submit to PyPI.)

special-snowflake packages that doesn't use it often cause some friction, and it's generally more of a hassle overall to not use it.

Generalization like this (basically FUD) doesn't contribute to the discussion. If you find specific hassles (other than "I don't want to read the f*king README"), please let us know.

@lock lock bot locked and limited conversation to collaborators Nov 15, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants