all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Prototype for using Guix with python packages
Date: Sat, 10 Sep 2016 14:09:58 +0100	[thread overview]
Message-ID: <acf27952-7eb5-8627-f665-28ac25a7beea@cbaines.net> (raw)
In-Reply-To: <87fupbn713.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 3955 bytes --]

On 07/09/16 15:01, Ludovic Courtès wrote:
>> For a few months now, I've been assembling a prototype for how packages
>> could be produced for software released as Python source distributions
>> (sdists) [1].
> 
> Woow, quite an achievement!  Do you know how many of the automatically
> generated packages built from source flawlessly?

Not exactly, I disabled quite a few test suites, and made some
requirements stricter in some cases among other things.

> IIRC, ‘guix import pypi’ currently produces templates that can require
> extra tweaks, although that was improved by reading metadata from
> Wheels.
> 
> How does sdist metadata differ from PyPI or Wheels metadata?  Is it
> generally more complete, or of better quality?

sdists normally contain a .egg-info directory (e.g. sentry.egg-info),
which contains a requires.txt file, which as far as I can tell contains
the same information as the metadata.json in a wheel.

I use that, as it means I can get the data without having to rely on the
existence of a wheel.

Its still really poor quality though, as it does not include
dependencies required to run the tests, nor build system dependencies
(e.g. setuptools or otherwise) which may be found in a different file [1].

1: https://www.python.org/dev/peps/pep-0518/

>> I will also try to look at how what I have been doing could be used to
>> improve the Guix PyPI importer and the Python build system, as well as
>> submit the packages that are currently just in the guix-env.scm file in
>> the repository (pyguile, libsolv) for inclusion in Guix.
> 
> That would be awesome!  Anything towards making the output of ‘guix
> import’ work out of the box would be great.

I think the next steps towards this would be:
 - Switch from downloading wheels to just using the requires.txt in the
.egg-info directory
 - Add support for https://www.python.org/dev/peps/pep-0518/
 - Identify when PBR (Python Build Reasonableness) is in use, as it may
mean that the test requirements are available (in test-requirements.txt)

In my attempt to do this in a very automated way, I've only done the
first point, but I build the package and parse the build log for signs
of missing dependencies if the build fails, and then repeat the build.
This is done first with the tests disabled, and then if it eventually
builds, again with the tests enabled. I'm not sure if you would want
guix import to do this?

>> I'm quite excited by the possibilities offered by approaches like this,
>> and was wondering if anyone has feedback, questions, opinions, or if
>> anyone is working on something similar?
> 
> That reminds me of the “recursive importer” that has been discussed a
> few times and is currently implemented (but not in master yet) for the
> CRAN and NPM importers.  Perhaps your work could be somehow integrated
> to get a recursive PyPI/sdist importer?
> 
> An idea would be to automatically put all the imported packages into,
> say, ~/.cache/guix/python, and add that to GUIX_PACKAGE_PATH.  Then we
> could run “guix import pypi --update” to update it, or something like
> that.

The main reason why I didn't just improve the importer is that I was
looking for a way to collaborate around getting multiple versions of
python packages building and working, and as far as I am aware, Guix
only contains multiple versions of the same piece of software in some
special cases?

I have implemented a recursive importer, but, I'm not trying to generate
Guix package records, but instead records describing the versioned
requirements, as from this, build graphs can be generated. I don't like
this approach in that it duplicates a few packages in the Guix
repository, but having multiple versions can be really useful in some
circumstances.

Thanks for your feedback Ludo, and it would be really interesting to
hear your thoughts on the multiple version issue.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 955 bytes --]

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  6:26 Prototype for using Guix with python packages Christopher Baines
2016-09-07 14:01 ` Ludovic Courtès
2016-09-10 13:09   ` Christopher Baines [this message]
2016-09-11 13:43     ` Ludovic Courtès
2016-09-11 14:25       ` Christopher Baines
2016-09-11 20:34         ` Ludovic Courtès

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=acf27952-7eb5-8627-f665-28ac25a7beea@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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.
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.