Skip to content

Commit

Permalink
Version 0.4
Browse files Browse the repository at this point in the history
Release of version 0.4 - merge dev into main
  • Loading branch information
ebranlard committed Oct 27, 2023
2 parents 6c4f283 + dbcd123 commit 4140c24
Show file tree
Hide file tree
Showing 137 changed files with 31,462 additions and 7,614 deletions.
58 changes: 45 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8] # 2.7,
python-version: [3.8, 3.9, 3.11]

steps:
# --- Install steps
Expand All @@ -25,12 +25,19 @@ jobs:
- name: Versioning
id: versioning
run: |
git fetch --unshallow
git fetch --tags
export CURRENT_TAG="v0.3"
git fetch --unshallow > /dev/null
git fetch --tags --force > /dev/null
export CURRENT_TAG="v0.4"
export CURRENT_DEV_TAG="$CURRENT_TAG-dev"
# BRANCH FAILS
export BRANCH1=`git rev-parse --abbrev-ref HEAD`
export BRANCH="${GITHUB_REF#refs/heads/}"
echo "GIT DESCRIBE: `git describe`"
echo "GITHUB_REF: $GITHUB_REF"
echo "GIT BRANCH1: $BRANCH1"
echo "GIT BRANCH: $BRANCH"
echo "Commits: `git rev-list $CURRENT_TAG.. --count`"
echo "Commits-dev: `git rev-list $CURRENT_DEV_TAG.. --count`"
# Check if current version corresponds to a tagged commit
if [[ $GITHUB_REF == *"tags"* ]]; then
echo ">>> This is a tagged version"
Expand All @@ -42,18 +49,25 @@ jobs:
export VERSION_TAG=$CURRENT_TAG
export VERSION_NAME="$CURRENT_TAG-`git rev-list $CURRENT_TAG.. --count`"
export FULL_VERSION_NAME="version $VERSION_NAME"
#elif [[ $BRANCH == "dev" ]]; then
# echo ">>> This is not a tagged version, but on the dev branch"
# export VERSION_TAG=$CURRENT_DEV_TAG ;
# export VERSION_NAME=`git describe | sed 's/\(.*\)-.*/\1/'`
# export FULL_VERSION_NAME="latest dev. version $VERSION_NAME"
else
echo ">>> This is not a tagged version"
echo ">>> This is not a tagged version, but on a special branch"
export VERSION_TAG=$CURRENT_DEV_TAG ;
export VERSION_NAME=`git describe | sed 's/\(.*\)-.*/\1/'`
export FULL_VERSION_NAME="latest dev. version $VERSION_NAME"
fi
echo "VERSION_TAG $VERSION_TAG"
echo "VERSION_NAME: $VERSION_NAME"
echo "FULL_VERSION_NAME: $FULL_VERSION_NAME"
echo "::set-output name=FULL_VERSION_NAME::$FULL_VERSION_NAME"
echo "::set-output name=VERSION_NAME::$VERSION_NAME"
echo "::set-output name=VERSION_TAG::$VERSION_TAG"
# Save variables as github outputs
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_OUTPUT
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
echo "FULL_VERSION_NAME=$FULL_VERSION_NAME" >> $GITHUB_OUTPUT
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -62,9 +76,16 @@ jobs:

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
#python -m pip install --upgrade pip
# --- Attempt for wxpython, but we don't have access to X display
#sudo apt-get install libgtk-3-dev
#sudo apt-get install git curl libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0 || true
#sudo apt-get install libnotify-dev || true
#sudo apt-get install libnotify4 || true
#pip install -U wxpython || true
#pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython || true
pip install -r _tools/travis_requirements.txt
pip install -r weio/requirements.txt
pip install -e .
- name: System info
run: |
Expand All @@ -84,18 +105,29 @@ jobs:
env:
PY_VERSION: ${{matrix.python-version}}
GH_EVENT : ${{github.event_name}}
BRANCH : ${{steps.versioning.outputs.BRANCH}}
run: |
echo "GH_EVENT : $GH_EVENT"
echo "PY_VERSION : $PY_VERSION"
echo "GIT BRANCH : $BRANCH"
export OK=0
# Only deploy for push events
if [[ $PY_VERSION == "3.6" ]]; then
if [[ $PY_VERSION == "3.9" ]]; then
if [[ $GH_EVENT == "push" ]]; then
# BRANCH FAILS
if [[ $BRANCH == "main" ]] || [[ $BRANCH == "dev" ]] || [[ $BRANCH == "HEAD" ]] ; then
export OK=1 ;
fi
fi
fi
echo "DEPLOY : $OK"
echo "::set-output name=GO::$OK"
if [[ $OK == "1" ]]; then
echo ">>> Deployment WILL take place"
else
echo ">>> Deployment WILL NOT take place"
fi
# Save variables as github outputs
echo "GO=$OK" >> $GITHUB_OUTPUT
# --- Run Deployments
- name: Install system dependencies
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

176 changes: 89 additions & 87 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,87 +1,89 @@
# --- Detecting OS
ifeq '$(findstring ;,$(PATH))' ';'
detected_OS := Windows
else
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
endif

testfile= weio/weio/tests/example_files/FASTIn_arf_coords.txt
all:
ifeq ($(detected_OS),Darwin) # Mac OS X
./pythonmac pyDatView.py $(testfile)
else
python pyDatView.py $(testfile)
endif




deb:
python DEBUG.py

install:
python setup.py install

dep:
python -m pip install -r requirements.txt

pull:
git pull --recurse-submodules
update:pull


help:
@echo "Available rules:"
@echo " all run the standalone program"
@echo " install install the python package in the system"
@echo " dep download the dependencies "
@echo " pull download the latest version "
@echo " test run the unit tests "

test:
ifeq ($(detected_OS),Darwin) # Mac OS X
./pythonmac -m unittest discover -v tests
./pythonmac -m unittest discover -v pydatview/plugins/tests
else
python -m unittest discover -v tests
python -m unittest discover -v pydatview/plugins/tests
endif

prof:
python -m cProfile -o tests/prof_all.prof tests/prof_all.py
python -m pyprof2calltree -i tests/prof_all.prof -o tests/callgrind.prof_all.prof
snakeviz tests/prof_all.prof


exe:
python -m nuitka --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka pyDatView.py

exestd:
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

clean:
rm -rf __pycache__
rm -rf *.egg-info
rm -rf *.spec
rm -rf build*
rm -rf dist


pyexe:
pyinstaller --onedir pyDatView.py

version:
ifeq ($(OS),Windows_NT)
@echo "Doing nothing"
else
@sh _tools/setVersion.sh
endif

installer:
python -m nsist installer.cfg



# --- Detecting OS
ifeq '$(findstring ;,$(PATH))' ';'
detected_OS := Windows
else
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
endif

testfile= example_files/FASTIn_arf_coords.txt
all:
ifeq ($(detected_OS),Darwin) # Mac OS X
./pythonmac pyDatView.py $(testfile)
else
python pyDatView.py $(testfile)
endif




deb:
python DEBUG.py

install:
python setup.py install

dep:
python -m pip install -r requirements.txt

pull:
git pull --recurse-submodules
update:pull


help:
@echo "Available rules:"
@echo " all run the standalone program"
@echo " install install the python package in the system"
@echo " dep download the dependencies "
@echo " pull download the latest version "
@echo " test run the unit tests "

test:
ifeq ($(detected_OS),Darwin) # Mac OS X
./pythonmac -m unittest discover -v tests
./pythonmac -m unittest discover -v pydatview/plugins/tests
else
python -m unittest discover -v tests
python -m unittest discover -v pydatview/plugins/tests
endif

prof:
python -m cProfile -o tests/prof_all.prof tests/prof_all.py
python -m pyprof2calltree -i tests/prof_all.prof -o tests/callgrind.prof_all.prof
snakeviz tests/prof_all.prof
#viztracer .\tests\prof_all.py
#vizviewer.exe .\result.json


exe:
python -m nuitka --follow-imports --include-plugin-directory --include-plugin-files --show-progress --show-modules --output-dir=build-nuitka pyDatView.py

exestd:
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

clean:
rm -rf __pycache__
rm -rf *.egg-info
rm -rf *.spec
rm -rf build*
rm -rf dist


pyexe:
pyinstaller --onedir pyDatView.py

version:
ifeq ($(OS),Windows_NT)
@echo "Doing nothing"
else
@sh _tools/setVersion.sh
endif

installer:
python -m nsist installer.cfg



Loading

0 comments on commit 4140c24

Please sign in to comment.