Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. .PHONY: all
  2. all: tests
  3.  
  4. .PHONY: tests
  5. tests: py_env
  6. bash -c 'source py_env/bin/activate && py.test tests'
  7.  
  8. py_env: requirements_dev.txt setup.py
  9. rm -rf py_env
  10. virtualenv py_env
  11. bash -c 'source py_env/bin/activate && pip install -r requirements_dev.txt'
  12.  
  13. # Makefile
  14. .PHONY: all
  15. all: tests
  16.  
  17. .PHONY: tests
  18. tests:
  19. tox
  20.  
  21. # tox.ini
  22. [tox]
  23. project = my_project
  24. envlist = py26,py27
  25.  
  26. [testenv]
  27. install_command = pip install --use-wheel {opts} {packages}
  28. deps = -rrequirements_dev.txt
  29. commands =
  30. py.test {posargs:tests}
  31.  
  32. REBUILD_FLAG =
  33.  
  34. .PHONY: all
  35. all: tests
  36.  
  37. .PHONY: tests
  38. tests: .venv.touch
  39. tox $(REBUILD_FLAG)
  40.  
  41. .venv.touch: setup.py requirements.txt requirements_dev.txt
  42. $(eval REBUILD_FLAG := --recreate)
  43. touch .venv.touch
  44.  
  45. $ make tests
  46. touch .venv.touch
  47. tox --recreate
  48. [[ SNIP ]]
  49. $ make tests
  50. tox
  51. [[ SNIP ]]
  52. $ touch requirements.txt
  53. $ make tests
  54. touch .venv.touch
  55. tox --recreate
  56. [[ SNIP ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement