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

Re: Problem with pybuild and pytest (repost)



[Ole Streicher, 2018-09-28]
> For one of my packages (sunpy), I want to complete the switch to pybuild
> by removing the custom (and quite unperfect) dh_override_auto_test rule.
> 
> Currently, I have the following lines in d/rules:
> 
> override_dh_auto_test:
> 	python -m pytest sunpy -k "not figure and not online"
> 	python3 -m pytest sunpy -k "not figure and not online"
> 
> This gives successfull tests with the following output in the log:
> 
> 
> --------------------------8<-------------------------------------------
>    debian/rules override_dh_auto_test
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
> pyversions: missing debian/pyversions file, fall back to supported versions
> pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
> pyversions: missing debian/pyversions file, fall back to supported versions
> python -m pytest sunpy -k "not figure and not online"
> ============================= test session starts ==============================
> platform linux2 -- Python 2.7.15, pytest-3.6.4, py-1.5.4, pluggy-0.6.0
> rootdir: /<<PKGBUILDDIR>>, inifile: setup.cfg
> plugins: mock-1.7.1, hypothesis-3.44.1
> collected 1448 items / 34 deselected
> [...]
> --------------------------8<-------------------------------------------
> 
> 
> >From the pybuild wiki page, I learned to do instead the override:
> 
> export PYBUILD_TEST_ARGS=-k "not figure and not online"
> 
> However, then the tests are not found anymore and the test step fails:

1) remove HOME line from debian/rules, pybuild sets one
2) you have ".." in PYBUILD_TEST_ARGS (in the git repo) - remove it
3) for python2.7 (and 2.7 only, 3.X works fine), cmdclassd somehow
   disables distutils' settings from .pydistutils.cfg (probably
   overwrites too much or doesn't invoke parent's methods).
   It works for 3.X because "from sunpy.tests.setup_command import SunPyTest"
   fails on 3.X and thus SunPyTest is not used at all.
   Disabling SunPyTest fixes it for me
-- 
GPG: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: