-
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.
- Loading branch information
Showing
2 changed files
with
18 additions
and
20 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,39 +1,37 @@ | ||
#!/usr/bin/env python | ||
import codecs | ||
import os | ||
import re | ||
import sys | ||
|
||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
from setuptools import setup | ||
|
||
version = None | ||
|
||
with codecs.open(os.path.join(os.path.abspath(os.path.dirname( | ||
__file__)), 'aiohttp_basicauth', '__init__.py'), 'r', 'latin1') as fp: | ||
try: | ||
version = re.findall(r"^__version__ = '([^']+)'\r?$", | ||
fp.read(), re.M)[0] | ||
except IndexError: | ||
raise RuntimeError('Unable to determine version.') | ||
if sys.version_info < (3, 7): | ||
raise RuntimeError('aiohttp-basicauth requires Python 3.7+') | ||
|
||
if sys.version_info < (3, 5, 3): | ||
raise RuntimeError("aiohttp_basicauth requires Python 3.5.3+") | ||
|
||
with open('README.md') as f: | ||
long_description = f.read() | ||
def get_version(): | ||
here = os.path.dirname(os.path.abspath(__file__)) | ||
filename = os.path.join(here, 'aiohttp_basicauth', '__init__.py') | ||
contents = open(filename).read() | ||
pattern = r"^__version__ = '(.*?)'$" | ||
return re.search(pattern, contents, re.MULTILINE).group(1) | ||
|
||
|
||
def get_long_description(): | ||
with open('README.md', mode='r', encoding='utf8') as f: | ||
return f.read() | ||
|
||
|
||
setup( | ||
name='aiohttp_basicauth', | ||
author='Roman Snegirev', | ||
author_email='[email protected]', | ||
version=version, | ||
version=get_version(), | ||
license='Apache 2', | ||
url='https://github.com/romis2012/aiohttp-basicauth', | ||
description='HTTP basic authentication middleware for aiohttp 3.0+', | ||
long_description=long_description, | ||
long_description=get_long_description(), | ||
long_description_content_type='text/markdown', | ||
packages=['aiohttp_basicauth'], | ||
keywords='aiohttp http basic auth', | ||
|