Bug#808763: ImportError: Entry point ('console_scripts', 'py.test-3.5') not found

2015-12-22 Thread Thomas Goirand
Hi,

Here's a debdiff to fix this bug. Please let me know what you think of
it, and if you allow me to NMU with this change.

Cheers,

Thomas Goirand (zigo)
diff -Nru pytest-2.8.5/debian/changelog pytest-2.8.5/debian/changelog
--- pytest-2.8.5/debian/changelog   2015-12-18 00:41:22.0 +
+++ pytest-2.8.5/debian/changelog   2015-12-22 15:05:46.0 +
@@ -1,3 +1,10 @@
+pytest (2.8.5-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix entry point in py.test-3.5.
+
+ -- Thomas Goirand   Tue, 22 Dec 2015 14:56:37 +
+
 pytest (2.8.5-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru pytest-2.8.5/debian/rules pytest-2.8.5/debian/rules
--- pytest-2.8.5/debian/rules   2015-12-18 00:41:22.0 +
+++ pytest-2.8.5/debian/rules   2015-12-22 14:58:43.0 +
@@ -33,8 +33,12 @@
   debian/python3-pytest/usr/bin/py.test-3
-sed -i '1s|.*|#!/usr/bin/python3.4|' \
debian/python3-pytest/usr/bin/py.test-3.4
+   -sed -i "s/'console_scripts', 'py.test-3.4'/'console_scripts', 
'py.test'/" \
+   debian/python3-pytest/usr/bin/py.test-3.4
-sed -i '1s|.*|#!/usr/bin/python3.5|' \
debian/python3-pytest/usr/bin/py.test-3.5
+   -sed -i "s/'console_scripts', 'py.test-3.5'/'console_scripts', 
'py.test'/" \
+   debian/python3-pytest/usr/bin/py.test-3.5
rm -rf debian/python3-pytest/usr/lib/python3.5
 
 override_dh_auto_clean:


Bug#808763: ImportError: Entry point ('console_scripts', 'py.test-3.5') not found

2015-12-22 Thread Thomas Goirand
Package: python3-pytest
Version: 2.8.5-1
Severity: grave

Dear maintainer,

When typing: py.test-3.5

I get: $ py.test-3.5
Traceback (most recent call last):
  File "/usr/bin/py.test-3.5", line 9, in 
load_entry_point('pytest==2.8.5', 'console_scripts', 'py.test-3.5')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 568,
in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2719, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'py.test-3.5') not found

Having a look into /usr/bin/py.test-3.5, I can see:

if __name__ == '__main__':
sys.exit(
load_entry_point('pytest==2.8.5', 'console_scripts', 'py.test-3.5')()
)

Obviously, replacing py.test-3.5 by py.test in the load_entry_point()
fixes the issue.

This bug is very annoying, because it prevents from testing with the
correct version of Python 3, in a loop of this kind:

PYTHON3S:=$(shell py3versions -vr)

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
@echo "===> Running tests"
set -e ; set -x ; for i in 2.7 $(PYTHON3S) ; do \
PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
PYTHON=python$$i py.test-$$i ; \
done
endif

Please fix python3-pytest ASAP.

Thanks for maintaining pytest,
Cheers,

Thomas Goirand (zigo)



Bug#808763: [Python-modules-team] Bug#808763: ImportError: Entry point ('console_scripts', 'py.test-3.5') not found

2015-12-22 Thread Brian May
Thomas Goirand  writes:

> diff -Nru pytest-2.8.5/debian/rules pytest-2.8.5/debian/rules
> --- pytest-2.8.5/debian/rules 2015-12-18 00:41:22.0 +
> +++ pytest-2.8.5/debian/rules 2015-12-22 14:58:43.0 +
> @@ -33,8 +33,12 @@
>  debian/python3-pytest/usr/bin/py.test-3
>   -sed -i '1s|.*|#!/usr/bin/python3.4|' \
>   debian/python3-pytest/usr/bin/py.test-3.4
> + -sed -i "s/'console_scripts', 'py.test-3.4'/'console_scripts', 
> 'py.test'/" \
> + debian/python3-pytest/usr/bin/py.test-3.4

This isn't required (although it doesn't hurt either), because the
package defines a py.test-3.4 entry point, however it doesn't defined a
py.test-3.5 entry point.

# cat /usr/lib/python3/dist-packages/pytest-2.8.5.egg-info/entry_points.txt 
[console_scripts]
py.test = pytest:main
py.test-3.4 = pytest:main


>   -sed -i '1s|.*|#!/usr/bin/python3.5|' \
>   debian/python3-pytest/usr/bin/py.test-3.5
> + -sed -i "s/'console_scripts', 'py.test-3.5'/'console_scripts', 
> 'py.test'/" \
> + debian/python3-pytest/usr/bin/py.test-3.5
>   rm -rf debian/python3-pytest/usr/lib/python3.5

I am not sure why this debian/python3-pytest/usr/bin/py.test-3.5 file
gets created. Suspect all of the above can disappear when Python 3.5
becomes the default Python in Debian - which unfortunately may not be
any time soon. So I think this change will be required for now.

I also note that python3-pytest comes with a py.test-3.1 man page,
however probably hasn't distributed the corresponding binary in years.
-- 
Brian May