Re: python-scipy: autopkgtest fails (Re: bug#919929)

2019-03-10 Thread Drew Parsons

On 2019-03-10 15:46, Drew Parsons wrote:

On 2019-03-10 03:51, Paul Gevers wrote:

Hi Drew,




To remove the deprecation warnings we'd need to deal with them at the
source. Upstream has patches
https://github.com/scipy/scipy/commit/614847c5fc8d5f8a618980df3c1b93540428ae46

https://github.com/scipy/scipy/commit/e0cfa29e2fbe86f994924c0c7514ff5bbfffd514

and for completeness
https://github.com/scipy/scipy/commit/87e48c3c54d7a85bc6628c88c1de98ac0469b6fa

...

Can you authorise an unblock to apply these 3 upstream patches to
python-scipy 1.1.0 ?
That won't necessarily fix the debci failure, but it will make it a 
lot

easier to see what's actually failing.


I am slightly unhappy with the second patch, as it seems to be doing
more than you describe above in a few places. This may be correct but
that is difficult to quickly judge.


I've adapted the 3 patches and pushed to salsa,
   matrix_API_614847c5.patch
   matrix_API_more_e0cfa29e2.patch
   matrix_API_filter_check_87e48c3c5.patch
https://salsa.debian.org/python-team/modules/python-scipy/tree/master/debian/patches

The other behaviour that you saw in the second patch I think might be 
replacement of "D*diag(v)" with "D@diag(v)". That's matrix 
multiplication, so still relevent to the matrix API patch. @ is not 
available in python2 so I changed it to numpy.matmul, which does the 
same thing.


The numpy.sparse tests pass with this patch, and most of the matrix 
PendingDeprecationWarnings are gone (the upstream patch missed 
integrate/tests/test_ivp.py, but the remaining warnings are few enough 
to not need to worry about).




Also, what is the general documented way that these wrappers can be
used? scipy is sort of taking over the maintenanceship of these
functions in this way if we're not careful.



...

There is discussion of the distinction between numpy.matrix and
numpy.ndarray (which is at the heart of the deeprecation warning) at
https://docs.scipy.org/doc/scipy/reference/tutorial/linalg.html#numpy-matrix-vs-2d-numpy-ndarray

The utility class scipy.sparse.sputils itself is apparently
undocumented, by which I infer it's intended for internal use only,
not a public API. I guess it's reasonable for a package to be testing
it's own internal functions.  Strange thing is,
scipy.sparse.sputils.matrix is not actually defined in
scipy/sparse/sputils.py. Must be inherited or defined in some deep
pythonfu that I haven't mastered yet.



Actually scipy.sparse.sputils.matrix was defined in these patches.  It 
is a bit odd that upstream is wrapping numpy.matrix just to avoid 
deprecation warnings, rather than following their own advice and using 
numpy.ndarray instead.



With these patches, the sparse matrix tests pass. There remain three 
errors unrelated to sparse matrix:
  spatial/tests/test__plotutils.py::TestPlotting::test_delaunay FAILED   
  [ 76%]
  spatial/tests/test__plotutils.py::TestPlotting::test_voronoi FAILED
  [ 76%]
  spatial/tests/test__plotutils.py::TestPlotting::test_convex_hull 
FAILED  [ 76%]
  __ TestPlotting.test_delaunay 
__


  self = 0x7f0f31156eb8>


  def test_delaunay(self):
  # Smoke test
  fig = plt.figure()
  obj = Delaunay(self.points)
  s_before = obj.simplices.copy()
  >   with suppress_warnings as sup:
  E   AttributeError: __enter__

  fig= 
  obj= 
  s_before   = array([[3, 1, 0],
 [2, 3, 0]], dtype=int32)
  self   = at 0x7f0f31156eb8>


  
/usr/lib/python3/dist-packages/scipy/spatial/tests/test__plotutils.py:31: 
AttributeError


(likewise for the other 2)
These AttributeErrors are mentioned at 
https://github.com/scipy/scipy/issues/9491. Upstream doesn't seem too 
concerned about them.


Apart from that, I'm happy to upload the sparse matrix patches once the 
s390x update reaches testing.


Drew



[Struan Bartlett] [Python-modules-team] Debian Multiarch package issue: virtualenv and python3-virtualenv

2019-03-10 Thread Brian May
Forwarding to debian-python mailing list from the Debian Python Modules
Team which most people don't look at.

Actually a bug report probably would be the best of of reporting this,
as it looks like it could be a bug.

--- Begin Message ---

Hello

We have been unable to install virtualenv and python3-virtualenv on 
Debian stretch/i386 with python3:amd64, without customising the former 
two packages, due to what appear to be minor package configuration issues.


We have resolved the issues in custom-built packages by:
- Adding a 'Multi-Arch: allowed' header to each of these two packages
- Removing the apparently surplus python3 dependency in 
python3-virtualenv, leaving only the python3:any dependency
- Modifying the python3 dependency in virtualenv, to make it python3:any 
too.

(please see example diffs below).

Please would you advise what additional action, if any, we need to take 
to raise these issue formally and see them fixed in future package releases?


Kind regards

Struan Bartlett

diff -ubw DEBIAN/control*
--- DEBIAN/control  2016-12-01 23:08:39.0 +
+++ DEBIAN/control2 2019-03-06 22:40:00.0 +
@@ -1,10 +1,11 @@
 Package: python3-virtualenv
 Source: python-virtualenv
 Version: 15.1.0+ds-1
 Architecture: all
+Multi-Arch: allowed
 Maintainer: Debian Python Modules Team 


 Installed-Size: 137
-Depends: python-pip-whl (>= 8.1.1-2), python3, python3-pkg-resources, 
python3:any (>= 3.3.2-2~)
+Depends: python-pip-whl (>= 8.1.1-2), python3-pkg-resources, 
python3:any (>= 3.3.2-2~)

 Section: python
 Priority: optional
 Homepage: https://pypi.python.org/pypi/virtualenv```
(edited)

# diff -ubw DEBIAN/control*
--- DEBIAN/control  2016-12-01 23:08:39.0 +
+++ DEBIAN/control2 2019-03-06 22:45:13.0 +
@@ -1,10 +1,11 @@
 Package: virtualenv
 Source: python-virtualenv
 Version: 15.1.0+ds-1
 Architecture: all
+Multi-Arch: allowed
 Maintainer: Debian Python Modules Team 


 Installed-Size: 30
-Depends: python3, python3-virtualenv
+Depends: python3:any, python3-virtualenv
 Breaks: python-virtualenv (<< 1.11.6)
 Replaces: python-virtualenv (<< 1.11.6)
 Section: python

--

Struan Bartlett
Founder & CEO
NewsNow.co.uk

The UK's #1 News Portal:
> www.NewsNow.co.uk  (est. 1998)

Tel:+44 (0)845 838 8890
Fax:+44 (0)845 838 8898

NewsNow Publishing Limited, trading also as NewsNow.co.uk, is a company 
registered in England and Wales under company no. 3435857 with 
registered office Northdown House, 11-21 Northdown Street, London N1 9BN


___
Python-modules-team mailing list
python-modules-t...@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/python-modules-team--- End Message ---

-- 
Brian May 
https://linuxpenguins.xyz/brian/