You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup.py 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #!/usr/bin/env python
  2. """
  3. Installation script:
  4. To release a new version to PyPi:
  5. - Ensure the version is correctly set in oscar.__init__.py
  6. - Run: make release
  7. """
  8. import os
  9. import re
  10. import sys
  11. from setuptools import find_packages, setup
  12. PROJECT_DIR = os.path.dirname(__file__)
  13. sys.path.append(os.path.join(PROJECT_DIR, 'src'))
  14. from oscar import get_version # noqa isort:skip
  15. install_requires = [
  16. 'django>=1.11,<2.1',
  17. # PIL is required for image fields, Pillow is the "friendly" PIL fork
  18. 'pillow>=4.0',
  19. # We use the ModelFormSetView from django-extra-views for the basket page
  20. 'django-extra-views>=0.11,<0.12',
  21. # Search support
  22. 'django-haystack>=2.5.0,<3.0.0',
  23. # Treebeard is used for categories
  24. 'django-treebeard>=4.3.0',
  25. # Sorl is used as the default thumbnailer
  26. 'sorl-thumbnail>=12.4.1,<12.5',
  27. # Babel is used for currency formatting
  28. 'Babel>=1.0,<3.0',
  29. # For converting non-ASCII to ASCII when creating slugs
  30. 'Unidecode>=1.0,<1.1',
  31. # For manipulating search URLs
  32. 'purl>=0.7',
  33. # For phone number field
  34. 'phonenumbers',
  35. 'django-phonenumber-field>=2.0,<2.1',
  36. # Used for oscar.test.newfactories
  37. 'factory-boy>=2.4.1,<3.0',
  38. # Used for automatically building larger HTML tables
  39. 'django-tables2>=1.19,<2.0',
  40. # Used for manipulating form field attributes in templates (eg: add
  41. # a css class)
  42. 'django-widget-tweaks>=1.4.1',
  43. ]
  44. docs_requires = [
  45. 'Sphinx==1.7.2',
  46. 'sphinxcontrib-napoleon==0.6.1',
  47. 'sphinx_rtd_theme==0.3.0',
  48. 'sphinx-issues==0.4.0',
  49. ]
  50. test_requires = [
  51. 'WebTest>=2.0,<2.1',
  52. 'coverage>=4.5,<4.6',
  53. 'django-webtest==1.9.2',
  54. 'py>=1.4.31',
  55. 'psycopg2>=2.7,<2.8',
  56. 'pytest>=3.5,<3.6',
  57. 'pytest-cov==2.5.1',
  58. 'pytest-django==3.1.2',
  59. 'pytest-xdist>=1.22<1.23',
  60. 'tox>=3.0,<3.1',
  61. ]
  62. with open(os.path.join(PROJECT_DIR, 'README.rst')) as fh:
  63. long_description = re.sub(
  64. '^.. start-no-pypi.*^.. end-no-pypi', '', fh.read(), flags=re.M | re.S)
  65. setup(
  66. name='django-oscar',
  67. version=get_version().replace(' ', '-'),
  68. url='https://github.com/django-oscar/django-oscar',
  69. author="David Winterbottom",
  70. author_email="david.winterbottom@gmail.com",
  71. description="A domain-driven e-commerce framework for Django",
  72. long_description=long_description,
  73. keywords="E-commerce, Django, domain-driven",
  74. license='BSD',
  75. platforms=['linux'],
  76. package_dir={'': 'src'},
  77. packages=find_packages('src'),
  78. include_package_data=True,
  79. install_requires=install_requires,
  80. extras_require={
  81. 'docs': docs_requires,
  82. 'test': test_requires,
  83. },
  84. classifiers=[
  85. 'Development Status :: 5 - Production/Stable',
  86. 'Environment :: Web Environment',
  87. 'Framework :: Django',
  88. 'Framework :: Django :: 1.11',
  89. 'Framework :: Django :: 2.0',
  90. 'Intended Audience :: Developers',
  91. 'License :: OSI Approved :: BSD License',
  92. 'Operating System :: Unix',
  93. 'Programming Language :: Python',
  94. 'Programming Language :: Python :: 3',
  95. 'Programming Language :: Python :: 3.4',
  96. 'Programming Language :: Python :: 3.5',
  97. 'Programming Language :: Python :: 3.6',
  98. 'Topic :: Software Development :: Libraries :: Application Frameworks']
  99. )
  100. # Show contributing instructions if being installed in 'develop' mode
  101. if len(sys.argv) > 1 and sys.argv[1] == 'develop':
  102. docs_url = 'https://django-oscar.readthedocs.io/en/latest/internals/contributing/index.html'
  103. mailing_list = 'django-oscar@googlegroups.com'
  104. mailing_list_url = 'https://groups.google.com/forum/?fromgroups#!forum/django-oscar'
  105. twitter_url = 'https://twitter.com/django_oscar'
  106. msg = (
  107. "You're installing Oscar in 'develop' mode so I presume you're thinking\n"
  108. "of contributing:\n\n"
  109. "(a) That's brilliant - thank you for your time\n"
  110. "(b) If you have any questions, please use the mailing list:\n %s\n"
  111. " %s\n"
  112. "(c) There are more detailed contributing guidelines that you should "
  113. "have a look at:\n %s\n"
  114. "(d) Consider following @django_oscar on Twitter to stay up-to-date\n"
  115. " %s\n\nHappy hacking!") % (mailing_list, mailing_list_url,
  116. docs_url, twitter_url)
  117. line = '=' * 82
  118. print(("\n%s\n%s\n%s" % (line, msg, line)))