Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Makefile 2.5 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  1. .PHONY: clean clean-test clean-pyc clean-build docs help
  2. .DEFAULT_GOAL := help
  3. define BROWSER_PYSCRIPT
  4. import os, webbrowser, sys
  5. try:
  6. from urllib import pathname2url
  7. except:
  8. from urllib.request import pathname2url
  9. webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
  10. endef
  11. export BROWSER_PYSCRIPT
  12. define PRINT_HELP_PYSCRIPT
  13. import re, sys
  14. for line in sys.stdin:
  15. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  16. if match:
  17. target, help = match.groups()
  18. print("%-20s %s" % (target, help))
  19. endef
  20. export PRINT_HELP_PYSCRIPT
  21. BROWSER := python -c "$$BROWSER_PYSCRIPT"
  22. ifeq ($(strip $(shell git status --untracked-files=no --porcelain 2>/dev/null)),)
  23. GIT_TREE_STATE=clean
  24. else
  25. GIT_TREE_STATE=dirty
  26. endif
  27. help:
  28. @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
  29. clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
  30. clean-build: ## remove build artifacts
  31. rm -fr build/
  32. rm -fr dist/
  33. rm -fr .eggs/
  34. find . -name '*.egg-info' -exec rm -fr {} +
  35. find . -name '*.egg' -exec rm -f {} +
  36. clean-pyc: ## remove Python file artifacts
  37. find . -name '*.pyc' -exec rm -f {} +
  38. find . -name '*.pyo' -exec rm -f {} +
  39. find . -name '*~' -exec rm -f {} +
  40. find . -name '__pycache__' -exec rm -fr {} +
  41. clean-test: ## remove test and coverage artifacts
  42. rm -fr .tox/
  43. rm -f .coverage
  44. rm -fr htmlcov/
  45. lint: ## check style with flake8
  46. flake8 wandb tests
  47. test: ## run tests quickly with the default Python
  48. py.test
  49. test-all: ## run tests on every Python version with tox
  50. CIRCLE_TEST_REPORTS=/tmp tox
  51. coverage: ## check code coverage quickly with the default Python
  52. coverage run --source wandb -m pytest
  53. coverage report -m
  54. coverage html
  55. $(BROWSER) htmlcov/index.html
  56. docs: ## generate Sphinx HTML documentation, including API docs
  57. rm -f docs/wandb.rst
  58. rm -f docs/modules.rst
  59. sphinx-apidoc -o docs/ wandb
  60. $(MAKE) -C docs clean
  61. $(MAKE) -C docs html
  62. $(BROWSER) docs/_build/html/index.html
  63. servedocs: docs ## compile the docs watching for changes
  64. watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
  65. gitdirty:
  66. ifeq ($(GIT_TREE_STATE),dirty)
  67. $(error un-committed changes, commit before continuing)
  68. endif
  69. release: dist ## package and upload a release
  70. git push
  71. twine upload dist/*
  72. release-test: dist ## package and upload test release
  73. twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  74. dist: clean ## builds source and wheel package
  75. python setup.py sdist bdist_wheel
  76. ls -l dist
  77. install: clean ## install the package to the active Python's site-packages
  78. python setup.py install
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...