I'm trying to integrate TravisCI into my workflow, and realized I had some dependencies because of my old directory structure (not having self-contained, virtualenv
-able git repos).
When I try to run nosetests
locally, it runs the tests just fine; when TravisCI tries to run them, it fails, with an import
error. Specifically, I have, as one of the lines in my test script:
from myproject import something
My directory structure is inside my git repo myproject
is something like:
.travis.yml
requirements.txt
something.py
tests/
test_something.py
- I have tried getting this to fail locally (because then I'd understand the TravisCI issue, maybe), but cannot accomplish it.
- I've tried running with regular python, and using a virtualenv which added
nose
to itsrequirements.txt
, and the tests always pass locally.
I feel like I still haven't understood absolute-vs-relative imports, and I can't tell if that's coming in to play here, or if I'm just doing something obvious and dumb in my project.
Desired outcome: figure out why TravisCI is failing, and fix my repo accordingly, so that I can commit and have things build correctly, both locally and on TravisCI. If that requires more drastic changes like "you should have a setup.py
that does blah-blah to the environment" or similar - please let me know. I'm new to this aspect of Python, and find the current documentation overwhelmingly unclear.
As an FYI, I found this question and adding --exe
doesn't help, or seem to be the same issue.
sys.path
- if you're interested: travis output and github. So far, I'm just trying to get thea_star
anddecision_tree
tests running, so should only focus on those.ai
is my module,__file__
prints what I expect, namely, the directory inside my github repo, and is not anywhere inrequirements.txt
. Also, I have an empty$PYTHONPATH
.