Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Scott Kitterman Newsgroups: linux.debian.maint.python Subject: Re: Issues running pytest from within .pybuild Date: Mon, 18 May 2020 01:40:01 +0200 Message-ID: References: X-Original-To: debian-python@lists.debian.org X-Mailbox-Line: From debian-python-request@lists.debian.org Sun May 17 23:31:01 2020 Old-Return-Path: X-Amavis-Spam-Status: No, score=-12.2 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, LDO_WHITELIST=-5, PGPSIGNATURE=-5] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -5.5 Old-Dkim-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=kitterman.com; i=@kitterman.com; q=dns/txt; s=201903e; t=1589758245; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : from; bh=n3A2GyW5LP78nR4j9DWuxq1KjqJ7bSNkL6dElpPBvEM=; b=jQiLiszeYHzF12goFx7wa+qssHntt6YY5p6z5cxpRNwHgZxgAgq0d2gj1J0MLYp3HMiMG ZEfPA8/4pDewMmLAQ== Old-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kitterman.com; i=@kitterman.com; q=dns/txt; s=201903r; t=1589758245; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : from; bh=n3A2GyW5LP78nR4j9DWuxq1KjqJ7bSNkL6dElpPBvEM=; b=jTmNWJG9BYmweT9Mm08qlxQ04aqa0an/fzPTeLSnUPYI5iikG8Oyj9FtHhnPlTagRAAX/ U3Da0fce6ZR7xmL2JtYvXGVEb9pSVolSK7/bFjKvyQpLnstePL7ZEp8sJmXMpSuGc42DAdy ErBc9Y6GS3v1OHIaVBtBymZlQQ+eDqXdo+zuvj3PrdgKkR57qGz2nmRS6oxQKIqQngf6Amv sNj2P66JvVZIbQgSqRRex4Jy3CYd+pXV3akew2v3E824sYR2+xIhV+NGUAJBWS8pXHsKRJ0 R7CfBFc5ZI8UlbMdMMsoQeO61L4W1IqSe63YVYEIr+woMYkt5IUH6s4c+hOA== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1860976.KaTUCrW1at"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Mailing-List: archive/latest/18303 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/4036529.z7QtqtUCGM@sk-desktop Approved: robomod@news.nic.it Lines: 64 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 17 May 2020 19:30:39 -0400 X-Original-Message-ID: <4036529.z7QtqtUCGM@sk-desktop> X-Original-References: <48ee22ed-3973-1ae6-6fe7-cd6868a27c5c@debian.org> Xref: csiph.com linux.debian.maint.python:12601 --nextPart1860976.KaTUCrW1at Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Sunday, May 17, 2020 6:26:11 PM EDT Christian Kastner wrote: > In a recent version of src:scikit-learn, a workaround was added to > resolve an ImportMismatchError regarding one of the conftest.py files > used by pytest. > > I hit a new instance of this while preparing a new upstream release, so > I inquired [1] with pytest upstream as to why this could be happening. > > Apparently, the error is caused by the .pybuild directory being located > as a subfolder of the source directory. This leads to pytest finding two > separate sklearn/conftest.py files > * $SRCDIR/sklearn/conftest.py > * $SRCDIR/.pybuild/.../sklearn/conftest.py) > which triggers the ImportMisMatchError. > > Now, I've only seen this happen with src:scikit-learn, and (oddly > enough) only with 2 of 4 conftest.py files. The other two do not trigger > the error, nor do other packages of mine which use pytest. > > Has anyone seen something similar with their packages, or is anyone > aware of any recipes that can be used to resolve the issue properly? > > >From the GitHub issue, it seems as if the current practice of testing > > from within .pybuild is not supported by pytest, but I'm inclined to > believe that it is my approach that is flawed. > > [1] https://github.com/pytest-dev/pytest/issues/7223 > > Christian I think this would only happen if sys.path had been extended to include the main source directory. You may need to cd to $SRCDIR/.pybuild/.../sklearn before calling pytest or something may be inserting the source directory into sys.path. Scott K --nextPart1860976.KaTUCrW1at Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE53Kb/76FQA/u7iOxeNfe+5rVmvEFAl7ByR8ACgkQeNfe+5rV mvFYwRAAn6qHQnJN4fwVgktbkjH/fhSGTyH5ykR51AejHENI6WR9YQiF/31FmOrn JgnEXd9lJIzKRzJIeETkbNkeS0a1ZUyumACmm5Pb/i/q1uHCZCGOXG7UlkVfrCNh wCJb3/JG7psMRV1XFd4lRAB1QHLe1ZWntZEhqBWGhhl/gTg4e7T09lEmD9AC/2uB OmRvRg5OJX05yS4ZF0EQAukoA1Yi3WAaZqAqbk1USAKkJCaHooXiNSO/Xevx7h3G mfZQ82AhNAUfTrRJ8E+rUWT3ltLRsygiQmWkBISLCbOcdBDm2s2jciBZ0r2Td6Ay QwHl4Nv+0ocKfsFddxw5AKegckVUWMfRrAcHXyzZMVnd6LwF6wP4bU6NV6wHDbaq +YtsyYFKie3tvXaM0wbk/H+L0ms6dp62Ohi/uXoXYQzlc3EwX2HHuo6IuuaQdpXp V9no+Ko8zjkZTjTK9PhdzdnqZ5woxH0xghfqHlMLYO5z5TuGxm6QqK+USnTpJxr3 J15a+LMDaBiHspURfXcCvw3i2QxhnSUfSI6CINpAblR0K1M7izXw8mFWcnBsUebJ ROn2q3D5sxAuV/VezEAoTmhqiRrjPX65ZXShwdJSJe+UYbiziMjLkxAP/pZkI0+d AaEXo5es2VEro0GPpku+HCqx95Ow05ITy1PBxc9/3qtBWCZENfM= =H5fn -----END PGP SIGNATURE----- --nextPart1860976.KaTUCrW1at--