Closed maximumspatium closed 6 years ago
Where do you see that exactly? At https://travis-ci.org/pfalcon/ScratchABlock/builds/325232090, next is:
=== test_unit ===
python3 -m nose version 1.3.1
test_dom.test_cooper_9_2_1 ... ok
...
The testsuite won't run with python2 (you can try). The rest is apparently Travis magic. E.g. if it detects there's requirements.txt in the repo, it automagically runs pip against it without being asked to. But again, on any non-orthodox system, "pip" is "pip2".
Anyway, yesterday I pushed further cleanups which allow to install stuff using pip. The only requirement is that there's "python3" executable in PATH. I didn't try to switch Travis to it though.
Where do you see that exactly?
Look at the lines 469, 471 and 472 of your Travis log. There I see:
$ python --version
Python 2.7.14
It seems to work, yes, magically. Anyway, it doesn't look correct to me. That's why I had these two lines in .travis.yml:
language: python
python:
- "3.4"
We don't use "python", we use "python3". Otherwise:
The rest is apparently Travis magic.
(That includes running python --version
.)
All in all, CI has got to be hard and confusing, it's unimaginable to make it otherwise ;-). Even "conveniences" like above turn into mis-conveniences in real use ;-).
My concern is to make/keep SABl being easily installable, including for people not much familiar with Python (in particular, with python2/python3 drama). In that regard, testing in Travis what would be used be real user is a right choice IMHO. And this is an improvement too, beyond just Debian-world: https://github.com/pfalcon/ScratchABlock/commit/3985a94f6b9a4a2c745b61cc02a113b252443228
It seems to work, yes, magically.
No magic, pure down-to-earth technology of nowadays :-I
Alright. Closing this issue because the tests are actually working.
python:
- "3.4"
Let's nail it down fully: the above installs non-distro py3.4 archive somewhere in /travis/blah/blah and adds it to PATH. But that misses some important commands, e.g. pip3. So, when you run pip3, it runs pip3 from distro package, which install stuff under system path (/usr/lib), not under /travis/blah/blah. Then Travis' adhoc py3.4 can't find it, what you saw, etc. etc.
So, as I mentioned, my preference would be to emulate a real user's action during testing, which is IMHO using system packages. Yes, that limits testing to a particular distro, but you can't test all at once anyway.
BUT, with the latest changes, it should also work with pip-based install (e.g. on Windows), as long as there's python3 executable is available - which is the last straw I don't want to test whether Travis provides for its adhoc stuff or not ;-).
I just noticed that the latest Travis tests run under Python 2.7, see below:
Is it supposed to work this way or am I missing something?