From: Richard Sent <richard@freakingpenguin.com>
To: "Théo Tyburn" <theo.tyburn@posteo.net>
Cc: Tomas Volf <wolf@wolfsden.cz>, help-guix@gnu.org
Subject: Re: Make a simple guile script to a package - source local file
Date: Fri, 19 Jan 2024 17:44:12 -0500 [thread overview]
Message-ID: <877ck5djur.fsf@freakingpenguin.com> (raw)
In-Reply-To: <87h6j90zrf.fsf@posteo.net> ("Théo Tyburn"'s message of "Fri, 19 Jan 2024 21:28:44 +0000")
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.
next prev parent reply other threads:[~2024-01-19 22:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 18:01 Make a simple guile script to a package - source local file Théo Tyburn
2023-10-26 14:18 ` Tomas Volf
2023-10-29 8:44 ` Théo Tyburn
2024-01-19 21:28 ` Théo Tyburn
2024-01-19 21:46 ` Felix Lechner via
2024-01-20 17:19 ` Théo Tyburn
2024-01-19 22:44 ` Richard Sent [this message]
2024-01-20 12:32 ` Théo Tyburn
2024-01-20 13:29 ` Tomas Volf
2024-01-20 18:05 ` Théo Tyburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ck5djur.fsf@freakingpenguin.com \
--to=richard@freakingpenguin.com \
--cc=help-guix@gnu.org \
--cc=theo.tyburn@posteo.net \
--cc=wolf@wolfsden.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.