From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: Re: [PATCH] import: pypi: Detect inputs. Date: Tue, 23 Jun 2015 23:04:00 +0200 Message-ID: <5589C9C0.1070709@gmail.com> References: <87d217uvzd.fsf@gnu.org> <1434331554-13170-1-git-send-email-tipecaml@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7VMZ-0005Cu-JI for guix-devel@gnu.org; Tue, 23 Jun 2015 17:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7VMU-0000yV-HK for guix-devel@gnu.org; Tue, 23 Jun 2015 17:04:11 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:38011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7VMU-0000yP-Bb for guix-devel@gnu.org; Tue, 23 Jun 2015 17:04:06 -0400 Received: by wibdq8 with SMTP id dq8so28635709wib.1 for ; Tue, 23 Jun 2015 14:04:05 -0700 (PDT) In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Amirouche Boubekki Cc: guix-devel@gnu.org On 06/18/2015 12:45 PM, Amirouche Boubekki wrote: > Héllo, > Hey, > > If I'm not mistaken this patch relies only on the presence of > requirements.txt. This is not a required file in python packaging. > otherwise said, we miss a lot using this method. I think the best way to > do that would be to: > Indeed, requirements.txt is not required. Note that if this file does not exist, "guix import pypi" will not fail, so this patch should not be breaking anything. > - download the package and extract it > - create an environment (#) > - create a virtual env with access to system site package of the > environment (#) > - enter the venv and install the package > - use `pip freeze -l` to retrieve the full set of dependencies > That seems nice, but: 1) I would like to be able to determine whether we have the "right" version of all the dependencies in the current list of packages (if requirements.txt specifies "foobar>=2.0" and we only have python-foo-1.0 in Guix, the user should be told that python-foo should be upgraded), and pip freeze will just give you "pinned" versions (foo==2.0); 2) "pip freeze" will list everything that is installed in the virtual environment, including the dependencies of the actual dependencies, and we do not want that. > If it fails (because of missing system dependencies) fallback to parse > setup.py (with guile-log?) and plain requirements.txt. It would be nice > to allow to drop to guix environment (#) when the first option fails to > inspect and install missing system dependencies manually. > I really do not want to parse setup.py, because you can put any Python code you want in there, so parsing it properly would require a Python parser, and an AI that can determine what the code is meant to do. That might be a bit too complex. WDYT? Cyril.