1
0
requests_util/setup.py
2024-03-11 20:41:04 +01:00

40 lines
1013 B
Python

#!/usr/bin/env python
from setuptools import setup
import re
PACKAGE_NAME = 'requests_util'
with open('README.md', 'r') as f:
readme = f.read()
with open(PACKAGE_NAME + '/_version.py', 'r') as f:
text = f.read()
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
version = match.group(2)
del match, text
def get_short_description(readme: str):
readme = re.sub(r'#+[^\n]*\n+', '', readme)
m = re.search(r'^\s*(\w+[\w\s,]+\.)', readme)
readme = m.group(1)
return readme
setup(
name=PACKAGE_NAME,
version=version,
description=get_short_description(readme),
long_description=readme,
long_description_content_type='text/markdown',
author='Jmaa',
author_email='jonjmaa@gmail.com',
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
packages=[PACKAGE_NAME],
install_requires=['requests'],
extras_require={
'Request ratelimiting': ['requests_ratelimiter'],
'Request caching': ['requests_cache'],
},
)