-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read package info from __init__.py, as to the DRY principle
- Loading branch information
Showing
2 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
import re | ||
|
||
from codecs import open | ||
from distutils.core import setup | ||
|
||
setup(name="pymmrouting", | ||
version="0.3.2", | ||
version = '' | ||
license = '' | ||
title = '' | ||
author = '' | ||
contact = '' | ||
with open('pymmrouting/__init__.py', 'r') as fd: | ||
file_content = fd.read() | ||
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
file_content, re.MULTILINE).group(1) | ||
license = re.search(r'^__license__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
file_content, re.MULTILINE).group(1) | ||
title = re.search(r'^__title__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
file_content, re.MULTILINE).group(1) | ||
author = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
file_content, re.MULTILINE).group(1) | ||
contact = re.search(r'^__contact__\s*=\s*[\'"]([^\'"]*)[\'"]', | ||
file_content, re.MULTILINE).group(1) | ||
|
||
setup(name=title, | ||
version=version, | ||
description="""Python implementation of multimodal routing engine | ||
based on multimodal shortest path algorithm for | ||
postgis library (libmmspa4pg)""", | ||
author="Lu LIU", | ||
author_email="nudtlliu@gmail.com", | ||
author=author, | ||
author_email=contact, | ||
license=license, | ||
packages=['pymmrouting']) |