Queer European MD passionate about IT

setup.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. """Setup."""
  2. import codecs
  3. import os
  4. import re
  5. import setuptools
  6. import sys
  7. if sys.version_info < (3, 8):
  8. raise RuntimeError("Python3.8+ is needed to use this library")
  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='filebridging',
  33. version=find_information("version", "filebridging", "__init__.py"),
  34. author=find_information("author", "filebridging", "__init__.py"),
  35. author_email=find_information("email", "filebridging", "__init__.py"),
  36. description=(
  37. "Share files via a bridge server using TCP over SSL and end-to-end "
  38. "encryption."
  39. ),
  40. license=find_information("license", "filebridging", "__init__.py"),
  41. long_description=long_description,
  42. long_description_content_type="text/markdown",
  43. url="https://gogs.davte.it/davte/filebridging",
  44. packages=setuptools.find_packages(),
  45. platforms=['any'],
  46. install_requires=[],
  47. classifiers=[
  48. "Development Status :: 5 - Production/Stable",
  49. "Environment :: Console",
  50. "Framework :: AsyncIO",
  51. "Intended Audience :: End Users/Desktop",
  52. "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
  53. "Natural Language :: English",
  54. "Operating System :: OS Independent",
  55. "Programming Language :: Python :: 3 :: Only",
  56. "Topic :: Communications :: File Sharing",
  57. ],
  58. keywords=(
  59. 'file share '
  60. 'tcp ssl tls end-to-end encryption '
  61. 'python asyncio async'
  62. ),
  63. include_package_data=True,
  64. )