unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: phodina via <help-guix@gnu.org>
To: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Import package and generate use-module
Date: Sat, 24 Apr 2021 09:26:20 +0000	[thread overview]
Message-ID: <jrrHxZCGKIa9oIkPBHShtlIMMIrYh1wVjkUiIKOshxXqPNTlS9Fs0b7TqymjuPCiG2pFsj6AYu8I8_Tox0IlIOHglvsWoiC-TMAGiqVSKtg=@protonmail.com> (raw)

I'm making a package for octoprint which is imported from PyPI. guix import -r octoprint generates the template to build the package.

However, I'm missing the :#use-module ... in order to build the package when I add (define-module (python-octoprint). Given the fact there are tens of inputs doing it manually seems tedious and writing a script to parse the package definition seems like reinventing the wheel as I'm certainly not the first person to run into this issue.

So is there a way to automate also this part?

Let me give you context:If I look at Guix package repository gnu/packages/python-xyz.scm I see there definitions of packages:

(define-public python-numpy
  (package
    (name "python-numpy")
...

If I have another package that depends on python-numpy I just provide the name in e.g. inputs and I don't have to import it with #:use-module within this file.

However, when I run guix import pypi PKG I get package definition and when I run guix build -f python-octoprint.scm I get this error:

/tmp/python-octoprint.scm:275:6: In procedure propagated-inputs:
error: python-flask: unbound variable
hint: Did you forget `(use-modules (gnu packages python-web))'?

Of course writing down all the unbound variables by hand is tedious and error-prone. And since guix gives a hint is there a way to write the dependency into the file?

And the question in general is: When I find out that the program is not packaged and I want to write the package definition and then verify it installs and runs correctly, what steps should I take?

guix pull pypi PKG > PKG.scm
# Add 'define-module'
??
guix build -f PKG.scm

Note: Doesn't matter if it's python or rust program. I'm interested in the workflow

Kind regards
Petr Hodina

Sent with [ProtonMail](https://protonmail.com) Secure Email.

             reply	other threads:[~2021-04-24  9:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  9:26 phodina via [this message]
2021-04-24 13:54 ` Import package and generate use-module Ekaitz Zarraga

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='jrrHxZCGKIa9oIkPBHShtlIMMIrYh1wVjkUiIKOshxXqPNTlS9Fs0b7TqymjuPCiG2pFsj6AYu8I8_Tox0IlIOHglvsWoiC-TMAGiqVSKtg=@protonmail.com' \
    --to=help-guix@gnu.org \
    --cc=phodina@protonmail.com \
    /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).