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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # These targets are not files
  2. .PHONY: install sandbox docs coverage lint messages compiledmessages css clean 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. test:
  30. py.test
  31. coverage:
  32. py.test --cov=oscar --cov-report=term-missing
  33. lint:
  34. flake8 src/oscar/
  35. isort -q --recursive --diff src/
  36. testmigrations:
  37. pip install -r requirements_migrations.txt
  38. cd sites/sandbox && ./test_migrations.sh
  39. messages:
  40. # Create the .po files used for i18n
  41. cd src/oscar; django-admin.py makemessages -a
  42. compiledmessages:
  43. # Compile the gettext files
  44. cd src/oscar; django-admin.py compilemessages
  45. css:
  46. npm install
  47. npm run build
  48. clean:
  49. # Remove files not in source control
  50. find . -type f -name "*.pyc" -delete
  51. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  52. todo:
  53. # Look for areas of the code that need updating when some event has taken place (like
  54. # Oscar dropping support for a Django version)
  55. -grep -rnH TODO *.txt
  56. -grep -rnH TODO src/oscar/apps/
  57. -grep -rnH "django.VERSION" src/oscar/apps
  58. release: clean
  59. pip install twine wheel
  60. rm -rf dist/*
  61. python setup.py sdist bdist_wheel
  62. twine upload -s dist/*