Queer European MD passionate about IT

setup.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. """Setup."""
  2. import codecs
  3. import os
  4. import re
  5. import setuptools
  6. import sys
  7. if sys.version_info < (3, 5):
  8. raise RuntimeError("Python3.5+ is needed to run async code")
  9. here = os.path.abspath(os.path.dirname(__file__))
  10. def read(*parts):
  11. """Read file in `part.part.part.part.ext`.
  12. Start from `here` and follow the path given by `*parts`
  13. """
  14. with codecs.open(os.path.join(here, *parts), 'r') as fp:
  15. return fp.read()
  16. def find_information(info, *file_path_parts):
  17. """Read information in file."""
  18. version_file = read(*file_path_parts)
  19. version_match = re.search(
  20. r"^__{info}__ = ['\"]([^'\"]*)['\"]".format(
  21. info=info
  22. ),
  23. version_file,
  24. re.M
  25. )
  26. if version_match:
  27. return version_match.group(1)
  28. raise RuntimeError("Unable to find version string.")
  29. with open("README.md", "r") as readme_file:
  30. long_description = readme_file.read()
  31. setuptools.setup(
  32. name='davtelepot',
  33. version=find_information("version", "davtelepot", "__init__.py"),
  34. author=find_information("author", "davtelepot", "__init__.py"),
  35. author_email=find_information("email", "davtelepot", "__init__.py"),
  36. description=(
  37. "telepot.aio.Bot convenient subclass, featuring dataset-powered "
  38. "SQLite."
  39. ),
  40. license=find_information("license", "davtelepot", "__init__.py"),
  41. long_description=long_description,
  42. long_description_content_type="text/markdown",
  43. url="https://bitbucket.org/davte/davtelepot",
  44. packages=setuptools.find_packages(),
  45. platforms=['any'],
  46. install_requires=[
  47. 'aiohttp>=3.4.4',
  48. 'bs4>=0.0.1',
  49. 'dataset>=1.1.0',
  50. 'davteutil',
  51. 'telepot>=12.7'
  52. ],
  53. classifiers=[
  54. "Development Status :: 3 - Alpha",
  55. "Framework :: AsyncIO",
  56. "Intended Audience :: Developers",
  57. (
  58. "License :: OSI Approved :: GNU Lesser General Public License "
  59. "v3 (LGPLv3)"
  60. ),
  61. "Natural Language :: English",
  62. "Operating System :: OS Independent",
  63. "Programming Language :: Python :: 3 :: Only",
  64. "Topic :: Communications :: Chat",
  65. ],
  66. keywords='telepot telegram bot python wrapper',
  67. include_package_data=True,
  68. )