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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 sandbox/public/media/images
  9. -rm -rf sandbox/public/media/cache
  10. -rm -rf sandbox/public/static
  11. -rm -f sandbox/db.sqlite
  12. # Create database
  13. sandbox/manage.py migrate
  14. # Import some fixtures. Order is important as JSON fixtures include primary keys
  15. sandbox/manage.py loaddata sandbox/fixtures/child_products.json
  16. sandbox/manage.py oscar_import_catalogue sandbox/fixtures/*.csv
  17. sandbox/manage.py oscar_import_catalogue_images sandbox/fixtures/images.tar.gz
  18. sandbox/manage.py oscar_populate_countries --initial-only
  19. sandbox/manage.py loaddata sandbox/fixtures/pages.json sandbox/fixtures/auth.json sandbox/fixtures/ranges.json sandbox/fixtures/offers.json
  20. sandbox/manage.py loaddata sandbox/fixtures/orders.json sandbox/fixtures/promotions.json
  21. sandbox/manage.py clear_index --noinput
  22. sandbox/manage.py update_index catalogue
  23. sandbox/manage.py thumbnail cleanup
  24. sandbox/manage.py collectstatic --noinput
  25. sandbox: install build_sandbox
  26. sandbox_image:
  27. docker build -t django-oscar-sandbox:latest .
  28. docs:
  29. cd docs && make html
  30. test:
  31. py.test
  32. retest:
  33. py.test --lf
  34. coverage:
  35. py.test --cov=oscar --cov-report=term-missing
  36. lint:
  37. flake8 src/oscar/
  38. flake8 tests/
  39. isort -q --recursive --diff src/
  40. isort -q --recursive --diff tests/
  41. testmigrations:
  42. pip install -r requirements_migrations.txt
  43. cd sandbox && ./test_migrations.sh
  44. messages:
  45. # Create the .po files used for i18n
  46. cd src/oscar; django-admin.py makemessages -a
  47. compiledmessages:
  48. # Compile the gettext files
  49. cd src/oscar; django-admin.py compilemessages
  50. css:
  51. npm install
  52. npm run build
  53. clean:
  54. # Remove files not in source control
  55. find . -type f -name "*.pyc" -delete
  56. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  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/*