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.

Makefile 2.5KB

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