setup.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/flaskbb/flaskbb>`_
  21. * `issues <https://github.com/flaskbb/flaskbb/issues>`_
  22. """
  23. import os
  24. import sys
  25. from setuptools import find_packages, setup
  26. from setuptools.command.test import test as TestCommand
  27. class PyTestCommand(TestCommand):
  28. user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
  29. def initialize_options(self):
  30. TestCommand.initialize_options(self)
  31. self.pytest_args = []
  32. def finalize_options(self):
  33. TestCommand.finalize_options(self)
  34. self.test_args = []
  35. self.test_suite = True
  36. def run_tests(self):
  37. import pytest # noqa
  38. errno = pytest.main(self.pytest_args)
  39. sys.exit(errno)
  40. def read(*parts):
  41. here = os.path.abspath(os.path.dirname(__file__))
  42. with open(os.path.join(here, *parts), 'r') as fp:
  43. return fp.read()
  44. def get_requirements(e=None):
  45. rf = "requirements.txt" if e is None else 'requirements-{}.txt'.format(e)
  46. r = read(rf)
  47. return [x.strip() for x in r.split('\n')
  48. if not x.startswith('#') and not x.startswith("-e")]
  49. install_requires = get_requirements()
  50. setup(
  51. name='FlaskBB',
  52. version="2.0.0.dev0",
  53. url='https://flaskbb.org',
  54. project_urls={
  55. ('Documentation', 'https://flaskbb.readthedocs.io/en/latest/'),
  56. ('Code', 'https://github.com/flaskbb/flaskbb'),
  57. ('Issue Tracker', 'https://github.com/flaskbb/flaskbb'),
  58. },
  59. license='BSD',
  60. author='Peter Justin',
  61. author_email='peter.justin@outlook.com',
  62. description='A classic Forum Software in Python using Flask.',
  63. long_description=__doc__,
  64. packages=find_packages(),
  65. include_package_data=True,
  66. zip_safe=False,
  67. platforms='any',
  68. entry_points='''
  69. [console_scripts]
  70. flaskbb=flaskbb.cli:flaskbb
  71. ''',
  72. python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
  73. install_requires=install_requires,
  74. tests_require=[
  75. 'py',
  76. 'pytest',
  77. 'pytest-cov',
  78. 'cov-core',
  79. 'coverage'
  80. ],
  81. test_suite='tests',
  82. classifiers=[
  83. 'Development Status :: 4 - Beta',
  84. 'Environment :: Web Environment',
  85. 'Intended Audience :: Developers',
  86. 'Intended Audience :: End Users/Desktop',
  87. 'License :: OSI Approved :: BSD License',
  88. 'Operating System :: OS Independent',
  89. 'Programming Language :: Python',
  90. 'Programming Language :: Python :: 3',
  91. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  92. 'Topic :: Software Development :: Libraries :: Python Modules'
  93. ],
  94. cmdclass={'test': PyTestCommand}
  95. )