ntfy icon indicating copy to clipboard operation
ntfy copied to clipboard

Installation instructions suggestion

Open pmav99 opened this issue 8 years ago • 8 comments

Instead of suggesting to install using sudo pip install ntfy wouldn't it be a bit safer/cleaner to suggest pip install --user ntfy instead? This way ntfy will be installed in $HOME/.local and you will not end up with a mix of pip-installed and package-manager-installed packages in your system's python distribution.

pmav99 avatar Dec 18 '17 09:12 pmav99

I agree that the --user option is great, but Homebrew is stupid and I'd rather not suggest a default installation method that won't work for many users.

dschep avatar Dec 18 '17 14:12 dschep

Oh, I see. I don't have a Mac, so I wasn't aware of that.

Well, in that case OS-specific instructions might make sense. E.g.

Installation
------------

Linux & Windows
~~~~~~~~~~~~~~~

.. code:: shell

    pip install --user ntfy

Mac OS
~~~~~~

Due to a bug in homebrewed python, ``pip install --user`` cannot be used, so installing using ``sudo`` is the recommended way.

.. code:: shell

    sudo pip install ntfy

Quickstart
----------

.. code:: shell

    $ ntfy send test
    # send a notification when the command `sleep 10` finishes
    # this sends the message '"sleep 10" succeeded in 0:10 minutes'
    $ ntfy done sleep 10
    $ ntfy -b pushover -o user_key t0k3n send 'Pushover test!'
    $ ntfy -t 'ntfy' send "Here's a custom notification title!"
    $ echo -e 'backends: ["pushover"]\npushover: {"user_key": "t0k3n"}' > ~/.ntfy.yml
    $ ntfy send "Pushover via config file!"
    $ ntfy done --pid 6379  # pid extra
    $ ntfy send ":tada: ntfy supports emoji! :100:"  # emoji extra
    # Enable shell integration
    $ echo 'eval "$(ntfy shell-integration)"' >> ~/.bashrc


pmav99 avatar Dec 18 '17 15:12 pmav99

I'll mull this idea over and decide later.

Fun fact: Debian makes the --user flag on by default for non-root users.

dschep avatar Dec 18 '17 15:12 dschep

Fair enough :)

pmav99 avatar Dec 18 '17 15:12 pmav99

Just for the record, one more alternative to installing ntfy is also pipx

pipx install ntfy 

will install it on it's own virtualenv

pmav99 avatar Jan 07 '19 11:01 pmav99

Oh.. never heard of pipx sounds like a souped up pipsi. Thanks for bumping this issue. I think maybe there should be 1 recommended way and then a lot of extra docs on other ways. Similar to how pipenv does it: https://pipenv.readthedocs.io/en/latest/#install-pipenv-today & https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv interestingly enough, it used to included pipsi but doesn't seem to any more 🤔

dschep avatar Jan 07 '19 13:01 dschep

yes, pipx is a vamped up pipsi. Unfortunately pipsi development seems to have stopped. The creator of pipx used to be a pipsi contributor: https://github.com/mitsuhiko/pipsi/graphs/contributors (he is cs01)

For the record, there are more options

  • The one that pipx, pipsi and poetry are using, which is to bootstrap a virtualenv using a custom python script.

  • The one that pip and pipenv are using which is to ship the whole package as a binary blob (at least it should be that, but I am too bored to actually check it :P )

Even though I understand the need of those bootstrapping scripts, I think that in the long run the pipsi/pipx road is the way to go. The overhead is ~20MB per virtualenv which is IMHO an acceptable price for a desktop/server.

pmav99 avatar Jan 07 '19 15:01 pmav99