unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: wolf <wolf@wolfsden.cz>
To: "Lasse Schlör" <lasse.schloer@uni-tuebingen.de>
Cc: help-guix@gnu.org
Subject: Re: Replicable environment with Python packages missing from Guix
Date: Mon, 9 Oct 2023 15:13:36 +0200	[thread overview]
Message-ID: <ZSP8gNzhiTvgbAqs@ws> (raw)
In-Reply-To: <D56FE4C6-EC4B-4655-9936-597793E1845A@uni-tuebingen.de>

[-- Attachment #1: Type: text/plain, Size: 2649 bytes --]

On 2023-10-05 15:00:13 +0200, Lasse Schlör wrote:
> Hello,
> 
> I am in the process of setting up a replicable environment (OS & software versions) for a research project using Guix. This includes an installation of the Python package PsychoPy.
> 
> As far as I understand, the ideal way to do this is to use a `manifest.scm` file that includes a `python-psychopy` package together with a `channels.scm` to pin/freeze the exact software versions.
> 
> Currently, no PsychoPy package exists for Guix, and so I attempted to write my own Guix packages for PsychoPy and those of its dependencies that don't exist as Guix packages either.
> 
> However, while I was able to successfully wrap a few Python packages as Guix packages, the number of build and test dependencies turns out to be quite large, and I am not sure I have the knowledge and time to write Guix packages for all of them.

You could try to use output of `guix import'[0] as a base.

0: https://guix.gnu.org/manual/en/manual/devel/en/html_node/Invoking-guix-import.html

> 
> As a workaround, I have instead written a manifest file that provides a fixed version of Python, Pip, and some of PsychoPy's dependencies. I can use this to start a container with `guix time-machine […] -- shell --container --share=path/to/persistent/.local=/home/username/.local […]`, which has a persistent `~/.local` directory, into which the correct version of PsychoPy can be installed via `python3 -m pip install -r path/to/requirements.txt`. Making `~/.local` persistent allows to start new instances of this container without having to re-install PsychoPy every time.
> 
> Of course, this doesn't feel as elegant as the purely functional Guix way of doing things. I am sure others before me have had similar situations. Thus, my question is: Is there a known/preferred/elegant way of creating replicable Guix environments with fixed versions of Python packages when these packages do not exist as Guix packages?

Maybe someone will correct me and provide a better way, but I am afraid the
correct approach here is to indeed create the packages in the manifest file.

Hm, maybe there is an ugly solution, which however might work.  You could do the
pip install and then archive and package the resulting directory.  That will be
messy, but it might work.

However, I would recommend just trying to make the packages, possibly using guix
import.

> 
> I'd appreciate any insight on this.
> 
> Thanks and best regards,
> Lasse Schlör
> 
>

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-10-09 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 13:00 Replicable environment with Python packages missing from Guix Lasse Schlör
2023-10-09 13:13 ` wolf [this message]
2023-10-11 10:12 ` Simon Tournier

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSP8gNzhiTvgbAqs@ws \
    --to=wolf@wolfsden.cz \
    --cc=help-guix@gnu.org \
    --cc=lasse.schloer@uni-tuebingen.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).