Merge pull request #82 from toumorokoshi/pathindependent
Fixing an issue with setup.py being run in a different directory than the egg root
This commit is contained in:
9
setup.py
9
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("#")
|
||||
|
||||
Reference in New Issue
Block a user