Makefile¶
Last source¶
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | PROJECT_NAME := $(shell python setup.py --name)
PROJECT_VERSION := $(shell python setup.py --version)
BOLD := \033[1m
RESET := \033[0m
default: help
.PHONY : help
help: ## Show this help
@echo "$(BOLD)Isshub Makefile$(RESET)"
@echo "Please use 'make $(BOLD)target$(RESET)' where $(BOLD)target$(RESET) is one of:"
@grep -h ':\s\+##' Makefile | column -tn -s# | awk -F ":" '{ print " $(BOLD)" $$1 "$(RESET)" $$2 }'
.PHONY: install
install: ## Install the project in the current environment, with its dependencies
@echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION)$(RESET)"
@pip install .
.PHONY: dev
dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
@echo "$(BOLD)Installing (or upgrading) $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode (with all dependencies)$(RESET)"
@pip install --upgrade pip setuptools
@pip install --upgrade -e .[dev,tests,lint,docs]
@$(MAKE) full-clean
.PHONY: dist
dist: ## Build the package
dist: clean
@echo "$(BOLD)Building package$(RESET)"
@python setup.py sdist bdist_wheel
.PHONY: clean
clean: ## Clean python build related directories and files
@echo "$(BOLD)Cleaning$(RESET)"
@rm -rf build dist $(PROJECT_NAME).egg-info
.PHONY: full-clean
full-clean: ## Like "clean" but with clean-doc and will clean some other generated directories or files
full-clean: clean
@echo "$(BOLD)Full cleaning$(RESET)"
find ./ -type d \( -name '__pycache__' -or -name '.pytest_cache' -or -name '.mypy_cache' \) -print0 | xargs -tr0 rm -r
-$(MAKE) clean-doc
.PHONY: doc docs
doc / docs: ## Build the documentation
docs: doc # we allow "doc" and "docs"
doc: clean-doc
@echo "$(BOLD)Building documentation$(RESET)"
@cd docs && $(MAKE) html
.PHONY: doc-strict docs-strict
doc-strict / docs-strict: ## Build the documentation but fail if a warning
docs-strict: doc-strict # we allow "doc-strict" and "docs-strict"
doc-strict: clean-doc
@echo "$(BOLD)Building documentation (strict)$(RESET)"
@cd docs && sphinx-build -W -b html . _build
.PHONY: clean-doc clean-docs
clean-doc / clean-docs: ## Clean the documentation directories
clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
clean-doc:
@echo "$(BOLD)Cleaning documentation directories$(RESET)"
@rm -rf docs/source docs/git docs/bdd
@cd docs && $(MAKE) clean
.PHONY: tests test
test / tests: ## Run tests for the isshub project.
test: tests # we allow "test" and "tests"
tests:
@echo "$(BOLD)Running tests$(RESET)"
@## we ignore error 5 from pytest meaning there is no test to run
@pytest || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
.PHONY: tests-nocov
test-nocov / tests-nocov: ## Run tests for the isshub project without coverage.
test-nocov: tests-nocov # we allow "test-nocov" and "tests-nocov"
tests-nocov:
@echo "$(BOLD)Running tests (without coverage)$(RESET)"
@## we ignore error 5 from pytest meaning there is no test to run
@pytest --no-cov || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
.PHONY: lint
lint: ## Run all linters (check-isort, check-black, mypy, flake8, pylint)
lint: check-isort check-black flake8 pylint mypy
.PHONY: check checks
check / checks: ## Run all checkers (lint, tests)
check: checks
checks: lint tests check-commit
.PHONY: mypy
mypy: ## Run the mypy tool
@echo "$(BOLD)Running mypy$(RESET)"
@mypy .
.PHONY: check-isort
check-isort: ## Run the isort tool in check mode only (won't modify files)
@echo "$(BOLD)Checking isort(RESET)"
@isort . --check-only 2>&1
.PHONY: check-black
check-black: ## Run the black tool in check mode only (won't modify files)
@echo "$(BOLD)Checking black$(RESET)"
@black --target-version py38 --check . 2>&1
.PHONY: flake8
flake8: ## Run the flake8 tool
@echo "$(BOLD)Running flake8$(RESET)"
@flake8 --format=abspath
.PHONY: pylint
pylint: ## Run the pylint tool
@echo "$(BOLD)Running pylint$(RESET)"
@pylint isshub
.PHONY: pretty
pretty: ## Run all code beautifiers (isort, black)
pretty: isort black
.PHONY: isort
isort: ## Run the isort tool and update files that need to
@echo "$(BOLD)Running isort$(RESET)"
@isort . --atomic
.PHONY: black
black: ## Run the black tool and update files that need to
@echo "$(BOLD)Running black$(RESET)"
@black --target-version py38 .
.PHONY: check-commit
check-commit: ## Check the validaity of the last commit message
@echo "$(BOLD)Checking last commit message$(RESET)"
@ci/check_commit_message.py -vl
|
Changes¶
docs(bdd): Add BDD scenarios to documentation¶
- Commit
- Hash
- Date
2020-09-27 22:43:49 +0200
- Type
Modified
- Stats
+1 -1
@@ -61,7 +61,7 @@ clean-doc / clean-docs: ## Clean the documentation directories
clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
clean-doc:
@echo "$(BOLD)Cleaning documentation directories$(RESET)"
- @rm -rf docs/source docs/git
+ @rm -rf docs/source docs/git docs/bdd
@cd docs && $(MAKE) clean
.PHONY: tests test
build(make): Remove the dev-upgrade make command (use make dev)¶
- Commit
- Hash
- Date
2020-09-26 14:13:56 +0200
- Type
Modified
- Stats
+3 -9
@@ -19,15 +19,9 @@ install: ## Install the project in the current environment, with its dependenci
.PHONY: dev
dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
- @echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode$(RESET)"
- @pip install -e .[dev,tests,lint,docs]
- @$(MAKE) full-clean
-
-.PHONY: dev-upgrade
-dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
- @pip install --upgrade pip
- @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["tests"] + o["extras_require"]["lint"] + o["extras_require"]["docs"]))'`
- @pip install -e .
+ @echo "$(BOLD)Installing (or upgrading) $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode (with all dependencies)$(RESET)"
+ @pip install --upgrade pip setuptools
+ @pip install --upgrade -e .[dev,tests,lint,docs]
@$(MAKE) full-clean
.PHONY: dist
docs(make): Add missing command to Makefile help¶
- Commit
- Hash
- Date
2020-09-26 13:14:48 +0200
- Type
Modified
- Stats
+13 -7
@@ -49,33 +49,39 @@ full-clean: clean
-$(MAKE) clean-doc
.PHONY: doc docs
+doc / docs: ## Build the documentation
docs: doc # we allow "doc" and "docs"
-doc: clean-doc ## Build the documentation
+doc: clean-doc
@echo "$(BOLD)Building documentation$(RESET)"
@cd docs && $(MAKE) html
.PHONY: doc-strict docs-strict
+doc-strict / docs-strict: ## Build the documentation but fail if a warning
docs-strict: doc-strict # we allow "doc-strict" and "docs-strict"
-doc-strict: clean-doc ## Build the documentation but fail if a warning
+doc-strict: clean-doc
@echo "$(BOLD)Building documentation (strict)$(RESET)"
@cd docs && sphinx-build -W -b html . _build
-.PHONY: clean-docs
+.PHONY: clean-doc clean-docs
+clean-doc / clean-docs: ## Clean the documentation directories
clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
-clean-doc: ## Clean the documentation directories
+clean-doc:
@echo "$(BOLD)Cleaning documentation directories$(RESET)"
@rm -rf docs/source docs/git
@cd docs && $(MAKE) clean
.PHONY: tests test
+test / tests: ## Run tests for the isshub project.
test: tests # we allow "test" and "tests"
-tests: ## Run tests for the isshub project.
+tests:
@echo "$(BOLD)Running tests$(RESET)"
@## we ignore error 5 from pytest meaning there is no test to run
@pytest || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
.PHONY: tests-nocov
-tests-nocov: ## Run tests for the isshub project without coverage.
+test-nocov / tests-nocov: ## Run tests for the isshub project without coverage.
+test-nocov: tests-nocov # we allow "test-nocov" and "tests-nocov"
+tests-nocov:
@echo "$(BOLD)Running tests (without coverage)$(RESET)"
@## we ignore error 5 from pytest meaning there is no test to run
@pytest --no-cov || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
@@ -85,8 +91,8 @@ lint: ## Run all linters (check-isort, check-black, mypy, flake8, pylint)
lint: check-isort check-black flake8 pylint mypy
.PHONY: check checks
+check / checks: ## Run all checkers (lint, tests)
check: checks
-checks: ## Run all checkers (lint, tests)
checks: lint tests check-commit
.PHONY: mypy
chore: Fix breaking changes from updated dependencies¶
- Commit
- Hash
- Date
2020-09-25 22:54:00 +0200
- Type
Modified
- Stats
+2 -2
@@ -97,7 +97,7 @@ mypy: ## Run the mypy tool
.PHONY: check-isort
check-isort: ## Run the isort tool in check mode only (won't modify files)
@echo "$(BOLD)Checking isort(RESET)"
- @isort --check-only 2>&1
+ @isort . --check-only 2>&1
.PHONY: check-black
check-black: ## Run the black tool in check mode only (won't modify files)
@@ -121,7 +121,7 @@ pretty: isort black
.PHONY: isort
isort: ## Run the isort tool and update files that need to
@echo "$(BOLD)Running isort$(RESET)"
- @isort --atomic --apply
+ @isort . --atomic
.PHONY: black
black: ## Run the black tool and update files that need to
ci(docs): Make CI job build_doc fail if a warning occurs¶
- Commit
- Hash
- Date
2019-08-16 00:16:52 +0200
- Type
Modified
- Stats
+6 -0
@@ -54,6 +54,12 @@ doc: clean-doc ## Build the documentation
@echo "$(BOLD)Building documentation$(RESET)"
@cd docs && $(MAKE) html
+.PHONY: doc-strict docs-strict
+docs-strict: doc-strict # we allow "doc-strict" and "docs-strict"
+doc-strict: clean-doc ## Build the documentation but fail if a warning
+ @echo "$(BOLD)Building documentation (strict)$(RESET)"
+ @cd docs && sphinx-build -W -b html . _build
+
.PHONY: clean-docs
clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
clean-doc: ## Clean the documentation directories
chore(make): Upgrade pip in dev-upgrade make command¶
- Commit
- Hash
- Date
2019-08-15 23:26:05 +0200
- Type
Modified
- Stats
+1 -0
@@ -25,6 +25,7 @@ dev: ## Install the project in the current environment, with its dependencies,
.PHONY: dev-upgrade
dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
+ @pip install --upgrade pip
@pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["tests"] + o["extras_require"]["lint"] + o["extras_require"]["docs"]))'`
@pip install -e .
@$(MAKE) full-clean
feat(repository): Add 1st domain context (core) and entity (Repository)¶
- Commit
- Hash
- Date
2019-06-07 21:03:50 +0200
- Type
Modified
- Stats
+7 -0
@@ -31,6 +31,7 @@ dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
.PHONY: dist
dist: ## Build the package
+dist: clean
@echo "$(BOLD)Building package$(RESET)"
@python setup.py sdist bdist_wheel
@@ -66,6 +67,12 @@ tests: ## Run tests for the isshub project.
@## we ignore error 5 from pytest meaning there is no test to run
@pytest || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
+.PHONY: tests-nocov
+tests-nocov: ## Run tests for the isshub project without coverage.
+ @echo "$(BOLD)Running tests (without coverage)$(RESET)"
+ @## we ignore error 5 from pytest meaning there is no test to run
+ @pytest --no-cov || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
+
.PHONY: lint
lint: ## Run all linters (check-isort, check-black, mypy, flake8, pylint)
lint: check-isort check-black flake8 pylint mypy
tests: Remove pure testing tests¶
- Commit
- Hash
- Date
2019-06-03 15:50:46 +0200
- Type
Modified
- Stats
+2 -1
@@ -63,7 +63,8 @@ clean-doc: ## Clean the documentation directories
test: tests # we allow "test" and "tests"
tests: ## Run tests for the isshub project.
@echo "$(BOLD)Running tests$(RESET)"
- @pytest
+ @## we ignore error 5 from pytest meaning there is no test to run
+ @pytest || ( ERR=$$?; if [ $${ERR} -eq 5 ]; then (exit 0); else (exit $${ERR}); fi )
.PHONY: lint
lint: ## Run all linters (check-isort, check-black, mypy, flake8, pylint)
docs(git): Add git commits to documentation¶
- Commit
- Hash
- Date
2019-06-03 13:54:59 +0200
- Type
Modified
- Stats
+1 -1
@@ -56,7 +56,7 @@ doc: clean-doc ## Build the documentation
clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
clean-doc: ## Clean the documentation directories
@echo "$(BOLD)Cleaning documentation directories$(RESET)"
- @rm -rf docs/source
+ @rm -rf docs/source docs/git
@cd docs && $(MAKE) clean
.PHONY: tests test
style(git): Force format of git commit messages¶
- Commit
- Hash
- Date
2019-06-03 13:54:59 +0200
- Type
Modified
- Stats
+6 -1
@@ -72,7 +72,7 @@ lint: check-isort check-black flake8 pylint mypy
.PHONY: check checks
check: checks
checks: ## Run all checkers (lint, tests)
-checks: lint test
+checks: lint tests check-commit
.PHONY: mypy
mypy: ## Run the mypy tool
@@ -112,3 +112,8 @@ isort: ## Run the isort tool and update files that need to
black: ## Run the black tool and update files that need to
@echo "$(BOLD)Running black$(RESET)"
@black --target-version py38 .
+
+.PHONY: check-commit
+check-commit: ## Check the validaity of the last commit message
+ @echo "$(BOLD)Checking last commit message$(RESET)"
+ @ci/check_commit_message.py -vl
style: Add mypy for better code quality¶
- Commit
- Hash
- Date
2019-05-27 17:14:12 +0200
- Type
Modified
- Stats
+8 -3
@@ -43,7 +43,7 @@ clean: ## Clean python build related directories and files
full-clean: ## Like "clean" but with clean-doc and will clean some other generated directories or files
full-clean: clean
@echo "$(BOLD)Full cleaning$(RESET)"
- find ./ -type d \( -name '__pycache__' -or -name '.pytest_cache' \) -print0 | xargs -tr0 rm -r
+ find ./ -type d \( -name '__pycache__' -or -name '.pytest_cache' -or -name '.mypy_cache' \) -print0 | xargs -tr0 rm -r
-$(MAKE) clean-doc
.PHONY: doc docs
@@ -66,14 +66,19 @@ tests: ## Run tests for the isshub project.
@pytest
.PHONY: lint
-lint: ## Run all linters (check-isort, check-black, flake8, pylint)
-lint: check-isort check-black flake8 pylint
+lint: ## Run all linters (check-isort, check-black, mypy, flake8, pylint)
+lint: check-isort check-black flake8 pylint mypy
.PHONY: check checks
check: checks
checks: ## Run all checkers (lint, tests)
checks: lint test
+.PHONY: mypy
+mypy: ## Run the mypy tool
+ @echo "$(BOLD)Running mypy$(RESET)"
+ @mypy .
+
.PHONY: check-isort
check-isort: ## Run the isort tool in check mode only (won't modify files)
@echo "$(BOLD)Checking isort(RESET)"
style: Add black and isort to ensure code quality¶
- Commit
- Hash
- Date
2019-05-27 17:14:12 +0200
- Type
Modified
- Stats
+26 -2
@@ -66,14 +66,24 @@ tests: ## Run tests for the isshub project.
@pytest
.PHONY: lint
-lint: ## Run all linters (flake8, pylint)
-lint: flake8 pylint
+lint: ## Run all linters (check-isort, check-black, flake8, pylint)
+lint: check-isort check-black flake8 pylint
.PHONY: check checks
check: checks
checks: ## Run all checkers (lint, tests)
checks: lint test
+.PHONY: check-isort
+check-isort: ## Run the isort tool in check mode only (won't modify files)
+ @echo "$(BOLD)Checking isort(RESET)"
+ @isort --check-only 2>&1
+
+.PHONY: check-black
+check-black: ## Run the black tool in check mode only (won't modify files)
+ @echo "$(BOLD)Checking black$(RESET)"
+ @black --target-version py38 --check . 2>&1
+
.PHONY: flake8
flake8: ## Run the flake8 tool
@echo "$(BOLD)Running flake8$(RESET)"
@@ -83,3 +93,17 @@ flake8: ## Run the flake8 tool
pylint: ## Run the pylint tool
@echo "$(BOLD)Running pylint$(RESET)"
@pylint isshub
+
+.PHONY: pretty
+pretty: ## Run all code beautifiers (isort, black)
+pretty: isort black
+
+.PHONY: isort
+isort: ## Run the isort tool and update files that need to
+ @echo "$(BOLD)Running isort$(RESET)"
+ @isort --atomic --apply
+
+.PHONY: black
+black: ## Run the black tool and update files that need to
+ @echo "$(BOLD)Running black$(RESET)"
+ @black --target-version py38 .
style: Add flake8 and pylint to ensure code quality¶
- Commit
- Hash
- Date
2019-05-27 17:14:11 +0200
- Type
Modified
- Stats
+21 -2
@@ -20,12 +20,12 @@ install: ## Install the project in the current environment, with its dependenci
.PHONY: dev
dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
@echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode$(RESET)"
- @pip install -e .[dev,tests,docs]
+ @pip install -e .[dev,tests,lint,docs]
@$(MAKE) full-clean
.PHONY: dev-upgrade
dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
- @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["tests"] + o["extras_require"]["docs"]))'`
+ @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["tests"] + o["extras_require"]["lint"] + o["extras_require"]["docs"]))'`
@pip install -e .
@$(MAKE) full-clean
@@ -64,3 +64,22 @@ test: tests # we allow "test" and "tests"
tests: ## Run tests for the isshub project.
@echo "$(BOLD)Running tests$(RESET)"
@pytest
+
+.PHONY: lint
+lint: ## Run all linters (flake8, pylint)
+lint: flake8 pylint
+
+.PHONY: check checks
+check: checks
+checks: ## Run all checkers (lint, tests)
+checks: lint test
+
+.PHONY: flake8
+flake8: ## Run the flake8 tool
+ @echo "$(BOLD)Running flake8$(RESET)"
+ @flake8 --format=abspath
+
+.PHONY: pylint
+pylint: ## Run the pylint tool
+ @echo "$(BOLD)Running pylint$(RESET)"
+ @pylint isshub
tests: Setup testing tools with pytest¶
- Commit
- Hash
- Date
2019-05-27 17:14:11 +0200
- Type
Modified
- Stats
+9 -3
@@ -20,12 +20,12 @@ install: ## Install the project in the current environment, with its dependenci
.PHONY: dev
dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
@echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode$(RESET)"
- @pip install -e .[dev,docs]
+ @pip install -e .[dev,tests,docs]
@$(MAKE) full-clean
.PHONY: dev-upgrade
dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
- @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["docs"]))'`
+ @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["tests"] + o["extras_require"]["docs"]))'`
@pip install -e .
@$(MAKE) full-clean
@@ -43,7 +43,7 @@ clean: ## Clean python build related directories and files
full-clean: ## Like "clean" but with clean-doc and will clean some other generated directories or files
full-clean: clean
@echo "$(BOLD)Full cleaning$(RESET)"
- find ./ -type d -name '__pycache__' -print0 | xargs -tr0 rm -r
+ find ./ -type d \( -name '__pycache__' -or -name '.pytest_cache' \) -print0 | xargs -tr0 rm -r
-$(MAKE) clean-doc
.PHONY: doc docs
@@ -58,3 +58,9 @@ clean-doc: ## Clean the documentation directories
@echo "$(BOLD)Cleaning documentation directories$(RESET)"
@rm -rf docs/source
@cd docs && $(MAKE) clean
+
+.PHONY: tests test
+test: tests # we allow "test" and "tests"
+tests: ## Run tests for the isshub project.
+ @echo "$(BOLD)Running tests$(RESET)"
+ @pytest
docs: Documentation generation¶
- Commit
- Hash
- Date
2019-05-27 17:14:11 +0200
- Type
Modified
- Stats
+17 -3
@@ -20,12 +20,12 @@ install: ## Install the project in the current environment, with its dependenci
.PHONY: dev
dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
@echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode$(RESET)"
- @pip install -e .[dev]
+ @pip install -e .[dev,docs]
@$(MAKE) full-clean
.PHONY: dev-upgrade
dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
- @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"]))'`
+ @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"] + o["extras_require"]["docs"]))'`
@pip install -e .
@$(MAKE) full-clean
@@ -40,7 +40,21 @@ clean: ## Clean python build related directories and files
@rm -rf build dist $(PROJECT_NAME).egg-info
.PHONY: full-clean
-full-clean: ## Like "clean" but will clean some other generated directories or files
+full-clean: ## Like "clean" but with clean-doc and will clean some other generated directories or files
full-clean: clean
@echo "$(BOLD)Full cleaning$(RESET)"
find ./ -type d -name '__pycache__' -print0 | xargs -tr0 rm -r
+ -$(MAKE) clean-doc
+
+.PHONY: doc docs
+docs: doc # we allow "doc" and "docs"
+doc: clean-doc ## Build the documentation
+ @echo "$(BOLD)Building documentation$(RESET)"
+ @cd docs && $(MAKE) html
+
+.PHONY: clean-docs
+clean-docs: clean-doc # we allow "clean-doc" and "clean-docs"
+clean-doc: ## Clean the documentation directories
+ @echo "$(BOLD)Cleaning documentation directories$(RESET)"
+ @rm -rf docs/source
+ @cd docs && $(MAKE) clean
chore: Base of Isshub project¶
- Commit
- Hash
- Date
2019-05-27 17:14:11 +0200
- Type
Added
- Stats
+46 -0
@@ -0,0 +1,46 @@
+PROJECT_NAME := $(shell python setup.py --name)
+PROJECT_VERSION := $(shell python setup.py --version)
+
+BOLD := \033[1m
+RESET := \033[0m
+
+default: help
+
+.PHONY : help
+help: ## Show this help
+ @echo "$(BOLD)Isshub Makefile$(RESET)"
+ @echo "Please use 'make $(BOLD)target$(RESET)' where $(BOLD)target$(RESET) is one of:"
+ @grep -h ':\s\+##' Makefile | column -tn -s# | awk -F ":" '{ print " $(BOLD)" $$1 "$(RESET)" $$2 }'
+
+.PHONY: install
+install: ## Install the project in the current environment, with its dependencies
+ @echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION)$(RESET)"
+ @pip install .
+
+.PHONY: dev
+dev: ## Install the project in the current environment, with its dependencies, including the ones needed in a development environment
+ @echo "$(BOLD)Installing $(PROJECT_NAME) $(PROJECT_VERSION) in dev mode$(RESET)"
+ @pip install -e .[dev]
+ @$(MAKE) full-clean
+
+.PHONY: dev-upgrade
+dev-upgrade: ## Upgrade all default+dev dependencies defined in setup.cfg
+ @pip install --upgrade `python -c 'import setuptools; o = setuptools.config.read_configuration("setup.cfg")["options"]; print(" ".join(o["install_requires"] + o["extras_require"]["dev"]))'`
+ @pip install -e .
+ @$(MAKE) full-clean
+
+.PHONY: dist
+dist: ## Build the package
+ @echo "$(BOLD)Building package$(RESET)"
+ @python setup.py sdist bdist_wheel
+
+.PHONY: clean
+clean: ## Clean python build related directories and files
+ @echo "$(BOLD)Cleaning$(RESET)"
+ @rm -rf build dist $(PROJECT_NAME).egg-info
+
+.PHONY: full-clean
+full-clean: ## Like "clean" but will clean some other generated directories or files
+full-clean: clean
+ @echo "$(BOLD)Full cleaning$(RESET)"
+ find ./ -type d -name '__pycache__' -print0 | xargs -tr0 rm -r