Skip to content

Commit

Permalink
Moved version string to folium/__init__.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Dec 4, 2014
1 parent df33b82 commit 9c330ae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions folium/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

__version__ = '0.1.3'

from folium.folium import Map, initialize_notebook
28 changes: 21 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# -*- coding: utf-8 -*-
import os

import re
VERSIONFILE = "folium/__init__.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))

try:
from setuptools import setup
except ImportError:
from distutils.core import setup


def walk_subpkg(name):
data_files = []
package_dir = 'folium'
for parent, dirs, files in os.walk(os.path.join(package_dir, name)):
sub_dir = os.sep.join(parent.split(os.sep)[1:]) # remove package_dir from the path
# Remove package_dir from the path.
sub_dir = os.sep.join(parent.split(os.sep)[1:])
for f in files:
data_files.append(os.path.join(sub_dir, f))
return data_files

pkg_data = {
'': ['*.js',
'plugins/*.js',
'templates/*.html',
'templates/*.js',
'templates/*.txt'] + walk_subpkg('templates/tiles')
'': ['*.js',
'plugins/*.js',
'templates/*.html',
'templates/*.js',
'templates/*.txt'] + walk_subpkg('templates/tiles')
}

setup(
name='folium',
version='0.1.3',
version=verstr,
description='Make beautiful maps with Leaflet.js & Python',
author='Rob Story',
author_email='wrobstory@gmail.com',
Expand All @@ -34,6 +46,8 @@ def walk_subpkg(name):
keywords='data visualization',
classifiers=['Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'License :: OSI Approved :: MIT License'],
packages=['folium'],
package_data=pkg_data
Expand Down

0 comments on commit 9c330ae

Please sign in to comment.