github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/integration/airflow/Makefile (about)

     1  .PHONY: clean clean-build clean-pyc clean-test coverage dist docs help install lint lint/flake8 lint/black
     2  .DEFAULT_GOAL := help
     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
    32  	rm -fr build/
    33  	rm -fr dist/
    34  	rm -fr .eggs/
    35  	find . -name '*.egg-info' -exec rm -fr {} +
    36  	find . -name '*.egg' -exec rm -f {} +
    37  
    38  clean-pyc: ## remove Python file artifacts
    39  	find . -name '*.pyc' -exec rm -f {} +
    40  	find . -name '*.pyo' -exec rm -f {} +
    41  	find . -name '*~' -exec rm -f {} +
    42  	find . -name '__pycache__' -exec rm -fr {} +
    43  
    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
    49  
    50  lint/flake8: ## check style with flake8
    51  	flake8 bacalhau_airflow tests
    52  lint/black: ## check style with black
    53  	black --check bacalhau_airflow tests
    54  
    55  lint: lint/flake8 lint/black ## check style
    56  
    57  test: ## run tests quickly with the default Python
    58  	python setup.py test
    59  
    60  test-all: ## run tests on every Python version with tox
    61  	tox
    62  
    63  coverage: ## check code coverage quickly with the default Python
    64  	coverage run --source bacalhau-airflow setup.py test
    65  	coverage report -m
    66  	coverage html
    67  	$(BROWSER) htmlcov/index.html
    68  
    69  docs: ## generate Sphinx HTML documentation, including API docs
    70  	rm -f docs/bacalhau-airflow.rst
    71  	rm -f docs/modules.rst
    72  	sphinx-apidoc -o docs/ bacalhau_airflow
    73  	$(MAKE) -C docs clean
    74  	$(MAKE) -C docs html
    75  	$(BROWSER) docs/_build/html/index.html
    76  
    77  servedocs: docs ## compile the docs watching for changes
    78  	watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
    79  
    80  release: dist ## package and upload a release
    81  	twine upload dist/*
    82  
    83  dist: clean ## builds source and wheel package
    84  	python setup.py sdist
    85  	python setup.py bdist_wheel
    86  	ls -l dist
    87  
    88  install: clean ## install the package to the active Python's site-packages
    89  	python setup.py install