From 5113051afbe49c41755a06df1d188743367b742b Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Thu, 3 Oct 2024 14:25:29 +0100 Subject: [PATCH] Add Makefile targets for udpates --- Makefile | 25 ++++++++++++++--------- VERSION | 2 +- c/Makefile | 24 +++++++++++----------- c/doc/Doxyfile | 2 +- go/Makefile | 43 ++++++++++++++++++++++++++++++++-------- javascript/Makefile | 8 ++++---- python-class/Makefile | 14 ++++++------- python-class/setup.py | 4 ++-- python/Makefile | 14 ++++++------- python/setup.py | 2 +- r/Makefile | 10 +++++----- r/variantkey/DESCRIPTION | 2 +- 12 files changed, 92 insertions(+), 58 deletions(-) diff --git a/Makefile b/Makefile index c233b81..97c8b19 100644 --- a/Makefile +++ b/Makefile @@ -49,15 +49,16 @@ help: @echo "VariantKey Makefile." @echo "The following commands are available:" @echo "" - @echo " make c : Build and test the C version" - @echo " make go : Build and test the GO version" - @echo " make javascript : Build and test the Javascript version" - @echo " make python : Build and test the Python version" - @echo " make python-class : Build and test the Python wrapper class" - @echo " make r : Build and test the R version" - @echo " make clean : Remove any build artifact" - @echo " make dbuild : Build everything inside a Docker container" - @echo " make tag : Tag the Git repository" + @echo " make c : Build and test the C version" + @echo " make go : Build and test the GO version" + @echo " make javascript : Build and test the Javascript version" + @echo " make python : Build and test the Python version" + @echo " make python-class : Build and test the Python wrapper class" + @echo " make r : Build and test the R version" + @echo " make clean : Remove any build artifact" + @echo " make dbuild : Build everything inside a Docker container" + @echo " make tag : Tag the Git repository" + @echo " make versionup : Increase the patch number in the VERSION file" @echo "" all: c go javascript python python-class r @@ -147,3 +148,9 @@ pubdocs: tag: git tag -a "v$(VERSION)" -m "Version $(VERSION)" && \ git push origin --tags + +# Increase the patch number in the VERSION file +.PHONY: versionup +versionup: + echo ${VERSION} | gawk -F. '{printf("%d.%d.%d",$$1,$$2,(($$3+1)));}' > VERSION + $(MAKE) version diff --git a/VERSION b/VERSION index 99160fd..9eb3834 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.6.18 +5.6.19 diff --git a/c/Makefile b/c/Makefile index 6649864..e958b6f 100644 --- a/c/Makefile +++ b/c/Makefile @@ -58,18 +58,18 @@ help: @echo "$(PROJECT) Makefile." @echo "The following commands are available:" @echo "" - @echo " make qa : Run all the tests and static analysis reports" - @echo " make test : Run the unit tests" - @echo " make tidy : Check the code using clang-tidy" - @echo " make build : Build the library" - @echo " make version : Set version from VERSION file" - @echo " make doc : Generate source code documentation" - @echo " make format : Format the source code" - @echo " make clean : Remove any build artifact" - @echo " make install : Install the library" - @echo " make uninstall : Uninstall the library" - @echo " make rpm : Build an RPM package" - @echo " make deb : Build a DEB package" + @echo " make qa : Run all the tests and static analysis reports" + @echo " make test : Run the unit tests" + @echo " make tidy : Check the code using clang-tidy" + @echo " make build : Build the library" + @echo " make version : Set version from VERSION file" + @echo " make doc : Generate source code documentation" + @echo " make format : Format the source code" + @echo " make clean : Remove any build artifact" + @echo " make install : Install the library" + @echo " make uninstall : Uninstall the library" + @echo " make rpm : Build an RPM package" + @echo " make deb : Build a DEB package" @echo "" all: clean version format test tidy build rpm deb package_vk doc diff --git a/c/doc/Doxyfile b/c/doc/Doxyfile index 5bbe28e..73e8168 100644 --- a/c/doc/Doxyfile +++ b/c/doc/Doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = "VariantKey" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 5.6.18 +PROJECT_NUMBER = 5.6.19 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/go/Makefile b/go/Makefile index 19f977e..95e5043 100644 --- a/go/Makefile +++ b/go/Makefile @@ -72,14 +72,18 @@ help: @echo "GOPATH=$(GOPATH)" @echo "The following commands are available:" @echo "" - @echo " make clean : Remove any build artifact" - @echo " make coverage : Generate the coverage report" - @echo " make deps : Get dependencies" - @echo " make format : Format the source code" - @echo " make linter : Check code against multiple linters" - @echo " make mod : Download dependencies" - @echo " make qa : Run all tests and static analysis tools" - @echo " make test : Run unit tests" + @echo " make clean : Remove any build artifact" + @echo " make coverage : Generate the coverage report" + @echo " make deps : Get dependencies" + @echo " make format : Format the source code" + @echo " make linter : Check code against multiple linters" + @echo " make mod : Download dependencies" + @echo " make qa : Run all tests and static analysis tools" + @echo " make test : Run unit tests" + @echo " make updateall : Update everything" + @echo " make updatego : Update Go version" + @echo " make updatelint : Update golangci-lint version" + @echo " make updatemod : Update dependencies" @echo "" @echo "Use DEVMODE=LOCAL for human friendly output." @echo "" @@ -159,3 +163,26 @@ test: ensuretarget -coverprofile=target/report/coverage.out \ -v $(SRCDIR) $(TESTEXTRACMD) @echo -e "\n\n>>> END: Unit Tests <<<\n\n" + +# Update everything +.PHONY: updateall +updateall: updatego updatelint updatemod + +# Update go version +.PHONY: updatego +updatego: + $(eval LAST_GO_TOOLCHAIN=$(shell curl -s https://go.dev/dl/ | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+\.linux-amd64\.tar\.gz' | head -n 1 | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+')) + $(eval LAST_GO_VERSION=$(shell echo ${LAST_GO_TOOLCHAIN} | grep -oP '[0-9]+\.[0-9]+')) + sed -i "s|^go [0-9]*\.[0-9]*$$|go ${LAST_GO_VERSION}|g" ../go.mod + sed -i "s|^toolchain go[0-9]*\.[0-9]*\.[0-9]*$$|toolchain ${LAST_GO_TOOLCHAIN}|g" ../go.mod + +# Update linter version +.PHONY: updatelint +updatelint: + $(eval LAST_GOLANGCILINT_VERSION=$(shell curl -sL https://github.com/golangci/golangci-lint/releases/latest | grep -oP 'Release \Kv[0-9]+\.[0-9]+\.[0-9]+')) + sed -i "s|^GOLANGCILINTVERSION=v[0-9]*\.[0-9]*\.[0-9]*$$|GOLANGCILINTVERSION=${LAST_GOLANGCILINT_VERSION}|g" Makefile + +# Update dependencies +.PHONY: updatemod +updatemod: + $(GO) get -t -u ./... && go mod tidy -compat=$(shell grep -oP 'go \K[0-9]+\.[0-9]+' ../go.mod) diff --git a/javascript/Makefile b/javascript/Makefile index 4c8b04b..8147e15 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -14,10 +14,10 @@ help: @echo "Requires: node-js and uglify-js." @echo "The following commands are available:" @echo "" - @echo " make test : Run the unit tests against source code" - @echo " make build : Build and test a minified version of the library" - @echo " make format : Format the source code" - @echo " make clean : Remove any build artifact" + @echo " make test : Run the unit tests against source code" + @echo " make build : Build and test a minified version of the library" + @echo " make format : Format the source code" + @echo " make clean : Remove any build artifact" @echo "" all: clean format test build diff --git a/python-class/Makefile b/python-class/Makefile index 2af4ebb..5f1bed3 100644 --- a/python-class/Makefile +++ b/python-class/Makefile @@ -31,13 +31,13 @@ help: @echo "${PROJECT} Python Makefile." @echo "The following commands are available:" @echo "" - @echo " make build : Build the library" - @echo " make clean : Remove any build artifact" - @echo " make docs : Generate documentation" - @echo " make format : Format the source code" - @echo " make test : Test the library" - @echo " make venv : Create a virtual environment" - @echo " make version : Set the version from VERSION file" + @echo " make build : Build the library" + @echo " make clean : Remove any build artifact" + @echo " make docs : Generate documentation" + @echo " make format : Format the source code" + @echo " make test : Test the library" + @echo " make venv : Create a virtual environment" + @echo " make version : Set the version from VERSION file" @echo "" all: clean venv build test diff --git a/python-class/setup.py b/python-class/setup.py index 01753a1..f572cf3 100644 --- a/python-class/setup.py +++ b/python-class/setup.py @@ -38,7 +38,7 @@ def run(self): setup( name="pyvariantkey", - version="5.6.18.0", + version="5.6.19.0", keywords=("variantkey variant key genetic genomics"), description="VariantKey Python wrapper class", long_description=read("../README.md"), @@ -56,7 +56,7 @@ def run(self): ], install_requires=[ "numpy>=1.24.2,<2", - "variantkey>=5.6.18.0", + "variantkey>=5.6.19.0", ], extras_require={ "test": [ diff --git a/python/Makefile b/python/Makefile index 5e921f5..271718e 100644 --- a/python/Makefile +++ b/python/Makefile @@ -31,13 +31,13 @@ help: @echo "${PROJECT} Python Makefile." @echo "The following commands are available:" @echo "" - @echo " make build : Build the library" - @echo " make clean : Remove any build artifact" - @echo " make docs : Generate documentation" - @echo " make format : Format the source code" - @echo " make test : Test the library" - @echo " make venv : Create a virtual environment" - @echo " make version : Set the version from VERSION file" + @echo " make build : Build the library" + @echo " make clean : Remove any build artifact" + @echo " make docs : Generate documentation" + @echo " make format : Format the source code" + @echo " make test : Test the library" + @echo " make venv : Create a virtual environment" + @echo " make version : Set the version from VERSION file" @echo "" all: clean venv build test diff --git a/python/setup.py b/python/setup.py index 52da692..aa0c02d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -30,7 +30,7 @@ def run(self): setup( name="variantkey", - version="5.6.18.0", + version="5.6.19.0", keywords=("variantkey variant key genetic genomics"), description="VariantKey Bindings for Python", long_description=read("../README.md"), diff --git a/r/Makefile b/r/Makefile index 3dd826c..75dc232 100644 --- a/r/Makefile +++ b/r/Makefile @@ -43,11 +43,11 @@ help: @echo "VariantKey R Makefile." @echo "The following commands are available:" @echo "" - @echo " make build : Build the library" - @echo " make test : Test the library" - @echo " make format : Format the source code" - @echo " make clean : Remove any build artifact" - @echo " make devdoc : Generate documentation" + @echo " make build : Build the library" + @echo " make test : Test the library" + @echo " make format : Format the source code" + @echo " make clean : Remove any build artifact" + @echo " make devdoc : Generate documentation" @echo "" all: clean format build test diff --git a/r/variantkey/DESCRIPTION b/r/variantkey/DESCRIPTION index 897fbec..43747b3 100644 --- a/r/variantkey/DESCRIPTION +++ b/r/variantkey/DESCRIPTION @@ -1,6 +1,6 @@ Package: variantkey Title: Genetic VariantKey -Version: 5.6.18.0 +Version: 5.6.19.0 Authors@R: person("Nicola", "Asuni", email = "info@tecnick.com", role = c("aut", "cre")) Description: Tools to generate and process a 64 bit Unsigned Integer Keys for Human Genetic Variants. The VariantKey is sortable for chromosome and position,