all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Lasse Schlör" <lasse.schloer@uni-tuebingen.de>, help-guix@gnu.org
Subject: Re: Replicable environment with Python packages missing from Guix
Date: Wed, 11 Oct 2023 12:12:46 +0200	[thread overview]
Message-ID: <86fs2hjwm9.fsf@gmail.com> (raw)
In-Reply-To: <D56FE4C6-EC4B-4655-9936-597793E1845A@uni-tuebingen.de>

Hi,

On Thu, 05 Oct 2023 at 15:00, Lasse Schlör <lasse.schloer@uni-tuebingen.de> wrote:

> 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.

Well, sadly Guix cannot fix the world. :-) Here, PsychoPy is poorly
packaged in PyPI, thus there is no easy way to write Guix recipe for it.

--8<---------------cut here---------------start------------->8---
$ guix import pypi PsychoPy -r

Starting download of /tmp/guix-file.6lTxL2
From https://files.pythonhosted.org/packages/16/17/a73ebae6cfcbd6f4cf094fba59b17f1ca1b03b6a8c0afdaa11468bc3fe62/psychopy-2023.2.3.tar.gz...
 …3.2.3.tar.gz  34.3MiB               550KiB/s 01:04 ▕██████████████████▏ 100.0%
guix import: warning: Cannot guess requirements from source archive: no requires.txt file found.
(define-public python-psychopy
  (package
    (name "python-psychopy")
    (version "2023.2.3")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "psychopy" version))
              (sha256
               (base32
                "0mf3gas4892108c7y0n8sl7phkl6w2z4lgymb4n0d6h9p6g58mpq"))))
    (build-system pyproject-build-system)
    (home-page "")
    (synopsis
     "PsychoPy provides easy, precise, flexible experiments in behavioural sciences")
    (description
     "@code{PsychoPy} provides easy, precise, flexible experiments in behavioural
sciences")
    (license #f)))
--8<---------------cut here---------------end--------------->8---

All, and I do not see that packages in any of extra scientific channels:

    https://hpc.guix.info/channels/

but I can have overlooked.

> 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.

If I understand correctly, here the only thing you will be able to
reproduce from one machine to another is ’python3’.  But you have no
guarantee that you will be able to reproduce ~/.local elsewhere.  Well,
based on my poor knowledge of ’pip’and PyPI.

However, that’s already good.  Because it means that if your
computations work in an isolated environment created with “guix shell
--container” then it means there is no leak to system-wide libraries.
And, to my knowledge, this kind of packages are easier to package. ;-)


> 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?

The only way to have replicable Guix environment is to fully control all
the chain, and thus, it means to have a Guix recipe for the packages.

However, as you are pointing, when packages are missing, I accept the
trade-off to work with language-specific package manager knowing that I
loose some guarantees for reproducing.  Trade-off. :-)



Cheers,
simon


      parent reply	other threads:[~2023-10-11 10:38 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
2023-10-11 10:12 ` Simon Tournier [this message]

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=86fs2hjwm9.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --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.
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.