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

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