Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to fix RTD builds for 0.9.x #1370

Merged
merged 1 commit into from
Oct 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[install]
prefix = /opt/graphite
install-lib = %(prefix)s/webapp

[bdist_rpm]
requires = Django => 1.1.4
django-tagging
Expand Down
91 changes: 59 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
#!/usr/bin/env python

import os
import ConfigParser
from glob import glob


try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO

# adding [install] section
with open('setup.cfg', 'r') as f:
orig_setup_cfg = f.read()
cf = ConfigParser.ConfigParser()
cf.readfp(BytesIO(orig_setup_cfg), 'setup.cfg')

if os.environ.get('READTHEDOCS'):
os.remove('setup.cfg')
cf.remove_section('install')
else:
try:
cf.add_section('install')
except ConfigParser.DuplicateSectionError:
pass
cf.set('install', 'prefix', '/opt/graphite')
cf.set('install', 'install-lib', '%(prefix)s/webapp')

with open('setup.cfg', 'wb') as f:
cf.write(f)

if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
Expand Down Expand Up @@ -35,34 +58,38 @@
conf_files = [ ('conf', glob('conf/*.example')) ]
examples = [ ('examples', glob('examples/example-*')) ]

setup(
name='graphite-web',
version='0.9.13',
url='http://graphite.readthedocs.org',
author='Chris Davis',
author_email='[email protected]',
license='Apache Software License 2.0',
description='Enterprise scalable realtime graphing',
package_dir={'' : 'webapp'},
packages=[
'graphite',
'graphite.account',
'graphite.browser',
'graphite.cli',
'graphite.composer',
'graphite.render',
'graphite.url_shortener',
'graphite.whitelist',
'graphite.metrics',
'graphite.dashboard',
'graphite.events',
'graphite.version',
'graphite.thirdparty',
'graphite.thirdparty.pytz',
],
package_data={'graphite' :
['templates/*', 'local_settings.py.example']},
scripts=glob('bin/*'),
data_files=webapp_content.items() + storage_dirs + conf_files + examples,
**setup_kwargs
)
try:
setup(
name='graphite-web',
version='0.9.13',
url='http://graphite.readthedocs.org',
author='Chris Davis',
author_email='[email protected]',
license='Apache Software License 2.0',
description='Enterprise scalable realtime graphing',
package_dir={'' : 'webapp'},
packages=[
'graphite',
'graphite.account',
'graphite.browser',
'graphite.cli',
'graphite.composer',
'graphite.render',
'graphite.url_shortener',
'graphite.whitelist',
'graphite.metrics',
'graphite.dashboard',
'graphite.events',
'graphite.version',
'graphite.thirdparty',
'graphite.thirdparty.pytz',
],
package_data={'graphite' :
['templates/*', 'local_settings.py.example']},
scripts=glob('bin/*'),
data_files=webapp_content.items() + storage_dirs + conf_files + examples,
**setup_kwargs
)
finally:
with open('setup.cfg', 'w') as f:
f.write(orig_setup_cfg)