Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 756397 - dev-python/python-dotenv-0.14.0 fails test
Summary: dev-python/python-dotenv-0.14.0 fails test
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sebastian Pipping
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2020-11-25 02:10 UTC by Alexey
Modified: 2021-02-07 03:24 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,57.09 KB, text/x-log)
2020-11-25 02:12 UTC, Alexey
Details
emerge --info (emerge.info,20.07 KB, application/x-info)
2020-11-25 02:12 UTC, Alexey
Details
dir archive with 0.15.0 (python-dotenv.tbz,85.46 KB, application/x-bzip)
2020-11-25 13:38 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2020-11-25 02:10:57 UTC
FAILED tests/test_cli.py::test_get_default_path - sh.ErrorReturnCode_1: 
FAILED tests/test_cli.py::test_run - sh.ErrorReturnCode_1: 
FAILED tests/test_cli.py::test_run_with_none_value - sh.ErrorReturnCode_1: 
FAILED tests/test_cli.py::test_run_with_other_env - sh.ErrorReturnCode_1:

>           raise exc                                                                                                                                                                                                                                                             
E           sh.ErrorReturnCode_1:                                                                                                                                                                                                                                                 
E                                                                                                                                                                                                                                                                                 
E             RAN: /mnt/portagetmp/portage/dev-python/python-dotenv-0.14.0/work/python-dotenv-0.14.0-python3_7/test/scripts/dotenv run printenv a                                                                                                                                 
E                                                                                                                                                                                                                                                                                 
E             STDOUT:                                                                                                                                                                                                                                                             
E                                                                                                                                                                                                                                                                                 
E                                                                                                                                                                                                                                                                                 
E             STDERR:                                                                                                                                                                                                                                                             
E           Traceback (most recent call last):                                                                                                                                                                                                                                    
E             File "/mnt/portagetmp/portage/dev-python/python-dotenv-0.14.0/work/python-dotenv-0.14.0-python3_7/test/scripts/dotenv", line 33, in <module>                                                                                                                        
E               sys.exit(load_entry_point('python-dotenv==0.14.0', 'console_scripts', 'dotenv')())                                                                                                                                                                                
E             File "/mnt/portagetmp/portage/dev-python/python-dotenv-0.14.0/work/python-dotenv-0.14.0-python3_7/test/scripts/dotenv", line 22, in importlib_load_entry_point                                                                                                      
E               for entry_point in distribution(dist_name).entry_points                                                                                                                                                                                                           
E             File "/usr/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 558, in distribution                                                                                                                                                                   
E               return Distribution.from_name(distribution_name)                                                                                                                                                                                                                  
E             File "/usr/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 215, in from_name                                                                                                                                                                      
E               raise Pack... (112 more, please see e.stderr)
Comment 1 Alexey 2020-11-25 02:12:29 UTC
Created attachment 674794 [details]
build.log
Comment 2 Alexey 2020-11-25 02:12:48 UTC
Created attachment 674797 [details]
emerge --info
Comment 3 Sebastian Pipping gentoo-dev 2020-11-25 12:14:02 UTC
I re-ran the test locally and the pass without error.  The build log doesn't give much of a clue why the tests are failing.  Do you have any ideas why the test are failing?  Does it happen every time?
Comment 4 Alexey 2020-11-25 13:17:41 UTC
Yes, every time. But only if dev-python/python-dotenv was not yet installed. Probably https://bugs.gentoo.org/743784 was not in fact fixed.
Comment 5 Sebastian Pipping gentoo-dev 2020-11-25 13:33:03 UTC
Cannot confirm, tests run clean after uninstalling dotenv over here, just checked. Can you check if your local python-dotenv-0.14.0.ebuild contains a call to distutils_install_for_testing ?
Comment 6 Sebastian Pipping gentoo-dev 2020-11-25 13:33:29 UTC
PS: And how about 0.15.0?
Comment 7 Alexey 2020-11-25 13:34:40 UTC
Yes, this is the whole python-dotenv-0.14.0.ebuild

# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{6,7,8,9} )
DISTUTILS_USE_SETUPTOOLS=rdepend

inherit distutils-r1

DESCRIPTION="Manage .env files"
HOMEPAGE="https://github.com/theskumar/python-dotenv"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm64 ~x86"
IUSE="test"

DEPEND="test? (
		>=dev-python/click-5[${PYTHON_USEDEP}]
		dev-python/ipython[${PYTHON_USEDEP}]
		dev-python/mock[${PYTHON_USEDEP}]
		>=dev-python/sh-1.09[${PYTHON_USEDEP}]
	)"

DOCS=( CHANGELOG.md README.md )

distutils_enable_tests pytest

python_test() {
	# Tests call the "dotenv" command which needs to be in PATH
	# https://bugs.gentoo.org/743784
	distutils_install_for_testing
	pytest -vv || die "Tests fail with ${EPYTHON}"
}
Comment 8 Alexey 2020-11-25 13:36:38 UTC
0.15.0 fails tests the same way.
Comment 9 Alexey 2020-11-25 13:38:30 UTC
Created attachment 674842 [details]
dir archive with 0.15.0
Comment 10 Sebastian Pipping gentoo-dev 2020-11-25 13:44:57 UTC
I'm afraid we're back at I'll need your help debugging things because I cannot reproduce it over here and the logs do not show any obvious indicators for why they are failing.


(In reply to Alexey from comment #9)
> Created attachment 674842 [details]
> dir archive with 0.15.0

Anything that I should look at in there in particular?  I don't see anything giving clues from a quick look.
Comment 11 Alexey 2020-11-25 15:28:24 UTC
> Anything that I should look at in there in particular?

I hoped you would tell me :)

Anything in particular I should try?
Comment 12 Sebastian Pipping gentoo-dev 2021-02-07 01:20:58 UTC
So the way I read the log is that the helpers installed by distutils_install_for_testing at [..]/test/scripts/dotenv have trouble finding  package python-dotenv==0.14.0, i.e. itself.  I have tried with dev-python/python-dotenv uninstalled and with /usr/bin/dotenv renamed, just to be sure, same issue.  

Version 0.14.0 is gone from the tree by now, so I tried again with version 0.15.0.

Since there is dev-python/importlib_metadata involved in the lookup, I have tried with both version 3.3.0 and 3.4.0 installed — no issue.

Alexey, does the issue occur with 0.15.0 for you as well?

If yes, do you have any ideas what else we could try?

Thanks!
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-02-07 01:49:46 UTC
distutils_install_for_testing recently got improved so that might be why it's not reproducible anymore: https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/distutils-r1.eclass?id=e46b7fd568352311ab6b03a7cc38b891ee561e36.
Comment 14 Sebastian Pipping gentoo-dev 2021-02-07 03:24:34 UTC
(In reply to Sam James from comment #13)
> distutils_install_for_testing recently got improved so that might be why
> it's not reproducible anymore:
> https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/distutils-r1.
> eclass?id=e46b7fd568352311ab6b03a7cc38b891ee561e36.

I have taken that point now and replaced

  distutils_install_for_testing

by

  distutils_install_for_testing --via-home

to enforce the old behavoir.  With that and "sudo emerge -C dev-python/python-dotenv" I was able to reproduce the error as reported with 0.15.0.

So big thanks to Sam, I'll closed as fixed then.