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


Groups > linux.debian.bugs.rc > #322070 > unrolled thread

Bug#1013700: python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import

Started byLouis-Philippe Véronneau <pollo@debian.org>
First post2022-06-25 01:00 +0200
Last post2022-07-05 00:10 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.debian.bugs.rc


Contents

  Bug#1013700: python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import Louis-Philippe Véronneau <pollo@debian.org> - 2022-06-25 01:00 +0200
    Bug#1013700: Strangely rare pytest 7.x bug report Julian Gilbey <julian@d-and-j.net> - 2022-07-04 15:20 +0200
    Bug#1013700: Strangely rare pytest 7.x bug report Julian Gilbey <julian@d-and-j.net> - 2022-07-04 23:30 +0200
    Processed: Bug#1013700 marked as pending in python-qtpy "Debian Bug Tracking System" <owner@bugs.debian.org> - 2022-07-05 00:00 +0200
    Bug#1013700: marked as pending in python-qtpy Julian Gilbey <jdg@debian.org> - 2022-07-05 00:00 +0200
    Bug#1013700: marked as done (python-qtpy: FTBFS: pytest7  regression, TypeError: the 'package' argument is required to perform a  relative import) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2022-07-05 00:10 +0200

#322070 — Bug#1013700: python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import

FromLouis-Philippe Véronneau <pollo@debian.org>
Date2022-06-25 01:00 +0200
SubjectBug#1013700: python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import
Message-ID<EC0ro-70IF-29@gated-at.bofh.it>

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

Source: python-qtpy
Version: 2.1.0-2
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: debian-python@lists.debian.org
Usertags: pytest7

Hi,

During a selected rebuild of python packages in sid, your package failed
to build with pytest version 7.1.2-1.

The full build log is available from:
http://qa-logs.debian.net/2022/06/09/pytest/python-qtpy_2.1.0-2_unstable_pytest-exp.log

I had a closer look at the error log and identified the regression as:
'TypeError: the 'package' argument is required to perform a relative
import'. Hopefully, that's helpful!

All bugs filed during this rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=pytest7;users=debian-python@lists.debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=pytest7&fusertaguser=debian-python@lists.debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

If you reassign this bug to another package, please mark it as
'affects'-ing this package. See
https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it
with the one provided so that we can identify if something relevant
changed in the meantime.

-- 
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   pollo@debian.org / veronneau.org
  ⠈⠳⣄

[toc] | [next] | [standalone]


#322681 — Bug#1013700: Strangely rare pytest 7.x bug report

FromJulian Gilbey <julian@d-and-j.net>
Date2022-07-04 15:20 +0200
SubjectBug#1013700: Strangely rare pytest 7.x bug report
Message-ID<EFu9z-95oO-5@gated-at.bofh.it>
In reply to#322070
Dear all,

I wonder whether you might have any clue about
https://bugs.debian.org/1013700
I have mostly worked out the "cause" of the bug, but I haven't quite
got to the bottom of it.

When running the command
PYTHONPATH=. python3.10 -m pytest qtpy/tests
in the directory .pybuild/cpython3_3.10_qtpy/build, I get the error
message:

ImportError while loading conftest '/home/jdg/debian/spyder-packages/qtpy/build-area/python-qtpy-2.1.0/.pybuild/cpython3_3.10_qtpy/build/qtpy/tests/conftest.py'.
TypeError: the 'package' argument is required to perform a relative import for '.pybuild.cpython3_3.10_qtpy.build.qtpy.tests'

If the directory .pybuild is renamed to pybuild, the tests run without
a problem.  So there seems to be something funny about conftest.py
(and removing all of the other files from the qtpy/tests directory
except for the empty __init__.py gives the same error); here's a link
to it:

https://salsa.debian.org/python-team/packages/python-qtpy/-/blob/master/qtpy/tests/conftest.py

But there doesn't seem to be anything out of the ordinary about this.
So I am mystified: why does pytest 7.x seem to not give this error on
any other Debian package?

The only solution I currently have for this package is skip the tests
at build time and rely on autopkgtest to do them.

Best wishes,

   Julian

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


#322702 — Bug#1013700: Strangely rare pytest 7.x bug report

FromJulian Gilbey <julian@d-and-j.net>
Date2022-07-04 23:30 +0200
SubjectBug#1013700: Strangely rare pytest 7.x bug report
Message-ID<EFBNL-99L8-3@gated-at.bofh.it>
In reply to#322070
Hi Carles,

It is utterly, utterly bizarre.  But I think I've found the problem.
There's a pytest.ini file in the package, but it's not copied into the
test directory.  So when pytest is run in the .pybuild directory, it
climbs all the way back up the directory tree to the python-qtpy-2.1.0
until it discovers the pytest.ini file there and uses that.  It sees
that we are requesting qtpy/tests, which it then expands into the
directory path .pybuild/cpython3_3.10_qtpy/build/qtpy/tests, starting
from the directory in which it found pytest.ini, and this causes the
breakage.

The solution is to copy the pytest.ini file into the .pybuild
directories by adding it to debian/pybuild.testfiles

Why this behaviour changed between pytest 6.x and pytest 7.x I don't
know; I don't see it obviously documented.  But that at least resolves
this problem.

Thanks for your help!

Best wishes,

   Julian

On Mon, Jul 04, 2022 at 08:39:32PM +0100, Carles Pina i Estany wrote:
> 
> Hi Julian,
> 
> On Jul/04/2022, Julian Gilbey wrote:
> > Hi Carles,
> > 
> > Thanks for your thoughts!  Yes, indeed that seems to be the issue.
> > But what I don't understand is why the import is turned into
> > .pybuild.cpython3_3.9_qtpy.build.qtpy.tests and not just qtpy.tests or
> 
> I see how pytest does it (but keep reading)
> 
> > a longer path, and why only this package fails in this way.  Perhaps
> > this is the only package that has an import statement in
> > pytest_configure?
> 
> This I don't know and I'm curious, and it might help disecting the issue
> (or understanding it). Do you know of any other python3 package that you
> expected to fail? (using pytest in a similar way).
> 
> I might try to get both and follow what they do different (to hopefully
> know what is python-qtpy doing different :-) )
> 
> I'm sure that there are tons of packages that use pytest :-) I'm
> wondering if you had a good candidate.
> 
> Best regards,
> 
> > 
> > Best wishes,
> > 
> >    Julian
> > 
> > On Mon, Jul 04, 2022 at 04:03:39PM +0100, Carles Pina i Estany wrote:
> > > 
> > > Hi,
> > > 
> > > I'm a lurker of debian-python@lists.debian.org but seeing Python+Qt I
> > > wanted to have a look. I don't have a solution (I might look more
> > > another time if time permits) but I might have something that might help
> > > someone who knows the tools better.
> > > 
> > > I am not familiar with Python Debian packaging details/tools neither
> > > with pytest :-( so take all of this with a pinch of salt.
> > > 
> > > If it helps the error comes from:
> > > /usr/lib/python3.9/importlib/__init__.py in the functin "import_modules"
> > > it does:
> > > """
> > >     if name.startswith('.'):
> > >         if not package:
> > >             msg = ("the 'package' argument is required to perform a relative "
> > >                    "import for {!r}")
> > >             raise TypeError(msg.format(name))
> > > """
> > > 
> > > When the import fails the "name" parameter of "import_modules" function
> > > is: '.pybuild.cpython3_3.9_qtpy.build.qtpy.tests' , which is derived
> > > from the hidden dirctory ".pybuild" as created by default by "pybuild".
> > > 
> > > I think that the initial "." is used only as a directory name but Python
> > > assumes that is a relative import requiring the package parameter.
> > > 
> > > Just to check my thoughts, and after running dpkg-buildpackage and
> > > failing let's try again:
> > > 
> > > $ cd .pybuild/cpython3_3.9_qtpy/build; python3.9 -m pytest qtpy/tests ; cd -
> > > Fails with the:
> > > 
> > > TypeError: the 'package' argument is required to perform a relative import for '.pybuild.cpython3_3.9_qtpy.build.qtpy.tests'
> > > /home/carles/git/python-qtpy
> > > 
> > > Then let's try to avoid the initial "." confusion:
> > > 
> > > $ mv .pybuild pybuild
> > > $ cd pybuild/cpython3_3.9_qtpy/build; python3.9 -m pytest qtpy/tests ; cd -
> > > 
> > > It works.
> > > 
> > > I don't know why this is the only package affected by this though...
> > > 
> > > Hopefully it helps a bit!
> > > 
> > > On Jul/04/2022, Julian Gilbey wrote:
> > > > Dear all,
> > > > 
> > > > I wonder whether you might have any clue about
> > > > https://bugs.debian.org/1013700
> > > > I have mostly worked out the "cause" of the bug, but I haven't quite
> > > > got to the bottom of it.
> > > > 
> > > > When running the command
> > > > PYTHONPATH=. python3.10 -m pytest qtpy/tests
> > > > in the directory .pybuild/cpython3_3.10_qtpy/build, I get the error
> > > > message:
> > > > 
> > > > ImportError while loading conftest '/home/jdg/debian/spyder-packages/qtpy/build-area/python-qtpy-2.1.0/.pybuild/cpython3_3.10_qtpy/build/qtpy/tests/conftest.py'.
> > > > TypeError: the 'package' argument is required to perform a relative import for '.pybuild.cpython3_3.10_qtpy.build.qtpy.tests'
> > > > 
> > > > If the directory .pybuild is renamed to pybuild, the tests run without
> > > > a problem.  So there seems to be something funny about conftest.py
> > > > (and removing all of the other files from the qtpy/tests directory
> > > > except for the empty __init__.py gives the same error); here's a link
> > > > to it:
> > > > 
> > > > https://salsa.debian.org/python-team/packages/python-qtpy/-/blob/master/qtpy/tests/conftest.py
> > > > 
> > > > But there doesn't seem to be anything out of the ordinary about this.
> > > > So I am mystified: why does pytest 7.x seem to not give this error on
> > > > any other Debian package?
> > > > 
> > > > The only solution I currently have for this package is skip the tests
> > > > at build time and rely on autopkgtest to do them.
> > > > 
> > > > Best wishes,
> > > > 
> > > >    Julian

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


#322703 — Processed: Bug#1013700 marked as pending in python-qtpy

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2022-07-05 00:00 +0200
SubjectProcessed: Bug#1013700 marked as pending in python-qtpy
Message-ID<EFCgN-99UG-3@gated-at.bofh.it>
In reply to#322070
Processing control commands:

> tag -1 pending
Bug #1013700 [src:python-qtpy] python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import
Added tag(s) pending.

-- 
1013700: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013700
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

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


#322704 — Bug#1013700: marked as pending in python-qtpy

FromJulian Gilbey <jdg@debian.org>
Date2022-07-05 00:00 +0200
SubjectBug#1013700: marked as pending in python-qtpy
Message-ID<EFCgN-99UG-5@gated-at.bofh.it>
In reply to#322070
Control: tag -1 pending

Hello,

Bug #1013700 in python-qtpy reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/python-team/packages/python-qtpy/-/commit/e7d0236cc1a1e1718a05ed4a09a7dd24fca6b723

------------------------------------------------------------------------
Fix FTBFS error with Pytest 7.x (closes: #1013700)
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1013700

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


#322705 — Bug#1013700: marked as done (python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2022-07-05 00:10 +0200
SubjectBug#1013700: marked as done (python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import)
Message-ID<EFCqt-9ade-1@gated-at.bofh.it>
In reply to#322070

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

Your message dated Mon, 04 Jul 2022 22:07:10 +0000
with message-id <E1o8UDm-000HqT-JK@fasolo.debian.org>
and subject line Bug#1013700: fixed in python-qtpy 2.1.0-3
has caused the Debian Bug report #1013700,
regarding python-qtpy: FTBFS: pytest7 regression, TypeError: the 'package' argument is required to perform a relative import
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1013700: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013700
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.rc


csiph-web