|
1 |
| -.PHONY: clean clean-test clean-pyc clean-build docs help |
2 |
| -.DEFAULT_GOAL := help |
| 1 | +.PHONY: clean |
| 2 | +clean: clean-build clean-pyc |
3 | 3 |
|
4 |
| -define BROWSER_PYSCRIPT |
5 |
| -import os, webbrowser, sys |
6 |
| - |
7 |
| -from urllib.request import pathname2url |
8 |
| - |
9 |
| -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) |
10 |
| -endef |
11 |
| -export BROWSER_PYSCRIPT |
12 |
| - |
13 |
| -define PRINT_HELP_PYSCRIPT |
14 |
| -import re, sys |
15 |
| - |
16 |
| -for line in sys.stdin: |
17 |
| - match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) |
18 |
| - if match: |
19 |
| - target, help = match.groups() |
20 |
| - print("%-20s %s" % (target, help)) |
21 |
| -endef |
22 |
| -export PRINT_HELP_PYSCRIPT |
23 |
| - |
24 |
| -BROWSER := python -c "$$BROWSER_PYSCRIPT" |
25 |
| - |
26 |
| -help: |
27 |
| - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) |
28 |
| - |
29 |
| -clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts |
30 |
| - |
31 |
| -clean-build: ## remove build artifacts |
| 4 | +.PHONY: clean-build |
| 5 | +clean-build: |
32 | 6 | rm -fr build/
|
33 | 7 | rm -fr dist/
|
34 |
| - rm -fr .eggs/ |
35 |
| - find . -name '*.egg-info' -exec rm -fr {} + |
36 |
| - find . -name '*.egg' -exec rm -f {} + |
| 8 | + rm -fr *.egg-info |
37 | 9 |
|
38 |
| -clean-pyc: ## remove Python file artifacts |
| 10 | +.PHONY: clean-pyc |
| 11 | +clean-pyc: |
39 | 12 | find . -name '*.pyc' -exec rm -f {} +
|
40 | 13 | find . -name '*.pyo' -exec rm -f {} +
|
41 | 14 | find . -name '*~' -exec rm -f {} +
|
42 |
| - find . -name '__pycache__' -exec rm -fr {} + |
43 | 15 |
|
44 |
| -clean-test: ## remove test and coverage artifacts |
45 |
| - rm -fr .tox/ |
46 |
| - rm -f .coverage |
47 |
| - rm -fr htmlcov/ |
48 |
| - rm -fr .pytest_cache |
| 16 | +.PHONY: lint |
| 17 | +lint: |
| 18 | + tox -e lint |
49 | 19 |
|
50 |
| -lint: ## check style with flake8 |
51 |
| - flake8 rest_framework_simplejwt_mongoengine tests |
| 20 | +.PHONY: lint-roll |
| 21 | +lint-roll: |
| 22 | + isort rest_framework_simplejwt_mongoengine tests |
| 23 | + $(MAKE) lint |
52 | 24 |
|
53 |
| -test: ## run tests quickly with the default Python |
54 |
| - pytest |
| 25 | +.PHONY: tests |
| 26 | +test: |
| 27 | + pytest tests |
55 | 28 |
|
56 |
| -test-all: ## run tests on every Python version with tox |
| 29 | +.PHONY: test-all |
| 30 | +test-all: |
57 | 31 | tox
|
58 | 32 |
|
59 |
| -coverage: ## check code coverage quickly with the default Python |
60 |
| - coverage run --source rest_framework_simplejwt_mongoengine -m pytest |
61 |
| - coverage report -m |
62 |
| - coverage html |
63 |
| - $(BROWSER) htmlcov/index.html |
64 |
| - |
65 |
| -docs: ## generate Sphinx HTML documentation, including API docs |
66 |
| - rm -f docs/rest_framework_simplejwt_mongoengine.rst |
67 |
| - rm -f docs/modules.rst |
68 |
| - sphinx-apidoc -o docs/ rest_framework_simplejwt_mongoengine |
| 33 | +.PHONY: build-docs |
| 34 | +build-docs: |
| 35 | + sphinx-apidoc -o docs/ . \ |
| 36 | + setup.py \ |
| 37 | + *confest* \ |
| 38 | + tests/* \ |
| 39 | + rest_framework_simplejwt_mongoengine/token_blacklist/* \ |
| 40 | + rest_framework_simplejwt_mongoengine/backends.py \ |
| 41 | + rest_framework_simplejwt_mongoengine/exceptions.py \ |
| 42 | + rest_framework_simplejwt_mongoengine/settings.py \ |
| 43 | + rest_framework_simplejwt_mongoengine/state.py |
69 | 44 | $(MAKE) -C docs clean
|
70 | 45 | $(MAKE) -C docs html
|
71 |
| - $(BROWSER) docs/_build/html/index.html |
| 46 | + $(MAKE) -C docs doctest |
72 | 47 |
|
73 |
| -servedocs: docs ## compile the docs watching for changes |
74 |
| - watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . |
| 48 | +.PHONY: docs |
| 49 | +docs: build-docs |
| 50 | + open docs/_build/html/index.html |
75 | 51 |
|
76 |
| -release: dist ## package and upload a release |
| 52 | +.PHONY: linux-docs |
| 53 | +linux-docs: build-docs |
| 54 | + xdg-open docs/_build/html/index.html |
| 55 | + |
| 56 | +.PHONY: pushversion |
| 57 | +pushversion: |
| 58 | + git push upstream && git push upstream --tags |
| 59 | + |
| 60 | +.PHONY: publish |
| 61 | +publish: |
| 62 | + python setup.py sdist bdist_wheel |
77 | 63 | twine upload dist/*
|
78 | 64 |
|
79 |
| -dist: clean ## builds source and wheel package |
80 |
| - python setup.py sdist |
81 |
| - python setup.py bdist_wheel |
| 65 | +.PHONY: dist |
| 66 | +dist: clean |
| 67 | + python setup.py sdist bdist_wheel |
82 | 68 | ls -l dist
|
83 |
| - |
84 |
| -install: clean ## install the package to the active Python's site-packages |
85 |
| - python setup.py install |
0 commit comments