github action on pull request with wxpython

Viewed 234

I am trying to set up a Github action to test my python application that uses wxPython, but I cannot figure out how to set up without wxPython failing to build with a GTK3 error:

Here is the action file:

on:
  pull_request:
    branches:
      - development
jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python 3.7
      uses: actions/setup-python@v1
      with:
        python-version: 3.7

    # pip install wheel
    - name: Install Requirements
      run: |
       sudo apt-get update -q && sudo apt-get install
       sudo apt-get install python-wxgtk3.0
       python -m pip install --upgrade pip
       pip install jsonschema
       pip install pylint
       pip install twisted
       pip install wheel
       pip install -U wxpython
      run: |
        cd src
        export PYTHONPATH=`pwd`/keypad_controller
        python ../pipelines/lint.py --path keypad_controller --threshold 10

The errors I am getting is: 1)

Building wheels for collected packages: wxpython
  Building wheel for wxpython (setup.py): started
  Building wheel for wxpython (setup.py): finished with status 'error'
  Running setup.py clean for wxpython
  ERROR: Command errored out with exit status 1:
   command: /opt/hostedtoolcache/Python/3.7.9/x64/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uietf6rb/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uietf6rb/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-05g1i2nj
       cwd: /tmp/pip-install-uietf6rb/wxpython/
  1. checking for GTK+ - version >= 3.0.0... Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found

Is there a Github action 'uses' for wxPython so I don't have to install it each time?

1 Answers

Install python-wxgtk3.0-dev by adding the following line to your Install Requirements step:

sudo apt-get install python-wxgtk3.0-dev

Related