Skip to content

Commit

Permalink
Maintenance: CI, documentation, cleanups (#119)
Browse files Browse the repository at this point in the history
* README.md: Convert to markdown

* Fix minimum Python version requirement

* Github Actions: Build from source

* Fix sphinx-doc path

* Run tests

* Single build workflow

* Remove old build file

* No fail fast

* Set path on macOS only

* Run tests with offscreen QPA plugin

* Build and test vs docs

* README.md: CI badge
  • Loading branch information
thp committed Jun 6, 2021
1 parent df80d64 commit aed2584
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 53 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install -y \
python3-dev \
qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5svg5-dev
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install qt@5 python@3.8
echo PATH=/usr/local/opt/qt@5/bin:$PATH >> ${GITHUB_ENV}
- run: qmake
- run: make
- run: env QT_QPA_PLATFORM=offscreen tests/tests
17 changes: 17 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Documentation

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt install -y python3-sphinx
- run: make -C docs html
52 changes: 0 additions & 52 deletions README

This file was deleted.

70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
PyOtherSide: Python 3 QML Plugin for Qt 5
=========================================

[![Build and test](https://github.com/thp/pyotherside/actions/workflows/build.yaml/badge.svg)](https://github.com/thp/pyotherside/actions/workflows/build.yaml)

A Qt plugin providing access to a Python 3 interpreter from QML
for creating asynchronous mobile and Desktop UIs with Python.


Requirements
------------

- Qt >= 5.1.0
- Python >= 3.3.0


Building
--------

To build and install the QML plugin:

```
qmake
make
make install
```

To build against a specific Python version, use:

```
qmake PYTHON_CONFIG=python3.3-config
make
make install
```

To manually update the qmltypes file on x64 Linux (TODO: make this automated):

```
qmake
make
make INSTALL_ROOT=$(pwd)/tmp/
QML2_IMPORT_PATH=$(pwd)/tmp/usr/lib/x86_64-linux-gnu/qt5/qml \
make -C src qmltypes
```

Unit Testing
------------

To run the included unit tests after building, use:

```
./tests/tests
```

Static Linking
--------------

If you want to link PyOtherSide statically against Python 3, you can include
the Python Standard Library in PyOtherSide as Qt Resource and have it extracted
automatically on load, for this, zip up the Standard Library and place the .zip
file as "pythonlib.zip" into src/ before running qmake.


More information
----------------

- Project page: https://thp.io/2011/pyotherside/
- Git repo: http://github.com/thp/pyotherside/
- Bug tracker: https://github.com/thp/pyotherside/issues
- Documentation: http://pyotherside.readthedocs.org/
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ Building PyOtherSide
The following build requirements have to be satisfied to build PyOtherSide:

* Qt 5.1.0 or newer
* Python 3.2.0 or newer
* Python 3.3.0 or newer

If you have the required build-dependencies installed, building and installing
the PyOtherSide plugin should be as simple as:
Expand Down

0 comments on commit aed2584

Please sign in to comment.