Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Dec 19, 2023
1 parent b11e7c5 commit 917e92a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ BASENAME := $(shell basename $(CURRENT_DIR))
package=$(BASENAME)

include ../cloudmesh-common/makefile.mk

.PHONY: help

help:
@echo "Available targets:"
@echo "------------------"
@grep ": ##" ../cloudmesh-common/makefile.mk | awk 'BEGIN {FS=": ##"}; {printf "%-11s - %s\n", $$1, $$2}'
@echo
47 changes: 22 additions & 25 deletions makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,35 @@ define banner
@echo "############################################################"
endef

welcome:
.PHONY: dist

welcome: ## Display welcome message
$(call banner, "Install ${package}")

source: welcome
source: welcome ## Install the package in source mode
pip install -e . -U

pip: welcome
pip: welcome ## Install the package in pip mode
pip install -e . -U --config-settings editable_mode=strict


##############################################################################
# CHECK
##############################################################################

flake8:
flake8: ## Run flake8
cd ..; flake8 --max-line-length 124 --ignore=E722 $(package)/src/cloudmesh
cd ..; flake8 --max-line-length 124 --ignore=E722 $(package)/tests

pylint:
pylint: ## Run pylint
cd ..; pylint --rcfile=$(package)/.pylintrc $(package)/src/cloudmesh
cd ..; pylint --rcfile=$(package)/.pylintrc --disable=F0010 $(package)/tests

##############################################################################
# CLEAN
##############################################################################

clean:
clean: ## Clean the project
$(call banner, "CLEAN")
rm -rf *.egg-info
rm -rf *.eggs
Expand All @@ -45,7 +47,7 @@ clean:
rm -rf .tmp
find . -type d -name '__pycache__' -exec rm -rf {} +

cleanall:
cleanall: ## Clean all the project
cd ../cloudmesh-common; make clean
cd ../cloudmesh-cmd5; make clean
cd ../cloudmesh-sys; make clean
Expand All @@ -60,7 +62,7 @@ cleanall:
# INFO
##############################################################################

info:
info: ## Display info about the project
@echo "================================================="
@git remote show origin
@echo "================================================="
Expand All @@ -71,34 +73,32 @@ info:
# TEST
##############################################################################

test:
test: ## Run tests
pytest -v --html=.report.html
open .report.html

dtest:
dtest: ## Run tests with no capture
pytest -v --capture=no

######################################################################
# PYPI
######################################################################

twine:
twine: ## Install twine
pip install -U twine

.PHONY: dist

dist:
dist: ## Build the package
pip install -q build
python -m build
twine check dist/*

local: welcome dist
local: welcome dist ## Install the package locally
pip install dist/*.whl

local-force:
local-force: ## Install the package locally with force
pip install dist/*.whl --force-reinstall

patch: clean twine
patch: clean twine ## Build the package and upload it to testpypi
$(call banner, "patch")
pip install -r requirements-dev.txt
cms bumpversion patch
Expand All @@ -109,19 +109,19 @@ patch: clean twine
twine check dist/*
twine upload --repository testpypi dist/*

minor: clean
minor: clean ## increase the minor version number
$(call banner, "minor")
cms bumpversion minor
@cat VERSION
@echo

major: clean
major: clean ## increase the major version number
$(call banner, "major")
cms bumpversion major
@cat VERSION
@echo

release: clean
release: clean ## create a release
$(call banner, "release")
git tag "v$(VERSION)"
git push origin main --tags
Expand All @@ -132,14 +132,11 @@ release: clean
@cat VERSION
@echo

upload:
upload: ## Upload the package to pypi
twine check dist/*
twine upload dist/*

pip:
pip install --index-url https://test.pypi.org/simple/ $(package) -U

log:
log: ## Update the ChangeLog
$(call banner, log)
gitchangelog | fgrep -v ":dev:" | fgrep -v ":new:" > ChangeLog
git commit -m "chg: dev: Update ChangeLog" ChangeLog
Expand Down

0 comments on commit 917e92a

Please sign in to comment.