From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GPRAJhzsqmX7YAEA62LTzQ:P1 (envelope-from ) for ; Fri, 19 Jan 2024 22:39:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GPRAJhzsqmX7YAEA62LTzQ (envelope-from ) for ; Fri, 19 Jan 2024 22:39:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=IxwzdTNt; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705700380; 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=V2ykVtXW7Myh8t88vnS1q5SpbH2z1Be26fLtABW+muw=; b=G5UX8nZFg1JmAGmJIZ0BQzdBv8Fp3BSBY61eR7MscwGQdZrR3nYZcEzkNigTAPbYzabDAq q3UsZX5Khhmq8AcjVGLQKFStniv/Key1lfqw10U5hkE3k3AraIrwn4uiwYlOnOLOmq3U0q 3Ioc7XB+eYtMTAIOgiH6NUUR/SHJB4vPf7VtGhq/aBZC9SkfnGolww+/5dtc8T01bgV8zz D8L8GO87hkr4NgHcaOY34oE2NnXL7s6fzf+Mp5mv4c/enK/St0FNmjUTZZLa7f1Z6tai0M 50rVg9ATjWm6aRovutn3xqlc2O+FIkYrwB3Ktb3WjZFMACZcp7hFlekVGnxfrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=IxwzdTNt; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705700380; a=rsa-sha256; cv=none; b=eHTkeVTI8knkdMPbGnT2oZM0VZKFClgRbAEBlM5mVRzymKxmWFGGsjJTzRHJlKTAfJov2X 8g2/wxDj/t6VQrl2bxqFpPZ+RGt1nrW95sAOSfrnga9Zp3gYks2F4dKnJ5vPzMUscXwShr GLWrVIfXxYuXYVg5thrIjdlcZIeZUJR7SRLCScLJq7KRDpvtfPVavWlGHjQCAIwuGtIvK1 kPtkW0/qCI2nTQ6oQb0tjagTW7bSkhyvoNDduCGh9HAdSgfE5YvR0Cih8P51v1QhNBSgv5 HwGnxBCMZan9t5tiJCGD1l0MTfYcfXS3vsk6J6r3EUIMcQBdZtz+peeYcD4SjQ== 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 DF434248B5 for ; Fri, 19 Jan 2024 22:39:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQwaE-0000qw-Bs; Fri, 19 Jan 2024 16:39:26 -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 1rQwaB-0000my-Il for help-guix@gnu.org; Fri, 19 Jan 2024 16:39:24 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQwa9-0003RS-Jf for help-guix@gnu.org; Fri, 19 Jan 2024 16:39:23 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C418824002A for ; Fri, 19 Jan 2024 22:39:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705700351; bh=WeMKxxtOO2hbdGqrMP54gjwsl+9K9FTTrp01plb1TfE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=IxwzdTNtQLyWFe+R2Y6u6ZQ7sYSdF5dGuWc27oLvkre3XheF0U9m3RZvvACDQG1AE RLVwVyNcDJOqB544LY63aSyL+yF1JxbC8nnHBF6Ogki7sjyWjSpVTy2BIwLG+aP+aw OLzGuuGEdG4GWydxv4ws9LKOLl9H6d4W5Y17dNWkxUxWhiC0g4p4MsLcgL28vEw9+2 x1X2XGFkPtc0qTYQlGO+ccI5L9FwGqbC3AiP5b1jSz77st3QpFf5p+JbXazCWbLB0N G/8swTmXiMSELE/7nosYbYi7SgvIzAtt1bK87SnTAAFXocrm3jR5AcQsFojM6OZNp+ pg0rzBs2+5Fgg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TGtKp73Kdz6tvp; Fri, 19 Jan 2024 22:39:10 +0100 (CET) References: <87jzrdtao6.fsf@posteo.net> From: =?utf-8?Q?Th=C3=A9o?= Tyburn To: Tomas Volf Cc: help-guix@gnu.org Subject: Re: Make a simple guile script to a package - source local file Date: Fri, 19 Jan 2024 21:28:44 +0000 In-reply-to: Message-ID: <87h6j90zrf.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=theo.tyburn@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: -10.40 X-Spam-Score: -10.40 X-Migadu-Queue-Id: DF434248B5 X-Migadu-Scanner: mx12.migadu.com X-TUID: JupYmDjXsRdH 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 comman= d 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. Any hints ?=20 Tomas Volf writes: > [[PGP Signed Part:Undecided]] > On 2023-10-23 18:01:12 +0000, Th=C3=A9o Tyburn wrote: >> Hi, >>=20 >> I have some guile CLI scripts and I would like to make them accessible >> in $PATH by putting each of them in a package. >>=20 >> Is there a simple way to do this without having to make a git >> repository ? What I would like is something like this: >>=20 >> > (package >> > (name "script1") >> > (version "0.0.0") >> > (source (LOCAL-DIR "/path/to/scripts/")) >> > (build-system trivial-build-system)) >>=20 >> and then copy the guile script to /bin using the trivial build-system. >>=20 >> I guess what I'm looking for is a function like LOCAL-DIR. It would be >> similar to git-checkout but wouldn't require git. Is there such >> a thing ? > > I believe you are looking for (source (local-file ..)), example can be fo= und in > this excellent blog post: > > https://guix.gnu.org/en/blog/2023/from-development-environments-to-contin= uous-integrationthe-ultimate-guide-to-software-development-with-guix/ > >>=20 >> Cheers, >>=20 >> Th=C3=A9o >> > > )t.