Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #10949 > unrolled thread
| Started by | Ole Streicher <olebole@debian.org> |
|---|---|
| First post | 2018-09-28 10:30 +0200 |
| Last post | 2018-09-28 16:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.debian.maint.python
Problem with pybuild and pytest (repost) Ole Streicher <olebole@debian.org> - 2018-09-28 10:30 +0200
Re: Problem with pybuild and pytest (repost) Piotr Ożarowski <piotr@debian.org> - 2018-09-28 14:10 +0200
Re: Problem with pybuild and pytest (repost) Ole Streicher <olebole@debian.org> - 2018-09-28 16:10 +0200
| From | Ole Streicher <olebole@debian.org> |
|---|---|
| Date | 2018-09-28 10:30 +0200 |
| Subject | Problem with pybuild and pytest (repost) |
| Message-ID | <wCWjT-6z6-5@gated-at.bofh.it> |
Hi,
I already posted this two weeks ago, but didn't get a response yet, and
thus it remains unsolved:
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:
--------------------------8<-------------------------------------------
dh_auto_test -O--buildsystem=pybuild
I: pybuild base:217: cd /build/sunpy-0.9.3/.pybuild/cpython2_2.7_sunpy/build; python2.7 -m pytest -k "not figure and not online"
============================= test session starts ==============================
platform linux2 -- Python 2.7.15+, pytest-3.6.4, py-1.6.0, pluggy-0.6.0
rootdir: /build/sunpy-0.9.3, inifile: setup.cfg
plugins: mock-1.7.1, hypothesis-3.44.1
collected 0 items
========================= no tests ran in 0.00 seconds =========================
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=5: cd /build/sunpy-0.9.3/.pybuild/cpython2_2.7_sunpy/build; python2.7 -m pytest -k "not figure and not online"
dh_auto_test: pybuild --test --test-pytest -i python{version} -p 2.7 returned exit code 13
--------------------------8<-------------------------------------------
I don't understand why the tests fail now? How do I correctly specify
them?
Best regards
Ole
[toc] | [next] | [standalone]
| From | Piotr Ożarowski <piotr@debian.org> |
|---|---|
| Date | 2018-09-28 14:10 +0200 |
| Message-ID | <wCZKN-d6-1@gated-at.bofh.it> |
| In reply to | #10949 |
[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
[toc] | [prev] | [next] | [standalone]
| From | Ole Streicher <olebole@debian.org> |
|---|---|
| Date | 2018-09-28 16:10 +0200 |
| Message-ID | <wD1CV-1i9-3@gated-at.bofh.it> |
| In reply to | #10951 |
Piotr Ożarowski <piotr@debian.org> writes: >> >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 Thanks. Just removing the cmdclass option did the trick, and it works now. Best Ole
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.maint.python
csiph-web