Commit 83eb50f5 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Julien Muchembled

setup: Tolerate running from different working directory.

parent e791dc3f
......@@ -14,7 +14,10 @@ Topic :: Database
Topic :: Software Development :: Libraries :: Python Modules
"""
if not os.path.exists('mock.py'):
base_path = os.path.dirname(__file__) or '.'
mock_path = os.path.join(base_path, 'mock.py')
if not os.path.exists(mock_path):
import cStringIO, hashlib,subprocess, urllib, zipfile
x = 'pythonmock-0.1.0.zip'
try:
......@@ -25,7 +28,7 @@ if not os.path.exists('mock.py'):
mock_py = zipfile.ZipFile(cStringIO.StringIO(x)).read('mock.py')
if hashlib.md5(mock_py).hexdigest() != '79f42f390678e5195d9ce4ae43bd18ec':
raise EnvironmentError("MD5 checksum mismatch downloading 'mock.py'")
open('mock.py', 'w').write(mock_py)
open(mock_path, 'w').write(mock_py)
zodb_require = ['ZODB3>=3.10dev']
......@@ -66,9 +69,10 @@ setup(
license = 'GPL 2+',
platforms = ["any"],
classifiers=classifiers.splitlines(),
long_description = ".. contents::\n\n" + open('README.rst').read()
+ "\n" + open('CHANGELOG.rst').read(),
packages = find_packages(),
long_description = ".. contents::\n\n" +
open(os.path.join(base_path, 'README.rst')).read() + "\n" +
open(os.path.join(base_path, 'CHANGELOG.rst')).read(),
packages = find_packages(base_path),
py_modules = ['mock'],
entry_points = {
'console_scripts': [
......
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