Skip to content

Commit 4140c24

Browse files
committed
Version 0.4
Release of version 0.4 - merge dev into main
2 parents 6c4f283 + dbcd123 commit 4140c24

File tree

137 files changed

+31462
-7614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+31462
-7614
lines changed

.github/workflows/tests.yml

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99

1010
jobs:
1111
build-and-test:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
strategy:
1414
matrix:
15-
python-version: [3.8] # 2.7,
15+
python-version: [3.8, 3.9, 3.11]
1616

1717
steps:
1818
# --- Install steps
@@ -25,12 +25,19 @@ jobs:
2525
- name: Versioning
2626
id: versioning
2727
run: |
28-
git fetch --unshallow
29-
git fetch --tags
30-
export CURRENT_TAG="v0.3"
28+
git fetch --unshallow > /dev/null
29+
git fetch --tags --force > /dev/null
30+
export CURRENT_TAG="v0.4"
3131
export CURRENT_DEV_TAG="$CURRENT_TAG-dev"
32+
# BRANCH FAILS
33+
export BRANCH1=`git rev-parse --abbrev-ref HEAD`
34+
export BRANCH="${GITHUB_REF#refs/heads/}"
3235
echo "GIT DESCRIBE: `git describe`"
3336
echo "GITHUB_REF: $GITHUB_REF"
37+
echo "GIT BRANCH1: $BRANCH1"
38+
echo "GIT BRANCH: $BRANCH"
39+
echo "Commits: `git rev-list $CURRENT_TAG.. --count`"
40+
echo "Commits-dev: `git rev-list $CURRENT_DEV_TAG.. --count`"
3441
# Check if current version corresponds to a tagged commit
3542
if [[ $GITHUB_REF == *"tags"* ]]; then
3643
echo ">>> This is a tagged version"
@@ -42,18 +49,25 @@ jobs:
4249
export VERSION_TAG=$CURRENT_TAG
4350
export VERSION_NAME="$CURRENT_TAG-`git rev-list $CURRENT_TAG.. --count`"
4451
export FULL_VERSION_NAME="version $VERSION_NAME"
52+
#elif [[ $BRANCH == "dev" ]]; then
53+
# echo ">>> This is not a tagged version, but on the dev branch"
54+
# export VERSION_TAG=$CURRENT_DEV_TAG ;
55+
# export VERSION_NAME=`git describe | sed 's/\(.*\)-.*/\1/'`
56+
# export FULL_VERSION_NAME="latest dev. version $VERSION_NAME"
4557
else
46-
echo ">>> This is not a tagged version"
58+
echo ">>> This is not a tagged version, but on a special branch"
4759
export VERSION_TAG=$CURRENT_DEV_TAG ;
4860
export VERSION_NAME=`git describe | sed 's/\(.*\)-.*/\1/'`
4961
export FULL_VERSION_NAME="latest dev. version $VERSION_NAME"
5062
fi
5163
echo "VERSION_TAG $VERSION_TAG"
5264
echo "VERSION_NAME: $VERSION_NAME"
5365
echo "FULL_VERSION_NAME: $FULL_VERSION_NAME"
54-
echo "::set-output name=FULL_VERSION_NAME::$FULL_VERSION_NAME"
55-
echo "::set-output name=VERSION_NAME::$VERSION_NAME"
56-
echo "::set-output name=VERSION_TAG::$VERSION_TAG"
66+
# Save variables as github outputs
67+
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
68+
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_OUTPUT
69+
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
70+
echo "FULL_VERSION_NAME=$FULL_VERSION_NAME" >> $GITHUB_OUTPUT
5771
5872
- name: Set up Python ${{ matrix.python-version }}
5973
uses: actions/setup-python@v2
@@ -62,9 +76,16 @@ jobs:
6276

6377
- name: Install python dependencies
6478
run: |
65-
python -m pip install --upgrade pip
79+
#python -m pip install --upgrade pip
80+
# --- Attempt for wxpython, but we don't have access to X display
81+
#sudo apt-get install libgtk-3-dev
82+
#sudo apt-get install git curl libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0 || true
83+
#sudo apt-get install libnotify-dev || true
84+
#sudo apt-get install libnotify4 || true
85+
#pip install -U wxpython || true
86+
#pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython || true
6687
pip install -r _tools/travis_requirements.txt
67-
pip install -r weio/requirements.txt
88+
pip install -e .
6889
6990
- name: System info
7091
run: |
@@ -84,18 +105,29 @@ jobs:
84105
env:
85106
PY_VERSION: ${{matrix.python-version}}
86107
GH_EVENT : ${{github.event_name}}
108+
BRANCH : ${{steps.versioning.outputs.BRANCH}}
87109
run: |
88110
echo "GH_EVENT : $GH_EVENT"
89111
echo "PY_VERSION : $PY_VERSION"
112+
echo "GIT BRANCH : $BRANCH"
90113
export OK=0
91114
# Only deploy for push events
92-
if [[ $PY_VERSION == "3.6" ]]; then
115+
if [[ $PY_VERSION == "3.9" ]]; then
93116
if [[ $GH_EVENT == "push" ]]; then
117+
# BRANCH FAILS
118+
if [[ $BRANCH == "main" ]] || [[ $BRANCH == "dev" ]] || [[ $BRANCH == "HEAD" ]] ; then
94119
export OK=1 ;
120+
fi
95121
fi
96122
fi
97123
echo "DEPLOY : $OK"
98-
echo "::set-output name=GO::$OK"
124+
if [[ $OK == "1" ]]; then
125+
echo ">>> Deployment WILL take place"
126+
else
127+
echo ">>> Deployment WILL NOT take place"
128+
fi
129+
# Save variables as github outputs
130+
echo "GO=$OK" >> $GITHUB_OUTPUT
99131
100132
# --- Run Deployments
101133
- name: Install system dependencies

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 89 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,89 @@
1-
# --- Detecting OS
2-
ifeq '$(findstring ;,$(PATH))' ';'
3-
detected_OS := Windows
4-
else
5-
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
6-
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
7-
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
8-
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
9-
endif
10-
11-
testfile= weio/weio/tests/example_files/FASTIn_arf_coords.txt
12-
all:
13-
ifeq ($(detected_OS),Darwin) # Mac OS X
14-
./pythonmac pyDatView.py $(testfile)
15-
else
16-
python pyDatView.py $(testfile)
17-
endif
18-
19-
20-
21-
22-
deb:
23-
python DEBUG.py
24-
25-
install:
26-
python setup.py install
27-
28-
dep:
29-
python -m pip install -r requirements.txt
30-
31-
pull:
32-
git pull --recurse-submodules
33-
update:pull
34-
35-
36-
help:
37-
@echo "Available rules:"
38-
@echo " all run the standalone program"
39-
@echo " install install the python package in the system"
40-
@echo " dep download the dependencies "
41-
@echo " pull download the latest version "
42-
@echo " test run the unit tests "
43-
44-
test:
45-
ifeq ($(detected_OS),Darwin) # Mac OS X
46-
./pythonmac -m unittest discover -v tests
47-
./pythonmac -m unittest discover -v pydatview/plugins/tests
48-
else
49-
python -m unittest discover -v tests
50-
python -m unittest discover -v pydatview/plugins/tests
51-
endif
52-
53-
prof:
54-
python -m cProfile -o tests/prof_all.prof tests/prof_all.py
55-
python -m pyprof2calltree -i tests/prof_all.prof -o tests/callgrind.prof_all.prof
56-
snakeviz tests/prof_all.prof
57-
58-
59-
exe:
60-
python -m nuitka --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka pyDatView.py
61-
62-
exestd:
63-
python -m nuitka --python-flag=no_site --assume-yes-for-downloads --standalone --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka-std pyDatView.py
64-
65-
clean:
66-
rm -rf __pycache__
67-
rm -rf *.egg-info
68-
rm -rf *.spec
69-
rm -rf build*
70-
rm -rf dist
71-
72-
73-
pyexe:
74-
pyinstaller --onedir pyDatView.py
75-
76-
version:
77-
ifeq ($(OS),Windows_NT)
78-
@echo "Doing nothing"
79-
else
80-
@sh _tools/setVersion.sh
81-
endif
82-
83-
installer:
84-
python -m nsist installer.cfg
85-
86-
87-
1+
# --- Detecting OS
2+
ifeq '$(findstring ;,$(PATH))' ';'
3+
detected_OS := Windows
4+
else
5+
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
6+
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
7+
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
8+
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
9+
endif
10+
11+
testfile= example_files/FASTIn_arf_coords.txt
12+
all:
13+
ifeq ($(detected_OS),Darwin) # Mac OS X
14+
./pythonmac pyDatView.py $(testfile)
15+
else
16+
python pyDatView.py $(testfile)
17+
endif
18+
19+
20+
21+
22+
deb:
23+
python DEBUG.py
24+
25+
install:
26+
python setup.py install
27+
28+
dep:
29+
python -m pip install -r requirements.txt
30+
31+
pull:
32+
git pull --recurse-submodules
33+
update:pull
34+
35+
36+
help:
37+
@echo "Available rules:"
38+
@echo " all run the standalone program"
39+
@echo " install install the python package in the system"
40+
@echo " dep download the dependencies "
41+
@echo " pull download the latest version "
42+
@echo " test run the unit tests "
43+
44+
test:
45+
ifeq ($(detected_OS),Darwin) # Mac OS X
46+
./pythonmac -m unittest discover -v tests
47+
./pythonmac -m unittest discover -v pydatview/plugins/tests
48+
else
49+
python -m unittest discover -v tests
50+
python -m unittest discover -v pydatview/plugins/tests
51+
endif
52+
53+
prof:
54+
python -m cProfile -o tests/prof_all.prof tests/prof_all.py
55+
python -m pyprof2calltree -i tests/prof_all.prof -o tests/callgrind.prof_all.prof
56+
snakeviz tests/prof_all.prof
57+
#viztracer .\tests\prof_all.py
58+
#vizviewer.exe .\result.json
59+
60+
61+
exe:
62+
python -m nuitka --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka pyDatView.py
63+
64+
exestd:
65+
python -m nuitka --python-flag=no_site --assume-yes-for-downloads --standalone --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka-std pyDatView.py
66+
67+
clean:
68+
rm -rf __pycache__
69+
rm -rf *.egg-info
70+
rm -rf *.spec
71+
rm -rf build*
72+
rm -rf dist
73+
74+
75+
pyexe:
76+
pyinstaller --onedir pyDatView.py
77+
78+
version:
79+
ifeq ($(OS),Windows_NT)
80+
@echo "Doing nothing"
81+
else
82+
@sh _tools/setVersion.sh
83+
endif
84+
85+
installer:
86+
python -m nsist installer.cfg
87+
88+
89+

0 commit comments

Comments
 (0)