From: Tanguy Le Carrour <tanguy@bioneland.org>
To: Christopher Baines <mail@cbaines.net>
Cc: guix-devel@gnu.org
Subject: Re: Packaging Python projects managed with Poetry
Date: Fri, 23 Oct 2020 08:47:38 +0200 [thread overview]
Message-ID: <20201023064738.tdldnv7bwqv5awid@melmoth> (raw)
In-Reply-To: <87blgugrg8.fsf@cbaines.net>
Hi Christopher,
Thanks for your answer!
Le 10/22, Christopher Baines a écrit :
> Tanguy Le Carrour <tanguy@bioneland.org> 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
next prev parent reply other threads:[~2020-10-23 6:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 15:15 Packaging Python projects managed with Poetry Tanguy Le Carrour
2020-10-22 16:23 ` Christopher Baines
2020-10-23 6:47 ` Tanguy Le Carrour [this message]
2020-10-22 16:44 ` Danny Milosavljevic
2020-10-23 6:27 ` Tanguy Le Carrour
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=20201023064738.tdldnv7bwqv5awid@melmoth \
--to=tanguy@bioneland.org \
--cc=guix-devel@gnu.org \
--cc=mail@cbaines.net \
/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.