-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: JP-Ellis <[email protected]>
- Loading branch information
Showing
14 changed files
with
139 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,55 @@ | ||
DOCS_DIR := ./docs | ||
|
||
PROJECT := pact-python | ||
PYTHON_MAJOR_VERSION := 3.11 | ||
|
||
sgr0 := $(shell tput sgr0) | ||
red := $(shell tput setaf 1) | ||
green := $(shell tput setaf 2) | ||
|
||
help: | ||
@echo "" | ||
@echo " clean to clear build and distribution directories" | ||
@echo " examples to run the example end to end tests (consumer, fastapi, flask, messaging)" | ||
@echo " consumer to run the example consumer tests" | ||
@echo " fastapi to run the example FastApi provider tests" | ||
@echo " flask to run the example Flask provider tests" | ||
@echo " messaging to run the example messaging e2e tests" | ||
@echo " package to create a distribution package in /dist/" | ||
@echo " package to build a wheel and sdist" | ||
@echo " release to perform a release build, including deps, test, and package targets" | ||
@echo " test to run all tests" | ||
@echo "" | ||
@echo " test to run all tests on the current python version" | ||
@echo " test-all to run all tests on all supported python versions" | ||
@echo " example to run the example end to end tests (requires docker)" | ||
@echo " lint to run the lints" | ||
@echo " ci to run test and lints" | ||
@echo "" | ||
@echo " help to show this help message" | ||
@echo "" | ||
@echo "Most of these targets are just wrappers around hatch commands." | ||
@echo "See https://hatch.pypa.org for information to install hatch." | ||
|
||
|
||
.PHONY: release | ||
release: test package | ||
release: clean test package | ||
|
||
|
||
.PHONY: clean | ||
clean: | ||
hatch clean | ||
|
||
|
||
define CONSUMER | ||
echo "consumer make" | ||
cd examples/consumer | ||
pip install -q -r requirements.txt | ||
pip install -e ../../ | ||
./run_pytest.sh | ||
endef | ||
export CONSUMER | ||
|
||
|
||
define FLASK_PROVIDER | ||
echo "flask make" | ||
cd examples/flask_provider | ||
pip install -q -r requirements.txt | ||
pip install -e ../../ | ||
./run_pytest.sh | ||
endef | ||
export FLASK_PROVIDER | ||
|
||
|
||
define FASTAPI_PROVIDER | ||
echo "fastapi make" | ||
cd examples/fastapi_provider | ||
pip install -q -r requirements.txt | ||
pip install -e ../../ | ||
./run_pytest.sh | ||
endef | ||
export FASTAPI_PROVIDER | ||
|
||
|
||
define MESSAGING | ||
echo "messaging make" | ||
cd examples/message | ||
pip install -q -r requirements.txt | ||
pip install -e ../../ | ||
./run_pytest.sh | ||
endef | ||
export MESSAGING | ||
|
||
|
||
.PHONY: consumer | ||
consumer: | ||
bash -c "$$CONSUMER" | ||
|
||
|
||
.PHONY: flask | ||
flask: | ||
bash -c "$$FLASK_PROVIDER" | ||
.PHONY: package | ||
package: | ||
hatch build | ||
|
||
|
||
.PHONY: fastapi | ||
fastapi: | ||
bash -c "$$FASTAPI_PROVIDER" | ||
.PHONY: test | ||
test: | ||
hatch run test | ||
hatch run coverage report -m --fail-under=100 | ||
|
||
|
||
.PHONY: messaging | ||
messaging: | ||
bash -c "$$MESSAGING" | ||
.PHONY: test-all | ||
test-all: | ||
hatch run test:test | ||
|
||
|
||
.PHONY: examples | ||
examples: consumer flask fastapi messaging | ||
.PHONY: example | ||
example: | ||
hatch run example | ||
|
||
|
||
.PHONY: package | ||
package: | ||
hatch build | ||
.PHONY: lint | ||
lint: | ||
hatch run lint | ||
|
||
|
||
.PHONY: test | ||
test: | ||
hatch run all | ||
hatch run test:all | ||
coverage report -m --fail-under=100 | ||
.PHONY: ci | ||
ci: test lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.