unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Antwane Mason <ad.mason1413@gmail.com>
To: help-guix@gnu.org
Subject: Re: Python Tox Dependencies Invisible to Pip
Date: Thu, 26 Aug 2021 21:53:49 -0400	[thread overview]
Message-ID: <CAAztfgLy4BZkt115cUfze48HVwy=S63W5QWqUms76MC7oxb1vg@mail.gmail.com> (raw)
In-Reply-To: <CAAztfgKJSJZk_MMBJZWS=d52knvYzvHumprzq-xe-Pt05gsYtw@mail.gmail.com>

It turns out my intuition was right and I needed to prevent tox from
unsetting PYTHONPATH environment variable. The solution was to add a build
phase prior to testing that passes the PYTHONPATH environment variable to
the virtual environments. Unrelated to the problem, I also needed to tell
tox to skip interpreters that are not present on my system and I needed to
adjust the test command to point to the "tests" folder where the unit tests
were stored. Below is the resulting package definition. I'm one step closer
to building python-onlykey package but now having to fight with test
failures while building python-verspec, another transitive dependency of
python-onlykey.

------------------------------------------------
(define-public python-virtualenv-clone
  (package
    (name "python-virtualenv-clone")
    (version "0.5.6")
    (source
      (origin
        (method git-fetch)
        (uri
         (git-reference (url "
https://github.com/edwardgeorge/virtualenv-clone")
                        (commit version)))
        (sha256
          (base32
            "0xb20fhl99dw5vnyb43sjpj9628nbdnwp5g7m8f2id7w8kpwzvfw"))))
    (native-inputs
     `(("python-pytest" ,python-pytest)
       ("python-tox" ,python-tox)
       ("python-virtualenv" ,python-virtualenv)))
    (build-system python-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-before 'check 'configure-tox
                    (lambda _
                      (substitute* "tox.ini"
                        (("(\\[testenv\\])" section-header)
                          (string-append section-header
                                         "\npassenv = PYTHONPATH"))
                        (("(\\[tox\\])" section-header)
                          (string-append section-header
                                         "\nskip_missing_interpreters =
true"))
                        (("(commands = py.test -v) \\[\\]" _ cmd)
                         (string-append cmd " tests")))
                      #t)))))
    (home-page
     "https://github.com/edwardgeorge/virtualenv-clone")
    (synopsis "script to clone virtualenvs.")
    (description "script to clone virtualenvs.")
    (license license:expat)))
------------------------------------------------
Regards,
Antwane

      reply	other threads:[~2021-08-27  1:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 12:29 Python Tox Dependencies Invisible to Pip Antwane Mason
2021-08-27  1:53 ` Antwane Mason [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

  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='CAAztfgLy4BZkt115cUfze48HVwy=S63W5QWqUms76MC7oxb1vg@mail.gmail.com' \
    --to=ad.mason1413@gmail.com \
    --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).