From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WP7zKGD7qmVfTgAAe85BDQ:P1 (envelope-from ) for ; Fri, 19 Jan 2024 23:44:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WP7zKGD7qmVfTgAAe85BDQ (envelope-from ) for ; Fri, 19 Jan 2024 23:44:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=ZgVKuEDT; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705704288; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=u/bJTBh0S69F3eVlsTYCzqBqm6bEokJimG0pSYhCEWM=; b=d1LOyzzQKtrOpTL9mYbymnLPtTSnFSAPz9mAiN2L7kAZOvkDK0UTBHGfKkHeL2R4hOY1Au zG1N99O1IxreoYZbZ/OVwTqYA2BzlV+OskKE9Hx8XgDN0v/3If9JYwOwGnKsAlNJLNjSsF aLap6nFSBSlJtJUOod2E40hx0SvDUoUWWfRxNmomAKWgn/we0qci5JmHJnnhJMQa4mvhB8 5sl/nnbJQ0tpc7hNVL7f03xVRnngHhvXm2jy+ACrZEbXdyXwQS0EiBISENQILHd/zEYIKl WfU0Ex8MK/Cw9NgDQWaFrb6l+zZDNMoPVOfu8xU34vETW0fUHljExjOSJPUFpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=ZgVKuEDT; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705704288; a=rsa-sha256; cv=none; b=gQjOVEZCFwti129yyfu0TPbWwPitLNwSdf+4s08ODQbTb9qP1Rqw8OjmIXdIUw/LmDlkII azUfl3SaYTNLTQJpSeF2SoJsrw7+z2YZdOZp18/aZG+wCkDZ2gLCFV89HvzGNQI3PujqnO UAqyFNDVZ1O0fIJnUYfYU6ofMQ4RU1PI8P9Xu02wlyZMm8ERyEezzcX/BvwEFYexyyFUfF Mh+UNoWgHf28h+el+qN7a04UHlZOnOCtyJ6FuoEHrkHOvojULZzrVBLG/6qmzWqMnMIofp 1r2PlCm1LofNayAclEGVYvp8Sflozupf9IlzAw4l0W1hk6+qQt3M8UeUhA3HoA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8C3035109B for ; Fri, 19 Jan 2024 23:44:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQxb8-00050M-W4; Fri, 19 Jan 2024 17:44:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQxb8-00050D-9E for help-guix@gnu.org; Fri, 19 Jan 2024 17:44:26 -0500 Received: from mail-108-mta27.mxroute.com ([136.175.108.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQxb6-0006ev-Nx for help-guix@gnu.org; Fri, 19 Jan 2024 17:44:26 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta27.mxroute.com (ZoneMTA) with ESMTPSA id 18d23e585f40003727.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 19 Jan 2024 22:44:21 +0000 X-Zone-Loop: 8f755ef6ac4a4bb83d3e29eefdd79437b3162ba11ee5 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=u/bJTBh0S69F3eVlsTYCzqBqm6bEokJimG0pSYhCEWM=; b=ZgVKuEDTceFLkK9aFHKEM1VHOz kKZG74W8GOBeXArATHTXotQkauG4zZ6wdodzcaki/HcUqykHkl2akrTIsuIv/K9hK11enYxtK+A57 c7b50ShP4N+0NlhuK8ZbRkwsLFUQsa2PL4yH49f+Z99bAhBOKTWT3EFe/gK8oKJMjjh17Cxzdkh7S cjuwdQTCxKJwD6kLmMiJE51zdJuH1yUEZnD+qfmZY1+tBNPiAT+E62aYUFhEqWPrQoFX2m1ZAoikV oKKOnAe0AD3wTvzATXnKh5sBwwzUPfKXwHutIBlEWM/baZTqsha1lhMNDeX4RtBjpLxYKVEY+1d8a /eIF6hpQ==; From: Richard Sent To: =?utf-8?Q?Th=C3=A9o?= Tyburn Cc: Tomas Volf , help-guix@gnu.org Subject: Re: Make a simple guile script to a package - source local file In-Reply-To: <87h6j90zrf.fsf@posteo.net> (=?utf-8?Q?=22Th=C3=A9o?= Tyburn"'s message of "Fri, 19 Jan 2024 21:28:44 +0000") References: <87jzrdtao6.fsf@posteo.net> <87h6j90zrf.fsf@posteo.net> Date: Fri, 19 Jan 2024 17:44:12 -0500 Message-ID: <877ck5djur.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.27; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta27.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.62 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -6.62 X-Migadu-Queue-Id: 8C3035109B X-TUID: nKAysX0LpJHs Th=C3=A9o Tyburn 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 comm= and 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. --=20 Take it easy, Richard Sent Making my computer weirder one commit at a time.