[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make a simple guile script to a package - source local file
From: |
Richard Sent |
Subject: |
Re: Make a simple guile script to a package - source local file |
Date: |
Fri, 19 Jan 2024 17:44:12 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Théo Tyburn <theo.tyburn@posteo.net> writes:
> Hi again,
>
> Now I want to package a python script that has some dependencies on
> python packages.
>
> How do I go about packaging it to make the script available from the command
> line
> without polluting the environment with the dependencies ? I am looking
> for a similar effect to running `guix shell python python-a python-b
> python-c -- my_script.py` but without re-entering the profile env all
> the time. Probably I could achieve this by making a profile and launch
> my script from a bash file that sources the profile beforehand, but this
> seems tedious. I would like to automate all this, in guile.
>
Depending on what you mean by polluting or re-entering the profile
information all the time this might not be what you want. When I write
scripts that rely on specific dependencies I don't want to permanently
install, I write the shebang like this:
--8<---------------cut here---------------start------------->8---
#!/usr/bin/env -S guix shell ruby ruby-colorize password-store -- ruby
--8<---------------cut here---------------end--------------->8---
This relies on /usr/bin/env supporting -S, which to my understanding
isn't POSIX but instead a coreutils extension. Pretty sure --container
would work here but I've not tried it.
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.