Jon Michael Aanes
d2ab8abbf2
This commit was automatically generated by a script: https://gitfub.space/Jmaa/python-omni
81 lines
1.8 KiB
Python
81 lines
1.8 KiB
Python
#!/usr/bin/env python
|
|
#
|
|
# WARNING
|
|
#
|
|
# THIS IS AN AUTOGENERATED FILE.
|
|
#
|
|
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN.
|
|
|
|
import re
|
|
|
|
from setuptools import setup
|
|
|
|
PACKAGE_NAME = 'personal_data'
|
|
|
|
with open('README.md') as f:
|
|
readme = f.read()
|
|
|
|
def parse_version_file(text: str) -> str:
|
|
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
|
if match is None:
|
|
msg = 'Malformed _version.py file!'
|
|
raise Exception(msg)
|
|
return match.group(2)
|
|
|
|
with open(PACKAGE_NAME + '/_version.py') as f:
|
|
version = parse_version_file(f.read())
|
|
|
|
def parse_requirements(text: str) -> list[str]:
|
|
return text.strip().split('\n')
|
|
|
|
|
|
def read_requirements(path: str) -> list[str]:
|
|
with open(path) as f:
|
|
return parse_requirements(f.read())
|
|
|
|
|
|
def determine_short_description(readme: str) -> str:
|
|
readme = re.sub(r'#+[^\n]*\n+', '', readme)
|
|
m = re.search(r'^\s*(\w+[\w\s,`+-]+\.)', readme)
|
|
try:
|
|
return m.group(1)
|
|
except AttributeError as err:
|
|
msg = f'Could not determine short description: {readme}'
|
|
raise Exception(msg) from err
|
|
|
|
|
|
REQUIREMENTS_MAIN = """
|
|
beautifulsoup4
|
|
lxml
|
|
requests
|
|
requests_cache
|
|
browsercookie
|
|
cfscrape
|
|
frozendict
|
|
python-kucoin
|
|
krakenex
|
|
fin-depo @ https://gitfub.space/Usagi-Keiretsu/-/packages/pypi/personal-data/0.1.9/files/9093
|
|
"""
|
|
|
|
REQUIREMENTS_TEST = """
|
|
pytest
|
|
"""
|
|
|
|
|
|
setup(
|
|
name=PACKAGE_NAME,
|
|
version=version,
|
|
description=determine_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=parse_requirements(REQUIREMENTS_MAIN),
|
|
extras_require={
|
|
'test': parse_requirements(REQUIREMENTS_TEST),
|
|
},
|
|
python_requires='>=3.9',
|
|
)
|