unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: help-guix <help-guix@gnu.org>
Subject: Profiles for Python projects
Date: Thu, 18 Jun 2020 18:53:44 +0200	[thread overview]
Message-ID: <c1bca050-f209-0297-5b00-d736b2794a60@posteo.de> (raw)

Hi Guix Users!

Today I experimented a little with creating profiles from manifest.scm
file for Python projects. I have the following manifest.scm:

(specifications->manifest
 '("python@3.8.2"
   "python-falcon@2.0.0"
   "python-levenshtein@0.12.0"
   "python-jsonschema@3.2.0"
   "python-pytest@5.3.5"))

I create a profile with that and it works fine:

guix package --manifest="manifest.scm" --profile="${GUIX_EXTRA_PROFILES}"/my-env/my-env

Then I do the sourcing:

GUIX_PROFILE="${GUIX_EXTRA_PROFILES}/my-env/my-env"; source "${GUIX_PROFILE}/etc/profile"

This also works fine and when I do:

which python3
#
which pytest

I also get a path in the profile I created. So far all seems to just
work. However, then I hit a snag when trying to run the tests of the
project:

LOG_LEVEL="DEBUG" PYTHONPATH="$(pwd)/my_project" python3 -m pytest -m "my_test_marker" -s -vvv

I now get the error:

No module named pytest

So it seems, that somehow modules mentioned with

-m <module>

Are not found. If I use PyTest without

python3 -m

in front, it also does not find libraries and I get errors for the
dependencies of the actual project.

Perhaps there is an easy fix for this. Has anyone used a Guix profile
like this before and knows how to make it work?

Regards,
Zelphir


             reply	other threads:[~2020-06-18 16:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:53 Zelphir Kaltstahl [this message]
2020-06-18 22:22 ` Profiles for Python projects Marius Bakke
2020-06-19  9:04   ` Zelphir Kaltstahl

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=c1bca050-f209-0297-5b00-d736b2794a60@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=help-guix@gnu.org \
    /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).