-
Notifications
You must be signed in to change notification settings - Fork 723
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
Add Python dependencies during ocpkg setup and then check for them during unit test invocation #337
Comments
The disabled portion of the |
in CMakefiles, you can use expressions like IF (HAVE_CYTHON) which will do stuff only if cython is installed. If you also need nose, then IF (NOSETESTS_EXECUTABLE) If you need to run python scripts indepedently of the cython interp inside of the cogserver, then you'd also need to check: IF(PYTHONINTERP_FOUND) This way, CMake won't break for those people who don't have these things installed. |
Oh. from issue 336 there is a specific need to check for : python-numpy, python-scipy, python-matplotlib Our current CMake scripts do not check for these. They don't need to, either, unless something (e.g. a unit test) will break if the dependencies are absent. |
Yes, that is the scenario that I am referring to: checking for Python module dependencies that are required for a unit test to pass. Nosetests allows you to skip the rest of the unit tests in a file if a certain condition is met by calling
Then, the ImportError is logged in LastTest.log, but the test is marked as passing, not failing. But, is there a better way to approach it? |
So, @ferrouswheel also suggested that we should use pip with requirements.txt. Would it be okay to add that to the ocpkg script? |
yup, easy for ocpkg to find any requirements.txt in the source tree then 'pip install -r requirements.txt' them all. I'll test in a container before rolling out to the buildbot server. |
Nosetests allows you to skip the rest of the unit tests in a file if a
Since CMake also prints out which subsystems it skipped, you at least get Ideally, CMake should be modified so that skipped tests are marked The pyhon framework should work the same way: mark each test as pass, fail,
|
python-flask-restful is available in ppa:gandelman-a/test-catalog. I've sent @gandelman-a a note asking if he plans to rebuild this package in a longer-lived PPA or for trusty or precise-backports. ocpkg in testing at https://github.com/githart/opencog-config-files/tree/master/docker/opencog/precise |
I'm on holiday atm but plan on getting uploadd to Debian + Ubuntu Trusty On Wed, Nov 13, 2013 at 9:58 PM, David Hart notifications@github.comwrote:
|
@gandelman-a thanks, that's good news! Will cxxtest invoke python tests individually, per module, once for all of opencog/python? Has a python testing framework been chosen yet? |
We're already using nosetests, and and they're invoked per module. On Fri, Nov 15, 2013 at 5:16 PM, David Hart notifications@github.comwrote:
|
To date all python dependencies are fulfilled via system package repos & PPAs without the need for pips or python virtualenv. I can revisit the proliferation of PPAs when testing on trusty. |
@githart A new dependency has been added for the REST API: |
Not sure if it's helpful in this instance, but many python projects use a pip requirements file which can be generated with Then installing dependencies for pypi/github/whereever is as easy as |
@ferrouswheel thanks Joel. In fact, we started to use that in |
The next version of the CI server (likely Drone or similar instead of Buildbot) will use PyPI and requirements.txt. |
Thanks @githart |
@cosmoharrigan #1577 and #1579 replaced the installation of python packges using pip instead of apt. @inflector are there means of checking for python packges in cmake? |
@amebel This way: https://cmake.org/pipermail/cmake/2011-January/041666.html can probably be adapted to your needs. What are you trying to check in cmake? |
For checking whether a package exists before trying to run a test. Thanks for the pointer, will look at it. |
closing opencog/ocpkg code has moved, I have opened opencog/ocpkg#55 to continue tracking this issue. |
Previous discussion, quoted from #336:
@cosmoharrigan:
@keyvan-m-sadeghi:
The text was updated successfully, but these errors were encountered: