Skip to content

Commit

Permalink
create sdk/python makefile (#98)
Browse files Browse the repository at this point in the history
* create makefile

* address coment

* fix typo

* address comments

* remove prereq

* change makefile

* add abspath

* address comments

* address comments
  • Loading branch information
kevinyu98 authored Apr 24, 2020
1 parent d59d53b commit cddd1b7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2020 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Configuration variables
#
VENV ?= .venv
export VIRTUAL_ENV := $(abspath ${VENV})
export PATH := ${VIRTUAL_ENV}/bin:${PATH}

# Use the command from https://stackoverflow.com/a/35730328/5601796
.PHONY: help
help: ## Display the Make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

.PHONY: venv
venv: $(VENV)/bin/activate ## Create and activate virtual environment
$(VENV)/bin/activate: sdk/python/setup.py
@test -d $(VENV) || python3 -m venv $(VENV)
pip install -e sdk/python
@touch $(VENV)/bin/activate

.PHONY: test
test: venv ## Run kfp/tekton unit test
@sdk/python/tests/run_tests.sh

.PHONY: report
report: ## Report kfp sample stats
@cd sdk/python/tests && ./test_kfp_samples.sh

0 comments on commit cddd1b7

Please sign in to comment.