Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/e-dard/flask-s3
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuyukai committed Nov 23, 2015
2 parents a95477f + e14f390 commit 527abf9
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,30 @@
Easily serve your static files from Amazon S3.
"""
from setuptools import setup
from flask_s3 import __version__


# Figure out the version; this could be done by importing the
# module, though that requires dependencies to be already installed,
# which may not be the case when processing a pip requirements
# file, for example.
def parse_version(asignee):
import os, re
here = os.path.dirname(os.path.abspath(__file__))
version_re = re.compile(
r'%s = (\(.*?\))' % asignee)
with open(os.path.join(here, 'flask_s3.py')) as fp:
for line in fp:
match = version_re.search(line)
if match:
version = eval(match.group(1))
return ".".join(map(str, version))
else:
raise Exception("cannot find version")
version = parse_version('__version__')
# above taken from miracle2k/flask-assets

setup(
name='Flask-S3',
version=".".join(map(str, __version__)),
version=version,
url='http://github.com/e-dard/flask-s3',
license='WTFPL',
author='Edward Robinson',
Expand Down

0 comments on commit 527abf9

Please sign in to comment.