Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #16461 > unrolled thread

pybuild: Build-testing with the package installed

Started byMatthias Urlichs <matthias@urlichs.de>
First post2024-11-14 14:20 +0100
Last post2024-11-17 12:20 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.debian.maint.python


Contents

  pybuild: Build-testing with the package installed Matthias Urlichs <matthias@urlichs.de> - 2024-11-14 14:20 +0100
    Re: pybuild: Build-testing with the package installed Andrey Rakhmatullin <wrar@debian.org> - 2024-11-14 14:30 +0100
    Re: pybuild: Build-testing with the package installed Stefano Rivera <stefanor@debian.org> - 2024-11-14 15:00 +0100
      Re: pybuild: Build-testing with the package installed Matthias Urlichs <matthias@urlichs.de> - 2024-11-17 12:20 +0100

#16461 — pybuild: Build-testing with the package installed

FromMatthias Urlichs <matthias@urlichs.de>
Date2024-11-14 14:20 +0100
Subjectpybuild: Build-testing with the package installed
Message-ID<JIHVn-8Tb9-5@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi,

I'm trying to locally build a fixed version of a buggy package which 
happens to be installed on the system.

"debuild -b -us -uc" reports:

Successfully built moat_lib_codec-0.2.2-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with "installer" module
    dh_auto_test -O--buildsystem=pybuild
dh_auto_test: warning: Use of debian/compat is deprecated and will be removed in debhelper (>=14~).
I: pybuild base:311: cd /src/moat/lib/codec/.pybuild/cpython3_3.12_moat-lib-codec/build; python3.12 -m pytest tests

Note the nonexistence of "PYTHONPATH=." in this command line, which 
causes the test suite to use the installed version, which subsequently 
fails (that's the whole point of having a comprehensive test suite, 
after all …).

Is it possible to teach pybuild to do this the right way? I could always 
add a "override_dh_auto_test" stanza that calls pytest manually, but the 
whole point of standardized packaging is not having to do stuff like that.

The package is at https://github.com/M-o-a-T/moat-lib-codec/tree/deb 
(sorry, moving to Codeberg+Salsa hasn't quite reached the top of my TODO 
list …) if anybody wants to take a closer look.

-- 
-- regards,
-- 
-- Matthias Urlichs

[toc] | [next] | [standalone]


#16462

FromAndrey Rakhmatullin <wrar@debian.org>
Date2024-11-14 14:30 +0100
Message-ID<JII53-8Te2-1@gated-at.bofh.it>
In reply to#16461

[Multipart message — attachments visible in raw view] — view raw

On Thu, Nov 14, 2024 at 01:38:29PM +0100, Matthias Urlichs wrote:
> Hi,
> 
> I'm trying to locally build a fixed version of a buggy package which happens
> to be installed on the system.
> 
> "debuild -b -us -uc" reports:
> 
> Successfully built moat_lib_codec-0.2.2-py3-none-any.whl
> I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with "installer" module
>    dh_auto_test -O--buildsystem=pybuild
> dh_auto_test: warning: Use of debian/compat is deprecated and will be removed in debhelper (>=14~).
> I: pybuild base:311: cd /src/moat/lib/codec/.pybuild/cpython3_3.12_moat-lib-codec/build; python3.12 -m pytest tests
> 
> Note the nonexistence of "PYTHONPATH=." in this command line

python -m does that for you, doesn't it?

> which causes the test suite to use the installed version

I expect the problem to be caused by something else.




-- 
WBR, wRAR

[toc] | [prev] | [next] | [standalone]


#16463

FromStefano Rivera <stefanor@debian.org>
Date2024-11-14 15:00 +0100
Message-ID<JIIy5-8Toh-1@gated-at.bofh.it>
In reply to#16461
Hi Matthias (2024.11.14_12:38:29_+0000)
> Successfully built moat_lib_codec-0.2.2-py3-none-any.whl
> I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with "installer" module
>    dh_auto_test -O--buildsystem=pybuild
> dh_auto_test: warning: Use of debian/compat is deprecated and will be removed in debhelper (>=14~).
> I: pybuild base:311: cd /src/moat/lib/codec/.pybuild/cpython3_3.12_moat-lib-codec/build; python3.12 -m pytest tests

What I don't see there is what's failing. The package should have been
installed into build directory. But it won't have a .dist-info there, if
that matters.

What's not working? Where's the rest of this log?

Stefano

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

[toc] | [prev] | [next] | [standalone]


#16468

FromMatthias Urlichs <matthias@urlichs.de>
Date2024-11-17 12:20 +0100
Message-ID<JJLtT-9xjD-5@gated-at.bofh.it>
In reply to#16463

[Multipart message — attachments visible in raw view] — view raw

Hello,

>> I: pybuild base:311: cd /src/moat/lib/codec/.pybuild/cpython3_3.12_moat-lib-codec/build; python3.12 -m pytest tests

> What I don't see there is what's failing.

Well neither did I. The rest of the log showed a perfectly normal, if failing, test run;
the fact that it happened to use the system packages didn't even show up in the traceback.

I had to intentionally break a /usr/lib/python3/dist-packages/moat/lib/codec/__init__.py
in order to even prove that this happened, and posting the backtrace (in addition
to writing about it) didn't seem to add any useful information, thus I didn't.

> The package should have been installed into build directory.

Yes, the package itself has been installed there. Looking into this further, the problem is the files that are *not* in the package.
Specifically, "moat/__init__.py" and "moat/lib/__init__.py" are not copied in from the source tree,
and without them Python refuses to recognize the copy.

Ugh.

Do we have any other namespaced packages in the archive? How do *they* handle this?

-- 
-- regards
-- 
-- Matthias Urlichs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web