Setup
This commit is contained in:
parent
6ca8715a7c
commit
acc57bcc30
2
requirements.txt
Normal file
2
requirements.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
enforce-typing
|
||||||
|
aenum
|
39
setup.py
39
setup.py
|
@ -1,29 +1,42 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from setuptools import setup
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
PACKAGE_NAME = 'socials_util'
|
from setuptools import setup
|
||||||
|
|
||||||
with open('README.md', 'r') as f:
|
PACKAGE_NAME = 'socials-util'
|
||||||
|
|
||||||
|
with open('README.md') as f:
|
||||||
readme = f.read()
|
readme = f.read()
|
||||||
|
|
||||||
with open(PACKAGE_NAME+'/_version.py', 'r') as f:
|
with open(PACKAGE_NAME.replace('-', '_') + '/_version.py') as f:
|
||||||
match = re.match(r'^__version__\s*=\s*"([\d\.]+)"$', f.read())
|
text = f.read()
|
||||||
version = match.group(1)
|
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
||||||
del match
|
version = match.group(2)
|
||||||
|
del match, text
|
||||||
|
|
||||||
|
with open('requirements.txt') as f:
|
||||||
|
install_requires = f.read().strip().split('\n')
|
||||||
|
|
||||||
|
|
||||||
|
def get_short_description(readme: 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 = 'Could not determine short description'
|
||||||
|
raise Exception(msg) from err
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=PACKAGE_NAME,
|
name=PACKAGE_NAME,
|
||||||
version=version,
|
version=version,
|
||||||
|
description=get_short_description(readme),
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
author='Jmaa',
|
author='Jmaa',
|
||||||
author_email='jonjmaa@gmail.com',
|
author_email='jonjmaa@gmail.com',
|
||||||
url='https://gitfub.space/Jmaa/socials-util',
|
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
|
||||||
packages=[PACKAGE_NAME],
|
packages=[PACKAGE_NAME],
|
||||||
install_requires=['enforce-typing', 'aenum'],
|
install_requires=install_requires,
|
||||||
keywords=[],
|
|
||||||
classifiers=[],
|
|
||||||
include_package_data=True,
|
|
||||||
zip_safe=False
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user