[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ruamel.yaml backport




Andreas Tille:
> On Wed, May 17, 2017 at 11:02:20PM +0200, Hans-Christoph Steiner wrote:
>>> __________________________________________________ ERROR collecting
>>> src/test_typing.py __________________________________________________
>>> import file mismatch:
>>> imported module 'test_typing' has this __file__ attribute:
>>>   /export/share/code/collab-maint/python-typing/python2/test_typing.py
>>> which is not the same as the test file we want to collect:
>>>   /export/share/code/collab-maint/python-typing/src/test_typing.py
>>> HINT: remove __pycache__ / .pyc files and/or use a unique basename for
>>> your test file modules
>>> ================================================== 136 passed, 1 error
>>> in 0.17 seconds ==================================================
>>
>> Ok, I figured it out, I needed to do this in debian/rules:
>>
>> override_dh_auto_test:
>>         python2 -m pytest python2/
>>         python3 -m pytest src/
>>
>> So I'll work with the maintainer to get this into sid, then work on the
>> backport.
> 
> Nice you found a fix but the approach via sid is wrong.  Just send me
> a patch for the Backport whixh you tested and I'll upload.
> 
> Kind regards
> 
>         Andreas.
> 

Yeah, I just realized that there is no need to have python3-typing in
stretch or sid since the typing module is already provided by Python >= 3.5.

The patch is attached.  Thanks for the upload!

.hc
diff --git a/debian/control b/debian/control
index 4394588..feec006 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,17 @@ Source: python-typing
 Section: python
 Priority: optional
 Maintainer: Sebastien Delafond <seb@debian.org>
-Build-Depends: debhelper (>= 9), dh-python, python-all, python-setuptools, python-pytest
+Build-Depends: debhelper (>= 10),
+               dh-python,
+               python-all,
+               python-pytest,
+               python-setuptools,
+               python3-all,
+               python3-pytest,
+               python3-setuptools,
 Standards-Version: 3.9.8
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.2
 Homepage: https://pypi.python.org/pypi/typing/
 Vcs-Git: git://anonscm.debian.org/collab-maint/python-typing.git
 Vcs-Browser: https://anonscm.debian.org/git/collab-maint/python-typing.git
@@ -17,3 +26,17 @@ Description: Backport of the standard 3.5 library typing module
  concise, standard format, and it has been designed to also be used by
  static and runtime type checkers, static analyzers, IDEs and other
  tools.
+ .
+ This package provides the Python 2.7 module.
+
+Package: python3-typing
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
+Description: Backport of the standard 3.5 library typing module
+ Typing defines a standard notation for Python function and variable
+ type annotations. The notation can be used for documenting code in a
+ concise, standard format, and it has been designed to also be used by
+ static and runtime type checkers, static analyzers, IDEs and other
+ tools.
+ .
+ This package provides the Python 3.x module.
diff --git a/debian/rules b/debian/rules
index 209a63a..6326cd3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,11 @@
 #!/usr/bin/make -f
 
 export PYBUILD_NAME=typing
+export PYTHONDONTWRITEBYTECODE=1
 
 %:
-	dh $@ --with python2,python3
+	dh $@ --with python2,python3 --buildsystem=pybuild
+
+override_dh_auto_test:
+	python2 -m pytest python2/
+	python3 -m pytest src/

Reply to: