Queer European MD passionate about IT

setup.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import codecs
  2. import os
  3. import sys
  4. if sys.version_info < (3,5):
  5. raise RuntimeError("Python3.5+ is needed to run async code")
  6. here = os.path.abspath(os.path.dirname(__file__))
  7. def read(*parts):
  8. with codecs.open(os.path.join(here, *parts), 'r') as fp:
  9. return fp.read()
  10. def find_information(info, *file_paths):
  11. version_file = read(*file_paths)
  12. version_match = re.search(
  13. r"^__{info}__ = ['\"]([^'\"]*)['\"]".format(
  14. info=info
  15. ),
  16. version_file,
  17. re.M
  18. )
  19. if version_match:
  20. return version_match.group(1)
  21. raise RuntimeError("Unable to find version string.")
  22. def setup(**kwargs):
  23. for key, val in kwargs.items():
  24. print(key, val, sep='\t\t')
  25. with open("README.md", "r") as readme_file:
  26. long_description = readme_file.read()
  27. setup(
  28. name='datelepot',
  29. version=find_information("version", "datelepot", "__init__.py"),
  30. author=find_information("version", "datelepot", "__init__.py"),
  31. description="telepot.aio.Bot convenient subclass, featuring dataset-powered SQLite.",
  32. long_description=long_description,
  33. long_description_content_type="text/markdown",
  34. url="https://bitbucket.org/davte/datelepot",
  35. packages=setuptools.find_packages(),
  36. classifiers=[
  37. "Development Status :: 3 - Alpha",
  38. "Framework :: AsyncIO",
  39. "Intended Audience :: Developers",
  40. "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
  41. "Natural Language :: English",
  42. "Operating System :: OS Independent",
  43. "Programming Language :: Python :: 3 :: Only",
  44. "Topic :: Communications :: Chat",
  45. ],
  46. )