Commit ac1f46f5 authored by Vincent Pelletier's avatar Vincent Pelletier

Make setup.py work when invoked from a different path.

parent a2f7c7ba
...@@ -33,8 +33,10 @@ DEPS = { ...@@ -33,8 +33,10 @@ DEPS = {
), ),
} }
_file_dirname = os.path.dirname(__file__)
def download(url, filename, hexdigest): def download(url, filename, hexdigest):
filename = join('apachedex', filename) filename = join(_file_dirname, 'apachedex', filename)
if not exists(filename): if not exists(filename):
urllib.urlretrieve(url, filename) urllib.urlretrieve(url, filename)
if hashlib.md5(open(filename).read()).hexdigest() != hexdigest: if hashlib.md5(open(filename).read()).hexdigest() != hexdigest:
...@@ -47,7 +49,7 @@ for filename, (url, hexdigest) in DEPS.items(): ...@@ -47,7 +49,7 @@ for filename, (url, hexdigest) in DEPS.items():
if sys.argv[1:] == ['deps']: if sys.argv[1:] == ['deps']:
sys.exit(0) sys.exit(0)
description = open('README').read() description = open(join(_file_dirname, 'README')).read()
setup( setup(
name='APacheDEX', name='APacheDEX',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment