11# -*- coding: utf-8 -*-
22import os
33
4+ import re
5+ VERSIONFILE = "folium/__init__.py"
6+ verstrline = open (VERSIONFILE , "rt" ).read ()
7+ VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
8+ mo = re .search (VSRE , verstrline , re .M )
9+ if mo :
10+ verstr = mo .group (1 )
11+ else :
12+ raise RuntimeError ("Unable to find version string in %s." % (VERSIONFILE ,))
13+
414try :
515 from setuptools import setup
616except ImportError :
717 from distutils .core import setup
818
19+
920def walk_subpkg (name ):
1021 data_files = []
1122 package_dir = 'folium'
1223 for parent , dirs , files in os .walk (os .path .join (package_dir , name )):
13- sub_dir = os .sep .join (parent .split (os .sep )[1 :]) # remove package_dir from the path
24+ # Remove package_dir from the path.
25+ sub_dir = os .sep .join (parent .split (os .sep )[1 :])
1426 for f in files :
1527 data_files .append (os .path .join (sub_dir , f ))
1628 return data_files
1729
1830pkg_data = {
19- '' : ['*.js' ,
20- 'plugins/*.js' ,
21- 'templates/*.html' ,
22- 'templates/*.js' ,
23- 'templates/*.txt' ] + walk_subpkg ('templates/tiles' )
31+ '' : ['*.js' ,
32+ 'plugins/*.js' ,
33+ 'templates/*.html' ,
34+ 'templates/*.js' ,
35+ 'templates/*.txt' ] + walk_subpkg ('templates/tiles' )
2436}
2537
2638setup (
2739 name = 'folium' ,
28- version = '0.1.3' ,
40+ version = verstr ,
2941 description = 'Make beautiful maps with Leaflet.js & Python' ,
3042 author = 'Rob Story' ,
3143@@ -34,6 +46,8 @@ def walk_subpkg(name):
3446 keywords = 'data visualization' ,
3547 classifiers = ['Development Status :: 4 - Beta' ,
3648 'Programming Language :: Python :: 2.7' ,
49+ 'Programming Language :: Python :: 3.3' ,
50+ 'Programming Language :: Python :: 3.4' ,
3751 'License :: OSI Approved :: MIT License' ],
3852 packages = ['folium' ],
3953 package_data = pkg_data
0 commit comments