From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SN++AGB9kl8sBwAA0tVLHw (envelope-from ) for ; Fri, 23 Oct 2020 06:51:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6P+GNl99kl9qYgAAbx9fmQ (envelope-from ) for ; Fri, 23 Oct 2020 06:51:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 807FD9403A6 for ; Fri, 23 Oct 2020 06:51:11 +0000 (UTC) Received: from localhost ([::1]:51864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVqus-00038j-EH for larch@yhetil.org; Fri, 23 Oct 2020 02:51:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVqrZ-0000dS-RU for guix-devel@gnu.org; Fri, 23 Oct 2020 02:47:45 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVqrW-00047W-F1 for guix-devel@gnu.org; Fri, 23 Oct 2020 02:47:45 -0400 X-Originating-IP: 176.185.184.238 Received: from localhost (static-176-185-184-238.ftth.abo.bbox.fr [176.185.184.238]) (Authenticated sender: tanguy@bioneland.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id EFF78FF808; Fri, 23 Oct 2020 06:47:38 +0000 (UTC) Date: Fri, 23 Oct 2020 08:47:38 +0200 From: Tanguy Le Carrour To: Christopher Baines Subject: Re: Packaging Python projects managed with Poetry Message-ID: <20201023064738.tdldnv7bwqv5awid@melmoth> References: <20201022151520.mmq6pyqjc6kxevre@rafflesia> <87blgugrg8.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87blgugrg8.fsf@cbaines.net> Received-SPF: none client-ip=217.70.183.199; envelope-from=tanguy@bioneland.org; helo=relay9-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/23 02:47:39 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: q6m3wKwc6m8a Hi Christopher, Thanks for your answer! Le 10/22, Christopher Baines a écrit : > Tanguy Le Carrour writes: > > I've been happily working with Poetry to manage my Python projects, but > > now, for the first time, I would like to package one of those projects > > for Guix. > > > > The Python packages I build do not contain any tests or specs, because > > to me, they don't belong there. But, I need those tests to make sure > > that my package works with the versions of the dependencies available on > > Guix. > > > > The problem is that the source code that I fetch from the git repository > > contains the test, but does not contain a `setup.py` file –because Poetry > > does not use it!—, and the `python-build-system` fails. > > > > I haven't wrap my head around this yet and I'm not sure what would be > > the proper way to do it? Write a `python-poetry-build-system`? I hope not! > > Just put the d**n tests in the Python package? This would look like a > > failure to me! :-( > > > > Any thought, help, guidance welcome! Thanks! :-) > > My first thought, is what would it require for the existing > python-build-system to detect and support building the things you > describe? Mmmm… I guess it would require fixing some of the phases, like stopping it from trying to patch `setup.py`. The tests would have to be run from the source directory, but the command could be anything: `pytest`, `nosetest`, `invoke test`, `mamba`… Then, instead of running `python setup.py`, one should run `poetry build` and `pip install dist/name-of-the-package`. So I guess Danny is right and a poetry-build-system would make sense. > I haven't used Poetry myself, have you got a project that can be used as > an example? ``` $ git clone https://github.com/tlc28/test-poetry.git $ cd test-poetry/ $ poetry build $ pip install dist/test_poetry-0.1.0-py3-none-any.whl ``` > It looks like the python-build-system already has some functionality > that's dependent on the use-setuptools? argument. I guess I'll have to dig into it! Thanks for pointing out! -- Tanguy