setup.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Licensed under the Apache License, Version 2.0 (the "License");
  2. # you may not use this file except in compliance with the License.
  3. # You may obtain a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. """
  13. Module to setup Wapyce.
  14. """
  15. import os
  16. from setuptools import find_packages
  17. from setuptools import setup
  18. BASE_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
  19. def get_long_description():
  20. """
  21. Returns the long description of Wapyce.
  22. :return: The long description of Wapyce.
  23. :rtype: str
  24. """
  25. with open(
  26. os.path.join(BASE_DIRECTORY, 'README.md'),
  27. 'r',
  28. encoding='utf-8'
  29. ) as readme_file:
  30. return readme_file.read()
  31. def get_packages():
  32. """
  33. Returns the packages used for Wapyce.
  34. :return: The packages used for Wapyce.
  35. :rtype: list(str)
  36. """
  37. packages = find_packages(exclude=['tests'])
  38. packages.append('')
  39. return packages
  40. def get_package_data():
  41. """
  42. Returns the packages with static files of Wapyce.
  43. :return: The packages with static files of Wapyce.
  44. :rtype: dict(str, list(str))
  45. """
  46. package_data = {'': ['requirements.txt']}
  47. return package_data
  48. def get_requirements():
  49. """
  50. Returns the content of 'requirements.txt' in a list.
  51. :return: The content of 'requirements.txt'.
  52. :rtype: list(str)
  53. """
  54. requirements = []
  55. with open(
  56. os.path.join(BASE_DIRECTORY, 'requirements.txt'),
  57. 'r',
  58. encoding='utf-8'
  59. ) as requirements_file:
  60. lines = requirements_file.readlines()
  61. for line in lines:
  62. requirements.append(line.strip())
  63. return requirements
  64. setup(
  65. name='wapyce',
  66. description=(
  67. 'A web server that store information of accessibility validation.'
  68. ),
  69. long_description=get_long_description(),
  70. long_description_content_type='text/markdown',
  71. version='1.0.0',
  72. url='https://github.com/carlsonsantana/wapyce',
  73. author='Carlson Santana Cruz',
  74. license='MIT',
  75. classifiers=[
  76. 'Framework :: Django :: 2.1',
  77. 'Intended Audience :: Information Technology',
  78. 'License :: OSI Approved :: MIT License',
  79. 'Natural Language :: English',
  80. 'Programming Language :: Python :: 3',
  81. 'Topic :: Software Development :: Quality Assurance'
  82. ],
  83. packages=get_packages(),
  84. package_data=get_package_data(),
  85. install_requires=get_requirements()
  86. )