Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Commit

Permalink
Read the file instead of importing it
Browse files Browse the repository at this point in the history
Heavily inspired by the `python-requests` libraries way of doing it
  • Loading branch information
joshuaduffy committed Aug 11, 2016
1 parent 10d9409 commit ef5c362
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,37 @@
"""Setup script"""

from setuptools import setup
import dota2api
import re


with open('dota2api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE).group(1)

with open('dota2api/__init__.py', 'r') as fd:
author = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE).group(1)

with open('dota2api/__init__.py', 'r') as fd:
doc = re.search(r'^__doc__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE).group(1)

with open('dota2api/__init__.py', 'r') as fd:
licence = re.search(r'^__licence__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE).group(1)

setup(
name="dota2api",
version=dota2api.__version__,
author=dota2api.__author__,
version=version,
author=author,
author_email="mail@joshuaduffy.org",
url="https://github.com/joshuaduffy/dota2api",
description=dota2api.__doc__,
license=dota2api.__licence__,
description=doc,
license=licence,
keywords="dota2 dota api dota2api parser",
packages=['dota2api', 'dota2api.src', 'dota2api.ref'],
package_data={'dota2api.ref': ['abilities.json',
Expand Down

0 comments on commit ef5c362

Please sign in to comment.