Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

setup.py 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 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>=3.2,<4.3',
  17. # PIL is required for image fields, Pillow is the "friendly" PIL fork
  18. 'pillow>=6.0',
  19. # We use the ModelFormSetView from django-extra-views for the basket page
  20. 'django-extra-views>=0.13,<0.15',
  21. # Search support
  22. 'django-haystack>=3.0b1',
  23. # Treebeard is used for categories
  24. 'django-treebeard>=4.3.0',
  25. # Babel is used for currency formatting
  26. 'Babel>=1.0,<3.0',
  27. # For manipulating search URLs
  28. 'purl>=0.7',
  29. # For phone number field
  30. 'phonenumbers',
  31. 'django-phonenumber-field>=4.0.0,<7.0.0',
  32. # Used for oscar.test.factories
  33. 'factory-boy>=3.0,<3.3',
  34. # Used for automatically building larger HTML tables
  35. 'django-tables2>=2.3,<2.4',
  36. # Used for manipulating form field attributes in templates (eg: add
  37. # a css class)
  38. 'django-widget-tweaks>=1.4.1',
  39. ]
  40. sorl_thumbnail_version = 'sorl-thumbnail>=12.9,<12.10'
  41. easy_thumbnails_version = 'easy-thumbnails>=2.7,<2.8.6'
  42. docs_requires = [
  43. 'Sphinx>=5.0',
  44. 'sphinxcontrib-spelling==7.5.1',
  45. 'sphinx_rtd_theme==1.0.0',
  46. 'sphinx-issues==3.0.1',
  47. sorl_thumbnail_version,
  48. easy_thumbnails_version,
  49. ]
  50. test_requires = [
  51. 'WebTest>=2.0,<2.1',
  52. 'coverage>=5.4,<5.5',
  53. 'django-webtest>=1.9,<1.10',
  54. 'psycopg2-binary>=2.8,<2.10',
  55. 'pytest-django>=3.7,<3.9',
  56. 'pytest-xdist>=2.2,<3',
  57. 'tox>=3.21,<4',
  58. 'freezegun>=1.1,<2',
  59. 'pytz',
  60. sorl_thumbnail_version,
  61. easy_thumbnails_version,
  62. ]
  63. with open(os.path.join(PROJECT_DIR, 'README.rst'), encoding="utf-8") as fh:
  64. long_description = re.sub(
  65. '^.. start-no-pypi.*^.. end-no-pypi', '', fh.read(), flags=re.M | re.S)
  66. setup(
  67. name='django-oscar',
  68. version=get_version(),
  69. url='https://github.com/django-oscar/django-oscar',
  70. author="David Winterbottom",
  71. author_email="david.winterbottom@gmail.com",
  72. description="A domain-driven e-commerce framework for Django",
  73. long_description=long_description,
  74. keywords="E-commerce, Django, domain-driven",
  75. license='BSD',
  76. platforms=['linux'],
  77. include_package_data=True,
  78. python_requires='>=3.8',
  79. install_requires=install_requires,
  80. extras_require={
  81. 'docs': docs_requires,
  82. 'test': test_requires,
  83. 'sorl-thumbnail': [sorl_thumbnail_version],
  84. 'easy-thumbnails': [easy_thumbnails_version],
  85. },
  86. classifiers=[
  87. 'Development Status :: 5 - Production/Stable',
  88. 'Environment :: Web Environment',
  89. 'Framework :: Django',
  90. 'Framework :: Django :: 3.2',
  91. 'Framework :: Django :: 4.0',
  92. 'Framework :: Django :: 4.1',
  93. 'Framework :: Django :: 4.2',
  94. 'Intended Audience :: Developers',
  95. 'License :: OSI Approved :: BSD License',
  96. 'Operating System :: Unix',
  97. 'Programming Language :: Python',
  98. 'Programming Language :: Python :: 3',
  99. 'Programming Language :: Python :: 3.8',
  100. 'Programming Language :: Python :: 3.9',
  101. 'Programming Language :: Python :: 3.10',
  102. 'Programming Language :: Python :: 3.11',
  103. 'Topic :: Software Development :: Libraries :: Application Frameworks']
  104. )
  105. # Show contributing instructions if being installed in 'develop' mode
  106. if len(sys.argv) > 1 and sys.argv[1] == 'develop':
  107. docs_url = 'https://django-oscar.readthedocs.io/en/latest/internals/contributing/index.html'
  108. mailing_list = 'django-oscar@googlegroups.com'
  109. mailing_list_url = 'https://groups.google.com/forum/?fromgroups#!forum/django-oscar'
  110. twitter_url = 'https://twitter.com/django_oscar'
  111. msg = (
  112. "You're installing Oscar in 'develop' mode so I presume you're thinking\n"
  113. "of contributing:\n\n"
  114. "(a) That's brilliant - thank you for your time\n"
  115. "(b) If you have any questions, please use the mailing list:\n %s\n"
  116. " %s\n"
  117. "(c) There are more detailed contributing guidelines that you should "
  118. "have a look at:\n %s\n"
  119. "(d) Consider following @django_oscar on Twitter to stay up-to-date\n"
  120. " %s\n\nHappy hacking!") % (mailing_list, mailing_list_url,
  121. docs_url, twitter_url)
  122. line = '=' * 82
  123. print(("\n%s\n%s\n%s" % (line, msg, line)))