setup.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. """
  2. FlaskBB
  3. =======
  4. FlaskBB is a Forum Software written in Python using the micro framework Flask.
  5. Quickstart
  6. ----------
  7. .. code:: bash
  8. # Install the FlaskBB package and it's dependencies
  9. $ pip install -e .
  10. # Generate a configuration
  11. $ flaskbb makeconfig
  12. # Install FlaskBB
  13. $ flaskbb install
  14. # Run the development server
  15. $ flaskbb run
  16. * Running on http://localhost:8080/
  17. Resources
  18. ---------
  19. * `website <https://flaskbb.org>`_
  20. * `source <https://github.com/sh4nks/flaskbb>`_
  21. * `issues <https://github.com/sh4nks/flaskbb/issues>`_
  22. """
  23. import ast
  24. import os
  25. import re
  26. import sys
  27. from setuptools import find_packages, setup
  28. from setuptools.command.test import test as TestCommand
  29. class PyTestCommand(TestCommand):
  30. user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
  31. def initialize_options(self):
  32. TestCommand.initialize_options(self)
  33. self.pytest_args = []
  34. def finalize_options(self):
  35. TestCommand.finalize_options(self)
  36. self.test_args = []
  37. self.test_suite = True
  38. def run_tests(self):
  39. import pytest # noqa
  40. errno = pytest.main(self.pytest_args)
  41. sys.exit(errno)
  42. def read(*parts):
  43. here = os.path.abspath(os.path.dirname(__file__))
  44. with open(os.path.join(here, *parts), 'r') as fp:
  45. return fp.read()
  46. def get_requirements(e=None):
  47. rf = "requirements.txt" if e is None else 'requirements-{}.txt'.format(e)
  48. r = read(rf)
  49. return [x.strip() for x in r.split('\n')
  50. if not x.startswith('#') and not x.startswith("-e")]
  51. install_requires = get_requirements()
  52. setup(
  53. name='FlaskBB',
  54. version="2.0.0.dev0",
  55. url='https://github.com/sh4nks/flaskbb/',
  56. license='BSD',
  57. author='Peter Justin',
  58. author_email='peter.justin@outlook.com',
  59. description='A classic Forum Software in Python using Flask.',
  60. long_description=__doc__,
  61. packages=find_packages(),
  62. include_package_data=True,
  63. zip_safe=False,
  64. platforms='any',
  65. install_requires=install_requires,
  66. entry_points='''
  67. [console_scripts]
  68. flaskbb=flaskbb.cli:flaskbb
  69. ''',
  70. test_suite='tests',
  71. tests_require=[
  72. 'py',
  73. 'pytest',
  74. 'pytest-cov',
  75. 'cov-core',
  76. 'coverage'
  77. ],
  78. classifiers=[
  79. 'Development Status :: 4 - Beta',
  80. 'Environment :: Web Environment',
  81. 'Intended Audience :: Developers',
  82. 'Intended Audience :: End Users/Desktop',
  83. 'License :: OSI Approved :: BSD License',
  84. 'Operating System :: OS Independent',
  85. 'Programming Language :: Python',
  86. 'Programming Language :: Python :: 3',
  87. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  88. 'Topic :: Software Development :: Libraries :: Python Modules'
  89. ],
  90. cmdclass={'test': PyTestCommand}
  91. )