diff --git a/.github/workflows/pypi-deploy.yml b/.github/workflows/pypi-deploy.yml index 6014e51..eced054 100644 --- a/.github/workflows/pypi-deploy.yml +++ b/.github/workflows/pypi-deploy.yml @@ -30,6 +30,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Install cython + run: python -m pip install cython==0.29.24 - name: Build sdist run: python setup.py sdist working-directory: python/ diff --git a/.gitignore b/.gitignore index 3eec9b6..13306cc 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ pip/build/ python/README.md python/LICENSE -python/VERSION python/build python/*.egg-info python/dist diff --git a/makefile b/makefile index 5539bd9..a62f853 100644 --- a/makefile +++ b/makefile @@ -18,8 +18,9 @@ CC = g++ -std=c++17 OPT = -O3 -Wall -Wconversion -Wpedantic -Werror -Wunused-variable -Wsign-compare # determine git version/commit and release tag -GTAG := $(shell git tag -l --sort=version:refname | tail -n1) +GTAG := $(shell git tag -l --sort=version:refname | tail -n1 | sed "s/$^v//g") GHSH := $(shell git rev-parse HEAD | head -c8) +GVSN := $(shell cat python/VERSION | tr -d ' \n') # current timestamp TMS = $(shell date +%Y%m%dT%H%M%S) @@ -31,11 +32,11 @@ INST := /usr/local/bin # C++ and CLI tool # build exectuable -$(EXE) : main.o +$(EXE): check-tags $(GVSN) main.o $(CC) $(OPT) main.o -o $@ # build main.cpp and include git version/commit tag -main.o : src/main.cpp $(HPP) +main.o: src/main.cpp $(HPP) @cp $< $<.cpp @sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp @sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp @@ -43,13 +44,13 @@ main.o : src/main.cpp $(HPP) $(CC) -c $(OPT) -I $(LIB) $<.cpp -o $@ @rm $<.cpp -install : $(EXE) +install: $(EXE) cp $< $(INST)/ -uninstall : $(INST)/$(EXE) +uninstall: $(INST)/$(EXE) rm $< -cpp-clean : +cpp-clean: rm -vf $(EXE) rm -vf *.o @@ -59,10 +60,21 @@ cpp-clean : check-code: cppcheck --enable=all -I lib/ src/main.cpp +#-----------------------------------------------------------------------------# +# versions + +$(GTAG): + @echo "consistent versions check successful: building $(GTAG)" + +check-tags: + @echo "latest git tag: $(GTAG)" + @echo "latest git hash: $(GHSH)" + @echo "python version: $(GVSN)" + #-----------------------------------------------------------------------------# # Docker -docker-build : +docker-build: docker build ./ --tag imctermite:0.1 docker-run: @@ -71,7 +83,7 @@ docker-run: #-----------------------------------------------------------------------------# # python -python-build: +python-build: check-tags $(GVSN) make -C python/ build-inplace cp python/IMCtermite*.so ./ -v diff --git a/python/VERSION b/python/VERSION new file mode 100644 index 0000000..227cea2 --- /dev/null +++ b/python/VERSION @@ -0,0 +1 @@ +2.0.0 diff --git a/python/makefile b/python/makefile index fd1ab56..0b6cb59 100644 --- a/python/makefile +++ b/python/makefile @@ -1,14 +1,11 @@ -GITAG := $(shell git tag -l --sort=version:refname | tail -n1 | sed 's/^v//g') - setup: - echo $(GITAG) > VERSION cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md cp -r ../lib ./ cp -v ../LICENSE ./ setup-clean: - rm -vf README.md VERSION LICENSE + rm -vf README.md LICENSE rm -rf lib/ build: setup