I\'m setting up Travis-CI for my project, and oddly, I can\'t import my project:
$ python tests/tests.py
Traceback (most recent call last):
File \"tests/te
What's the best way to make this work, so my code is added as an importable module?
The answer is unequivocally to use distutils (and definitely not ln).
In production, I just create a symlink ...
B-b-but why? The complexity to do it the Right Way™ is so low! It even fits in a few lines:
From The Fine Manual -- just create a setup.py like this:
from distutils.core import setup
setup(name='Distutils',
version='1.0',
description='Python Distribution Utilities',
author='Greg Ward',
author_email='gward@python.net',
url='https://www.python.org/sigs/distutils-sig/',
packages=['distutils', 'distutils.command'],
)
Now you can do fantastic things like python setup.py install, python setup.py bdist_rpm or pip install . -- and not just in the Travis environment but for your project in general.