Skip to content

Update mdfields.py

Update mdfields.py #57

Workflow file for this run

name: Package Application with Pyinstaller for Windows and pypi
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-pyPI:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install setuptools
run:
python -m pip install --upgrade pip setuptools wheel
- name: Build an sdist
run:
python setup.py sdist
- name: Publish distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build-Windows-exe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Package Application for Windows
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: ./
- uses: actions/upload-artifact@v2
with:
name: pyDataView.exe
path: dist/windows
build-mac-linux:
strategy:
fail-fast: false
matrix:
#os: [macos-latest, macos-11, macos-10.15]
os: [ubuntu-20.04, ubuntu-22.04]#, macos-11, ubuntu-18.04, ubuntu-22.04]
python-version: ['3.9']#, '3.8', '3.9', '3.10', '3.11']
#exclude:
# - os: macos-latest
# python-version: '3.8'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Diagnostic report env
run: |
echo "PYTHON_VERSION is ${{ matrix.python-version }} on OS ${{ matrix.os }}"
echo "Github variable RUNNER_OS=$RUNNER_OS"
if [ "$RUNNER_OS" == "Linux" ]; then # report linux distro version
lsb_release -a
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install attrdict3
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0
sudo apt-get install libgtk-3-dev
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }} wxPython
elif [ "$RUNNER_OS" == "macOS" ]; then
pip install wxpython
else
echo "$RUNNER_OS not supported"
exit 1
fi
pip install numpy matplotlib scipy vispy
pip install pyinstaller
- name: Run Python and print version_info
run: |
python -c "import sys; print(sys.version_info)"
uname -a
#Checkout code here
- uses: actions/checkout@v2
- name: Build executable using Pyinstaller
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
pyinstaller pyDataView.spec
ls -l dist/
elif [ "$RUNNER_OS" == "macOS" ]; then
#It seems building in stages seems to work (locally at least)
pyinstaller --windowed pyDataView.py
#diff pyDataView.spec pyDataView_apple1.spec
#Try rebuilding with spec file generated by windowed command above
pyinstaller pyDataView.spec
#pyinstaller -y pyDataView_apple1.spec
#pyinstaller -y pyDataView_apple2.spec
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Save generated executable file as an artifact
uses: actions/upload-artifact@v2
with:
# The act of downloading zips up the artifact and adds the .zip to the downloaded file
name: pyDataView-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/