diff --git a/setup.py b/setup.py index 6dc8131..85c38b0 100755 --- a/setup.py +++ b/setup.py @@ -32,19 +32,22 @@ from setuptools import setup HTTPretty.disable() +HTTPRETTY_PATH = os.path.abspath(os.path.join(__file__, os.pardir)) + def get_packages(): # setuptools can't do the job :( packages = [] - for root, dirnames, filenames in os.walk('httpretty'): + for root, dirnames, filenames in os.walk(os.path.join(HTTPRETTY_PATH, 'httpretty')): + path = root.replace(HTTPRETTY_PATH, '').strip('/') if '__init__.py' in filenames: - packages.append(".".join(os.path.split(root)).strip(".")) + packages.append(".".join(os.path.split(path)).strip(".")) return packages def test_packages(): - test_reqs = os.path.join(os.getcwd(), 'requirements.pip') + test_reqs = os.path.join(HTTPRETTY_PATH, 'requirements.pip') tests_require = [ line.strip() for line in open(test_reqs).readlines() if not line.startswith("#")