Skip to content

Commit

Permalink
fix setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalev committed Oct 21, 2019
1 parent 0ab6e15 commit 66c8933
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
import re
from pathlib import Path

from setuptools import setup, find_packages
from setuptools import find_packages, setup

version = __import__('aioworkers_aiohttp').__version__

requirements = [
'aioworkers>=0.13.0',
Expand All @@ -14,9 +14,27 @@
'pytest-aiohttp',
]


def read(f):
path = Path(__file__).parent / f
if not path.exists():
return ''
return path.read_text(encoding='latin1').strip()


def get_version():
text = read('aioworkers_aiohttp/version.py')
if not text:
text = read('aioworkers_aiohttp/__init__.py')
try:
return re.findall(r"^__version__ = '([^']+)'$", text, re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')


setup(
name='aioworkers-aiohttp',
version=version,
version=get_version(),
description="",
author="Alexander Malev",
author_email='yttrium@somedev.ru',
Expand Down

0 comments on commit 66c8933

Please sign in to comment.