Skip to content

Commit

Permalink
Patchup config.VERSION_FILE_PATH when on RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
jerearista committed Sep 9, 2015
1 parent c9e1632 commit e85cee6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def join_url(x, y):
print 'Customizing install for ReadTheDocs.org build servers...'
conf_path = '.' + conf_path
install_path = '.' + install_path
config.VERSION_FILE_PATH = '.' + config.VERSION_FILE_PATH
from subprocess import call
call(['docs/setup_rtd_files.sh'])
packages.append('client')
Expand All @@ -75,7 +76,7 @@ def join_url(x, y):

install_requirements = open('requirements.txt').read().split('\n')
install_requirements = [x.strip() for x in install_requirements
if x.strip() and
if x.strip() and
'dev only' not in x]
version = open('VERSION').read().split()[0].strip()

Expand All @@ -89,8 +90,8 @@ def join_url(x, y):
os.remove(path)
data_files += [(path, [])]

for (filename, dst, src) in [('neighbordb',
install_path,
for (filename, dst, src) in [('neighbordb',
install_path,
'conf/neighbordb'),
('bootstrap.conf',
'%s/bootstrap' % install_path,
Expand All @@ -104,7 +105,7 @@ def join_url(x, y):
file_path = '%s/%s' % (dst, filename)
if install() and os.path.exists(file_path):
if os.path.isdir(file_path):
shutil.rmtree(file_path,
shutil.rmtree(file_path,
ignore_errors=True)
else:
# do this manually
Expand All @@ -115,7 +116,7 @@ def join_url(x, y):

# bootstrap file, libraries, VERSION, plugins and actions are
# always overwritten
file_list = [('bootstrap', '%s/bootstrap' % install_path,
file_list = [('bootstrap', '%s/bootstrap' % install_path,
'client/bootstrap')]
for filename in glob('actions/*'):
file_list += [(filename.split('/')[-1],
Expand All @@ -133,7 +134,7 @@ def join_url(x, y):
file_path = '%s/%s' % (dst, filename)
if install() and os.path.exists(file_path) and \
os.path.isdir(file_path):
shutil.rmtree(file_path,
shutil.rmtree(file_path,
ignore_errors=True)
data_files += [(dst, glob(src))]

Expand All @@ -158,5 +159,5 @@ def join_url(x, y):
custom_path = os.environ.get('ZTPS_INSTALL_ROOT')
if custom_path:
shutil.copy('VERSION', join_url(custom_path, config.VERSION_FILE_PATH))
else:
else:
shutil.copy('VERSION', config.VERSION_FILE_PATH)

0 comments on commit e85cee6

Please sign in to comment.