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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # These targets are not files
  2. .PHONY: install sandbox docs coverage lint travis messages compiledmessages css clean preflight sandbox_image
  3. install:
  4. pip install -r requirements.txt
  5. pip install -e .[test]
  6. build_sandbox:
  7. # Remove media
  8. -rm -rf sites/sandbox/public/media/images
  9. -rm -rf sites/sandbox/public/media/cache
  10. -rm -rf sites/sandbox/public/static
  11. -rm -f sites/sandbox/db.sqlite
  12. # Create database
  13. sites/sandbox/manage.py migrate
  14. # Import some fixtures. Order is important as JSON fixtures include primary keys
  15. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
  16. sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
  17. sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
  18. sites/sandbox/manage.py oscar_populate_countries --initial-only
  19. sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
  20. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/orders.json
  21. sites/sandbox/manage.py clear_index --noinput
  22. sites/sandbox/manage.py update_index catalogue
  23. sites/sandbox/manage.py thumbnail cleanup
  24. sandbox: install build_sandbox
  25. sandbox_image:
  26. docker build -t django-oscar-sandbox:latest .
  27. docs:
  28. cd docs && make html
  29. coverage:
  30. py.test --cov=oscar --cov-report=term-missing
  31. lint:
  32. flake8 src/oscar/
  33. isort -q --recursive --diff src/
  34. testmigrations:
  35. pip install -r requirements_migrations.txt
  36. cd sites/sandbox && ./test_migrations.sh
  37. # This target is run on Travis.ci. We lint, test and build the sandbox
  38. # site as well as testing migrations apply correctly. We don't call 'install'
  39. # first as that is run as a separate part of the Travis build process.
  40. travis: install coverage lint build_sandbox testmigrations
  41. messages:
  42. # Create the .po files used for i18n
  43. cd src/oscar; django-admin.py makemessages -a
  44. compiledmessages:
  45. # Compile the gettext files
  46. cd src/oscar; django-admin.py compilemessages
  47. css:
  48. npm install
  49. npm run build
  50. clean:
  51. # Remove files not in source control
  52. find . -type f -name "*.pyc" -delete
  53. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  54. preflight: lint
  55. # Bare minimum of tests to run before pushing to master
  56. ./runtests.py
  57. todo:
  58. # Look for areas of the code that need updating when some event has taken place (like
  59. # Oscar dropping support for a Django version)
  60. -grep -rnH TODO *.txt
  61. -grep -rnH TODO src/oscar/apps/
  62. -grep -rnH "django.VERSION" src/oscar/apps
  63. release: clean
  64. pip install twine wheel
  65. rm -rf dist/*
  66. python setup.py sdist bdist_wheel
  67. twine upload -s dist/*