1818# required for installations from a source tarball because running
1919# ``python setup.py sdist`` will re-add the prefix to the tarball's
2020# ``setup.cfg``.
21- with open (' setup.cfg' , 'r' ) as f :
21+ with open (" setup.cfg" , "r" ) as f :
2222 orig_setup_cfg = f .read ()
2323cf = ConfigParser ()
24- cf .read_file (StringIO (orig_setup_cfg ), ' setup.cfg' )
24+ cf .read_file (StringIO (orig_setup_cfg ), " setup.cfg" )
2525
26- if os .environ .get (' GRAPHITE_NO_PREFIX' ) or os .environ .get (' READTHEDOCS' ):
27- cf .remove_section (' install' )
26+ if os .environ .get (" GRAPHITE_NO_PREFIX" ) or os .environ .get (" READTHEDOCS" ):
27+ cf .remove_section (" install" )
2828else :
2929 try :
30- cf .add_section (' install' )
30+ cf .add_section (" install" )
3131 except DuplicateSectionError :
3232 pass
33- if not cf .has_option (' install' , ' prefix' ):
34- cf .set (' install' , ' prefix' , ' /opt/graphite' )
35- if not cf .has_option (' install' , ' install-lib' ):
36- cf .set (' install' , ' install_lib' , ' %(prefix)s/webapp' )
33+ if not cf .has_option (" install" , " prefix" ):
34+ cf .set (" install" , " prefix" , " /opt/graphite" )
35+ if not cf .has_option (" install" , " install-lib" ):
36+ cf .set (" install" , " install_lib" , " %(prefix)s/webapp" )
3737
38- with open (' setup.cfg' , 'w' ) as f :
38+ with open (" setup.cfg" , "w" ) as f :
3939 cf .write (f )
4040
41- if os .environ .get (' USE_DISTUTILS' ):
41+ if os .environ .get (" USE_DISTUTILS" ):
4242 # skipcq: PYL-W0402
4343 from distutils .core import setup
44+
4445 setup_kwargs = dict ()
4546else :
4647 from setuptools import setup
48+
4749 setup_kwargs = dict (zip_safe = 0 )
4850
4951storage_dirs = []
5052
51- for subdir in ('whisper/dummy.txt' , 'ceres/dummy.txt' , 'rrd/dummy.txt' , 'log/dummy.txt' , 'log/webapp/dummy.txt' ):
52- storage_dirs .append ( ('storage/%s' % subdir , []) )
53+ for subdir in (
54+ "whisper/dummy.txt" ,
55+ "ceres/dummy.txt" ,
56+ "rrd/dummy.txt" ,
57+ "log/dummy.txt" ,
58+ "log/webapp/dummy.txt" ,
59+ ):
60+ storage_dirs .append (("storage/%s" % subdir , []))
5361
5462webapp_content = defaultdict (list )
5563
56- for root , dirs , files in os .walk (' webapp/content' ):
64+ for root , dirs , files in os .walk (" webapp/content" ):
5765 for filename in files :
5866 filepath = os .path .join (root , filename )
5967 webapp_content [root ].append (filepath )
6068
61- conf_files = [(' conf' , glob (' conf/*.example' ))]
62- examples = [(' examples' , glob (' examples/example-*' ))]
69+ conf_files = [(" conf" , glob (" conf/*.example" ))]
70+ examples = [(" examples" , glob (" examples/example-*" ))]
6371
6472
6573def read (fname ):
@@ -70,60 +78,67 @@ def read(fname):
7078
7179try :
7280 setup (
73- name = 'graphite-web' ,
74- version = '1.2.0' ,
75- url = 'http://graphiteapp.org/' ,
76- author = 'Chris Davis' ,
77- 78- license = 'Apache Software License 2.0' ,
79- description = 'Enterprise scalable realtime graphing' ,
80- long_description = read ('README.md' ),
81- long_description_content_type = 'text/markdown' ,
82- package_dir = {'' : 'webapp' },
83- packages = [
84- 'graphite' ,
85- 'graphite.account' ,
86- 'graphite.account.migrations' ,
87- 'graphite.browser' ,
88- 'graphite.composer' ,
89- 'graphite.dashboard' ,
90- 'graphite.dashboard.migrations' ,
91- 'graphite.events' ,
92- 'graphite.events.migrations' ,
93- 'graphite.finders' ,
94- 'graphite.functions' ,
95- 'graphite.functions.custom' ,
96- 'graphite.metrics' ,
97- 'graphite.readers' ,
98- 'graphite.render' ,
99- 'graphite.tags' ,
100- 'graphite.tags.migrations' ,
101- 'graphite.url_shortener' ,
102- 'graphite.url_shortener.migrations' ,
103- 'graphite.version' ,
104- 'graphite.whitelist' ,
105- 'graphite.worker_pool' ,
106- ],
107- package_data = {'graphite' : ['templates/*' , 'local_settings.py.example' ]},
108- scripts = glob ('bin/*' ),
109- data_files = list (webapp_content .items ()) + storage_dirs + conf_files + examples ,
110- install_requires = ['Django>=4.2,<6' , 'django-tagging' , 'pytz' ,
111- 'pyparsing' , 'cairocffi' , 'urllib3' , 'six' ],
112- classifiers = [
113- 'Intended Audience :: Developers' ,
114- 'Natural Language :: English' ,
115- 'License :: OSI Approved :: Apache Software License' ,
116- 'Programming Language :: Python' ,
117- 'Programming Language :: Python :: 3' ,
118- 'Programming Language :: Python :: 3.7' ,
119- 'Programming Language :: Python :: 3.8' ,
120- 'Programming Language :: Python :: 3.9' ,
121- 'Programming Language :: Python :: 3.10' ,
122- 'Programming Language :: Python :: Implementation :: CPython' ,
123- 'Programming Language :: Python :: Implementation :: PyPy' ,
124- ],
125- ** setup_kwargs
81+ name = "graphite-web" ,
82+ version = "1.2.0" ,
83+ url = "http://graphiteapp.org/" ,
84+ author = "Chris Davis" ,
85+ 86+ license = "Apache Software License 2.0" ,
87+ description = "Enterprise scalable realtime graphing" ,
88+ long_description = read ("README.md" ),
89+ long_description_content_type = "text/markdown" ,
90+ package_dir = {"" : "webapp" },
91+ packages = [
92+ "graphite" ,
93+ "graphite.account" ,
94+ "graphite.account.migrations" ,
95+ "graphite.browser" ,
96+ "graphite.composer" ,
97+ "graphite.dashboard" ,
98+ "graphite.dashboard.migrations" ,
99+ "graphite.events" ,
100+ "graphite.events.migrations" ,
101+ "graphite.finders" ,
102+ "graphite.functions" ,
103+ "graphite.functions.custom" ,
104+ "graphite.metrics" ,
105+ "graphite.readers" ,
106+ "graphite.render" ,
107+ "graphite.tags" ,
108+ "graphite.tags.migrations" ,
109+ "graphite.url_shortener" ,
110+ "graphite.url_shortener.migrations" ,
111+ "graphite.version" ,
112+ "graphite.whitelist" ,
113+ "graphite.worker_pool" ,
114+ ],
115+ package_data = {"graphite" : ["templates/*" , "local_settings.py.example" ]},
116+ scripts = glob ("bin/*" ),
117+ data_files = list (webapp_content .items ()) + storage_dirs + conf_files + examples ,
118+ install_requires = [
119+ "Django>=4.2,<6" ,
120+ "django-tagging" ,
121+ "pytz" ,
122+ "pyparsing" ,
123+ "cairocffi" ,
124+ "urllib3" ,
125+ "six" ,
126+ ],
127+ classifiers = [
128+ "Intended Audience :: Developers" ,
129+ "Natural Language :: English" ,
130+ "License :: OSI Approved :: Apache Software License" ,
131+ "Programming Language :: Python" ,
132+ "Programming Language :: Python :: 3" ,
133+ "Programming Language :: Python :: 3.7" ,
134+ "Programming Language :: Python :: 3.8" ,
135+ "Programming Language :: Python :: 3.9" ,
136+ "Programming Language :: Python :: 3.10" ,
137+ "Programming Language :: Python :: Implementation :: CPython" ,
138+ "Programming Language :: Python :: Implementation :: PyPy" ,
139+ ],
140+ ** setup_kwargs
126141 )
127142finally :
128- with open (' setup.cfg' , 'w' ) as f :
143+ with open (" setup.cfg" , "w" ) as f :
129144 f .write (orig_setup_cfg )
0 commit comments