setup.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. from setuptools import find_packages, setup
  6. from setuptools.command.test import test as TestCommand
  7. class PyTestCommand(TestCommand):
  8. user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
  9. def initialize_options(self):
  10. TestCommand.initialize_options(self)
  11. self.pytest_args = []
  12. def finalize_options(self):
  13. TestCommand.finalize_options(self)
  14. self.test_args = []
  15. self.test_suite = True
  16. def run_tests(self):
  17. import pytest # noqa
  18. errno = pytest.main(self.pytest_args)
  19. sys.exit(errno)
  20. def read(*parts):
  21. here = os.path.abspath(os.path.dirname(__file__))
  22. with open(os.path.join(here, *parts), 'r') as fp:
  23. return fp.read()
  24. def get_requirements(e=None):
  25. rf = "requirements.txt" if e is None else 'requirements-{}.txt'.format(e)
  26. r = read(rf)
  27. return [x.strip() for x in r.split('\n')
  28. if not x.startswith('#') and not x.startswith("-e")]
  29. long_description = read("README.md")
  30. install_requires = get_requirements()
  31. setup(
  32. name='FlaskBB',
  33. version="2.0.1",
  34. url='https://flaskbb.org',
  35. project_urls={
  36. 'Documentation': 'https://flaskbb.readthedocs.io/en/latest/',
  37. 'Code': 'https://github.com/flaskbb/flaskbb',
  38. 'Issue Tracker': 'https://github.com/flaskbb/flaskbb',
  39. },
  40. license='BSD',
  41. author='Peter Justin',
  42. author_email='peter.justin@outlook.com',
  43. description='A classic Forum Software in Python using Flask.',
  44. long_description=long_description,
  45. long_description_content_type='text/markdown',
  46. packages=find_packages(),
  47. include_package_data=True,
  48. zip_safe=False,
  49. platforms='any',
  50. entry_points='''
  51. [console_scripts]
  52. flaskbb=flaskbb.cli:flaskbb
  53. ''',
  54. python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
  55. install_requires=install_requires,
  56. tests_require=[
  57. 'py',
  58. 'pytest',
  59. 'pytest-cov',
  60. 'cov-core',
  61. 'coverage'
  62. ],
  63. test_suite='tests',
  64. classifiers=[
  65. 'Development Status :: 4 - Beta',
  66. 'Environment :: Web Environment',
  67. 'Intended Audience :: Developers',
  68. 'Intended Audience :: End Users/Desktop',
  69. 'License :: OSI Approved :: BSD License',
  70. 'Operating System :: OS Independent',
  71. 'Programming Language :: Python',
  72. 'Programming Language :: Python :: 3',
  73. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  74. 'Topic :: Software Development :: Libraries :: Python Modules'
  75. ],
  76. cmdclass={'test': PyTestCommand}
  77. )