setup.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. """
  2. Based on Django REST Framework's ``setup.py``.
  3. """
  4. import os
  5. from setuptools import setup
  6. from rest_framework_bulk import __version__, __author__
  7. def get_packages(package):
  8. """
  9. Return root package and all sub-packages.
  10. """
  11. return [dirpath
  12. for dirpath, dirnames, filenames in os.walk(package)
  13. if os.path.exists(os.path.join(dirpath, '__init__.py'))]
  14. def get_package_data(package):
  15. """
  16. Return all files under the root package, that are not in a
  17. package themselves.
  18. """
  19. walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
  20. for dirpath, dirnames, filenames in os.walk(package)
  21. if not os.path.exists(os.path.join(dirpath, '__init__.py'))]
  22. filepaths = []
  23. for base, filenames in walk:
  24. filepaths.extend([os.path.join(base, filename)
  25. for filename in filenames])
  26. return {package: filepaths}
  27. def read(fname):
  28. return open(os.path.join(os.path.dirname(__file__), fname)).read()
  29. setup(
  30. name='djangorestframework-bulk',
  31. version=__version__,
  32. author=__author__,
  33. author_email='miroslav@miki725.com',
  34. description='Django REST Framework bulk CRUD view mixins',
  35. long_description=read('README.rst') + read('LICENSE.rst'),
  36. url='https://github.com/miki725/django-rest-framework-bulk',
  37. license='MIT',
  38. keywords='django',
  39. packages=get_packages('rest_framework_bulk'),
  40. data_files=get_package_data('rest_framework_bulk'),
  41. install_requires=[
  42. 'django',
  43. 'djangorestframework',
  44. ],
  45. classifiers=[
  46. 'Development Status :: 3 - Alpha',
  47. 'Framework :: Django',
  48. 'Intended Audience :: Developers',
  49. 'Operating System :: OS Independent',
  50. 'Programming Language :: Python',
  51. 'Programming Language :: Python :: 3',
  52. 'Topic :: Utilities',
  53. 'Topic :: Internet :: WWW/HTTP',
  54. 'License :: OSI Approved :: MIT License',
  55. ],
  56. )