1
1
# -*- coding: utf-8 -*-
2
2
import os
3
3
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
+
4
14
try :
5
15
from setuptools import setup
6
16
except ImportError :
7
17
from distutils .core import setup
8
18
19
+
9
20
def walk_subpkg (name ):
10
21
data_files = []
11
22
package_dir = 'folium'
12
23
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 :])
14
26
for f in files :
15
27
data_files .append (os .path .join (sub_dir , f ))
16
28
return data_files
17
29
18
30
pkg_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' )
24
36
}
25
37
26
38
setup (
27
39
name = 'folium' ,
28
- version = '0.1.3' ,
40
+ version = verstr ,
29
41
description = 'Make beautiful maps with Leaflet.js & Python' ,
30
42
author = 'Rob Story' ,
31
43
@@ -34,6 +46,8 @@ def walk_subpkg(name):
34
46
keywords = 'data visualization' ,
35
47
classifiers = ['Development Status :: 4 - Beta' ,
36
48
'Programming Language :: Python :: 2.7' ,
49
+ 'Programming Language :: Python :: 3.3' ,
50
+ 'Programming Language :: Python :: 3.4' ,
37
51
'License :: OSI Approved :: MIT License' ],
38
52
packages = ['folium' ],
39
53
package_data = pkg_data
0 commit comments