Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. VENV = venv
  2. PYTEST = $(PWD)/$(VENV)/bin/py.test
  3. # These targets are not files
  4. .PHONY: install sandbox docs coverage lint messages compiledmessages css clean sandbox_image
  5. install:
  6. pip install -r requirements.txt
  7. pip install -e .[test]
  8. build_sandbox: sandbox_clean sandbox_load_user sandbox_load_data
  9. sandbox_clean:
  10. # Remove media
  11. -rm -rf sandbox/public/media/images
  12. -rm -rf sandbox/public/media/cache
  13. -rm -rf sandbox/public/static
  14. -rm -f sandbox/db.sqlite
  15. # Create database
  16. sandbox/manage.py migrate
  17. sandbox_load_user:
  18. sandbox/manage.py loaddata sandbox/fixtures/auth.json
  19. sandbox_load_data:
  20. # Import some fixtures. Order is important as JSON fixtures include primary keys
  21. sandbox/manage.py loaddata sandbox/fixtures/child_products.json
  22. sandbox/manage.py oscar_import_catalogue sandbox/fixtures/*.csv
  23. sandbox/manage.py oscar_import_catalogue_images sandbox/fixtures/images.tar.gz
  24. sandbox/manage.py oscar_populate_countries --initial-only
  25. sandbox/manage.py loaddata sandbox/fixtures/pages.json sandbox/fixtures/ranges.json sandbox/fixtures/offers.json
  26. sandbox/manage.py loaddata sandbox/fixtures/orders.json sandbox/fixtures/promotions.json
  27. sandbox/manage.py clear_index --noinput
  28. sandbox/manage.py update_index catalogue
  29. sandbox/manage.py thumbnail cleanup
  30. sandbox/manage.py collectstatic --noinput
  31. sandbox: install build_sandbox
  32. sandbox_image:
  33. docker build -t django-oscar-sandbox:latest .
  34. venv:
  35. virtualenv --python=$(shell which python3) $(VENV)
  36. $(VENV)/bin/pip install -e .[test]
  37. $(VENV)/bin/pip install -r docs/requirements.txt
  38. docs: venv
  39. make -C docs html SPHINXBUILD=$(PWD)/$(VENV)/bin/sphinx-build
  40. test: venv
  41. $(PYTEST)
  42. retest: venv
  43. $(PYTEST) --lf
  44. coverage: venv
  45. $(PYTEST) --cov=oscar --cov-report=term-missing
  46. lint:
  47. flake8 src/oscar/
  48. flake8 tests/
  49. isort -q --recursive --diff src/
  50. isort -q --recursive --diff tests/
  51. testmigrations:
  52. pip install -r requirements_migrations.txt
  53. cd sandbox && ./test_migrations.sh
  54. messages:
  55. # Create the .po files used for i18n
  56. cd src/oscar; django-admin.py makemessages -a
  57. compiledmessages:
  58. # Compile the gettext files
  59. cd src/oscar; django-admin.py compilemessages
  60. css:
  61. npm install
  62. npm run build
  63. clean:
  64. # Remove files not in source control
  65. find . -type f -name "*.pyc" -delete
  66. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  67. todo:
  68. # Look for areas of the code that need updating when some event has taken place (like
  69. # Oscar dropping support for a Django version)
  70. -grep -rnH TODO *.txt
  71. -grep -rnH TODO src/oscar/apps/
  72. -grep -rnH "django.VERSION" src/oscar/apps
  73. release: clean
  74. pip install twine wheel
  75. rm -rf dist/*
  76. python setup.py sdist bdist_wheel
  77. twine upload -s dist/*