• Using pipx for packages as opposed to applications

    From Chris Green@3:633/280.2 to All on Sun Jan 12 08:54:32 2025
    Can one use pipx to wrap the process of creating an independent
    environment for a python package as opposed to a runnable application?

    E.g. I want to install and use pksheet but, as it's not available from
    the Debian repositories, I'll have to install it from PyPi. So I
    should put it in its own environment. Can pipx help me with this?

    --
    Chris Green
    ú

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Stefan Ram@3:633/280.2 to All on Sun Jan 12 20:54:35 2025
    Chris Green <cl@isbd.net> wrote or quoted:
    Can one use pipx to wrap the process of creating an independent
    environment for a python package as opposed to a runnable application?

    .---------------------------------------------------------------.
    | Heads up, I haven't put this advice through its paces myself, |
    | so take it with a grain of salt! |
    '---------------------------------------------------------------'

    Yo, pipx is really more for setting up and running Python CLI
    apps in their own little bubbles, not so much for creating
    separate playgrounds for regular Python packages. But hey,
    you can still use pipx to kind of sorta get what you want with
    pksheet, even if it's not your typical command-line deal.

    Here's the lowdown on using pipx for pksheet:

    1. Drop pksheet in with pipx:

    bash

    pipx install pksheet

    This bad boy will whip up a special spot just for pksheet and
    plop it in there.

    2. To rock pksheet in your Python scripts, you can run it through
    pipx like this:

    bash

    pipx run pksheet your_script.py

    This move will fire up your script using the pksheet setup in
    its own little world.

    Now, while this trick works, it's not exactly smooth sailing for
    everyday package use. For non-CLI packages like pksheet, you're
    better off sticking to the old-school virtual environment tools:

    1. Whip up a virtual environment:

    bash

    python3 -m venv pksheet_env

    2. Jump into that environment:

    bash

    source pksheet_env/bin/activate

    3. Grab pksheet:

    bash

    pip install pksheet

    4. Now you're golden to use pksheet in your Python scripts within
    this environment.

    To wrap it up, pipx can technically handle pksheet, but it's really
    more at home with CLI apps. For your run-of-the-mill Python packages,
    cooking up a dedicated virtual environment is the way to go.



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: Stefan Ram (3:633/280.2@fidonet)
  • From Left Right@3:633/280.2 to All on Sun Jan 12 21:02:00 2025
    What would be the intended use? If this is for other Debian users,
    then why not make a Debian package? If it's for yourself, why do you
    need to automate it?

    To be fair, I don't see a point in tools like pipx. Have never used
    it, and cannot imagine a scenario where I'd want to. It seems like
    there's always a better way to do what this tool alleges to be able to
    do...

    Also, you say that you want it in its own environment: then what
    difference does it make if it's on Debian or anywhere else? If you
    are distributing a library, it makes sense to incorporate it into the
    user's infrastructure. Either you do the integration, or let users
    decide how to best integrate it. If you provide them with the
    environment that they *must* use, that's going to be the worst of both
    worlds: users won't be able to use the library in the environment
    created by them, nor will this library integrate with the other
    libraries provided by the system. So, it's hard to imagine why your
    users would want that.

    On Sun, Jan 12, 2025 at 12:47=E2=80=AFAM Chris Green via Python-list <python-list@python.org> wrote:

    Can one use pipx to wrap the process of creating an independent
    environment for a python package as opposed to a runnable application?

    E.g. I want to install and use pksheet but, as it's not available from
    the Debian repositories, I'll have to install it from PyPi. So I
    should put it in its own environment. Can pipx help me with this?

    --
    Chris Green
    =C2=B7
    --
    https://mail.python.org/mailman/listinfo/python-list

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Stefan Ram@3:633/280.2 to All on Sun Jan 12 21:26:17 2025
    Chris Green <cl@isbd.net> wrote or quoted:
    E.g. I want to install and use pksheet but, as it's not available from
    the Debian repositories, I'll have to install it from PyPi.

    I can't dig up any "pksheet" on PyPI. So, you got to take
    my earlier response like a rumor from a random tech meetup in
    Palo Alto - sounds interesting, but needs serious verification.



    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: Stefan Ram (3:633/280.2@fidonet)
  • From Chris Green@3:633/280.2 to All on Sun Jan 12 23:11:22 2025
    Stefan Ram <ram@zedat.fu-berlin.de> wrote:
    Chris Green <cl@isbd.net> wrote or quoted:
    E.g. I want to install and use pksheet but, as it's not available from
    the Debian repositories, I'll have to install it from PyPi.

    I can't dig up any "pksheet" on PyPI. So, you got to take
    my earlier response like a rumor from a random tech meetup in
    Palo Alto - sounds interesting, but needs serious verification.

    Ah, oops, a typo. It's pysheet (I have pk on the brain from it being
    Point Kilometrique, distance markers on canals in France).

    Thanks for your previous response, it told me what I needed to know,
    that pipx isn't really going to do what I want particularly easily.


    If I DIY an environment for pysheet and then develop some python that
    uses it, how do I then make it accessible as a 'normal' program? This
    is just for my own use by the way, on (probably) just a couple of
    Linux systems.

    --
    Chris Green
    ú

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Thomas Passin@3:633/280.2 to All on Tue Jan 14 05:15:49 2025
    On 1/12/2025 7:11 AM, Chris Green via Python-list wrote:
    Stefan Ram <ram@zedat.fu-berlin.de> wrote:
    Chris Green <cl@isbd.net> wrote or quoted:
    E.g. I want to install and use pksheet but, as it's not available from
    the Debian repositories, I'll have to install it from PyPi.

    I can't dig up any "pksheet" on PyPI. So, you got to take
    my earlier response like a rumor from a random tech meetup in
    Palo Alto - sounds interesting, but needs serious verification.

    Ah, oops, a typo. It's pysheet (I have pk on the brain from it being
    Point Kilometrique, distance markers on canals in France).

    Thanks for your previous response, it told me what I needed to know,
    that pipx isn't really going to do what I want particularly easily.


    If I DIY an environment for pysheet and then develop some python that
    uses it, how do I then make it accessible as a 'normal' program? This
    is just for my own use by the way, on (probably) just a couple of
    Linux systems.

    Create a launch script that sets the environmental variables and
    launches the program.


    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)