Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverage of pandas on Travis #272

Closed
lrq3000 opened this issue Sep 17, 2016 · 22 comments
Closed

Fix coverage of pandas on Travis #272

lrq3000 opened this issue Sep 17, 2016 · 22 comments
Labels
help wanted 🙏 We need you (discussion or implementation) p2-bug-warning ⚠ Visual output bad submodule ⊂ Periphery/subclasses

Comments

@lrq3000
Copy link
Member

lrq3000 commented Sep 17, 2016

Travis has an issue with pandas: it does not want to run the tests. They are skipped because of a missing library: numpy. Numpy should be installed and work (Travis tells us that it is installed per pandas requirements), but it weirdly cannot be imported:

======================================================================
ERROR: Test pandas bar object instance as argument deprecation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/tqdm/tqdm/.tox/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/tqdm/tqdm/tqdm/tests/tests_pandas.py", line 111, in test_pandas_deprecation
    from numpy.random import randint
ImportError: No module named numpy.random

I tested and pandas seems to be imported fine. The only issue is numpy.random.randint.

So either we workaround by defining our own replacement function, either we really fix this issue (which is better because other submodules will need it such as #248) but I have no idea how.

This should be fixed because we should have a branch coverage of 100% overall, but Travis reaches only 90% because the pandas tests are skipped.

@lrq3000 lrq3000 added p0-bug-critical ☢ Exception rasing help wanted 🙏 We need you (discussion or implementation) submodule ⊂ Periphery/subclasses labels Sep 17, 2016
@QuLogic
Copy link

QuLogic commented Oct 30, 2016

Are you sure that's the problem? I think Travis is actually installing things backwards. Pandas is installed before tox (thus only for 3.5), and then the tox run doesn't install it.

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 30, 2016

Ah so if we install dependencies before tox, they get installed for the general version instead of the env version?

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 30, 2016

Unluckily, after reordering the dependencies, it still doesn't work it seems:

https://travis-ci.org/tqdm/tqdm/jobs/171857762#L459

I didn't use debug outputs to check if it's still numpy but I can bet on it...

Any other suggestion I can try out?

@casperdcl
Copy link
Sponsor Member

wonder is there's a way to tell travis to make sure it creates a venv that has access to the system's libraries (i.e. pandas which was cached). then again maybe we should find out how to cache pip packages and put pandas as a dependency in tox.ini....

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Normally yes it's already cached, but the issue is that it does not work (because of numpy), so I'm not sure if the caching works when dependencies fail like that.

@QuLogic
Copy link

QuLogic commented Oct 31, 2016

I don't think you've corrected it in that linked build log. You just moved the installation of pandas after tox, but it's still installed in the 3.5 directory. It needs to be installed by tox within its virtual environment. Surely you don't expect the 3.5 pandas to work with a 2.7 tox?

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Ah ok, I'm not very experienced with tox nor travis for what it's worth... Can you suggest me how to do it please?

@QuLogic
Copy link

QuLogic commented Oct 31, 2016

Adding additional dependencies to the testenv should do, I think.

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Great QuLogic, it works, thank you so much!

Er... now we have another issue with installing pandas from source, it doesn't work on all Python versions of Travis...

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Ok it works now, we just need to find a way to exclude numpy and pandas install on PyPy, and we'll be done.

@casperdcl
Copy link
Sponsor Member

no problem, that can be done in the build matrix. or even "import sys; import os; 'pypy' in sys.executable or os.system('pip install numpy pandas')"

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Great @casperdcl , seems to be working alright with the build matrix, and in a reasonable timeframe thank's to the caching!

@casperdcl
Copy link
Sponsor Member

casperdcl commented Oct 31, 2016

all envs finished in about <50 secs except py33 and py26 - which are still installing pandas 8 minutes later...
deprecation

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Yes the caching weirdly didn't work for them, but I guess it will work on
the next run. If not, then Travis caching has some issues with these python
versions...

2016-10-31 15:49 GMT+01:00 Casper da Costa-Luis notifications@github.com:

all envs finished in about <50 secs except py33 and py26 - which are still
installing pandas 8 minutes later...


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#272 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABES3rcDk8wAIcfdOi97t9uxo1wi5CtJks5q5f_8gaJpZM4J_uD-
.

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Yes there is an issue with caching numpy or cython or pandas on these python versions (as demonstrated here). So these should also be excluded in the build matrix...

@casperdcl
Copy link
Sponsor Member

hah, I put a lot of effort into writing a set of regex (without flags=re.M) and conditional statements which emulate shlex just so py-make can work on py26. when will the world stop using these outdated versions?

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

There are still a lot unluckily... Ok for a regexp alternative, so long as it works... We aren't doing user input validation with the regexp so that's ok.

@CrazyPython
Copy link
Contributor

maybe it's travis' own internal problem?

@lrq3000
Copy link
Member Author

lrq3000 commented Oct 31, 2016

Yes I can bet the caching is a bug we can't solve, somewhere either in Travis caching system or pandas/numpy that isn't playing along on these old python versions. So we should just skip these tests on these versions.

/EDIT: fixed, tests are skipped on the buggy versions.

@CrazyPython
Copy link
Contributor

@lrq3000 report to travis HQ, maybe?

@casperdcl
Copy link
Sponsor Member

I'm quite sure they reported that they would be dropping support for these outdated versions a long time ago, so it's surprising that the tests work at all.

@casperdcl
Copy link
Sponsor Member

merged #302

@casperdcl casperdcl added p2-bug-warning ⚠ Visual output bad and removed p0-bug-critical ☢ Exception rasing labels Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 We need you (discussion or implementation) p2-bug-warning ⚠ Visual output bad submodule ⊂ Periphery/subclasses
Projects
None yet
Development

No branches or pull requests

4 participants