Skip to content

Commit

Permalink
Merge pull request #392 from mottosso/temp
Browse files Browse the repository at this point in the history
Merge #391
  • Loading branch information
mottosso authored Feb 2, 2024
2 parents 183c187 + ffdf4ef commit 9748c22
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 77 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release to PyPi

on:
push:
tags:
- "*"

jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-latest
if: github.repository_owner == 'mottosso'

environment:
name: pypi
url: https://pypi.org/p/Qt.py
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7.x"
- name: Install build dependency
run: python3 -m pip install --upgrade build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Release to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
45 changes: 45 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Tests

on:
push:
branches:
- "*"

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-latest
VFXPLATFORM: "2018"
PYTHON: "2.7"
- os: ubuntu-latest
VFXPLATFORM: "2018"
PYTHON: "3.4"
- os: ubuntu-latest
VFXPLATFORM: "2018"
PYTHON: "3.5"
- os: ubuntu-latest
VFXPLATFORM: "2018"
PYTHON: "3.6"
- os: ubuntu-latest
VFXPLATFORM: "2017"
PYTHON: "2.7"
- os: ubuntu-latest
VFXPLATFORM: "2017"
PYTHON: "3.4"
- os: ubuntu-latest
VFXPLATFORM: "2017"
PYTHON: "3.5"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run tests in Docker container
run: |
docker run --rm \
-v $(pwd):/Qt.py \
-e PYTHON=${{ matrix.PYTHON }} \
fredrikaverpil/qt.py:${{ matrix.VFXPLATFORM }}
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Docker

In order to successfully test Qt.py against the different bindings of different versions, we use Travis-CI to run Docker containers based on [pre-built CentOS-based images](https://hub.docker.com/r/fredrikaverpil/qt.py/tags/).
In order to successfully test Qt.py against the different bindings of different versions, we use [Github Actions](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration) to run Docker containers based on [pre-built CentOS-based images](https://hub.docker.com/r/fredrikaverpil/qt.py/tags/).

The Docker images follow the [VFX Reference Platform specifications](http://www.vfxplatform.com/) with some additionals, and are quite jam-packed.

Expand All @@ -24,10 +24,10 @@ The Docker images follow the [VFX Reference Platform specifications](http://www.
* PyQt5<sup>1</sup>
* PySide2<sup>1</sup>

<sup>1</sup> Per specification from VFX Platform
<sup>2</sup> Adds possibility to faster clone large repositories
<sup>3</sup> cmake 3.x required to build PySide2
<sup>4</sup> Required for Qt.py testing
<sup>1</sup> Per specification from VFX Platform
<sup>2</sup> Adds possibility to faster clone large repositories
<sup>3</sup> cmake 3.x required to build PySide2
<sup>4</sup> Required for Qt.py testing
<sup>5</sup> Required for `PySide2.QtUiTools`

<br>
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<img width=260 src=logo.svg>
<img width=260 src=https://raw.githubusercontent.com/mottosso/Qt.py/master/logo.svg>

[![Downloads](https://pepy.tech/badge/qt-py)](https://pepy.tech/project/qt-py) [![Build Status](https://travis-ci.org/mottosso/Qt.py.svg?branch=master)](https://travis-ci.org/mottosso/Qt.py) [![PyPI version](https://badge.fury.io/py/Qt.py.svg)](https://pypi.python.org/pypi/Qt.py)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/qt.py/badges/version.svg)](https://anaconda.org/conda-forge/qt.py) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Qt-py/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Downloads](https://pepy.tech/badge/qt-py)](https://pepy.tech/project/qt-py)
[![Run Tests](https://github.com/mottosso/Qt.py/actions/workflows/run-tests.yml/badge.svg)](https://github.com/mottosso/Qt.py/actions)
[![PyPI version](https://badge.fury.io/py/Qt.py.svg)](https://pypi.python.org/pypi/Qt.py)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/qt.py/badges/version.svg)](https://anaconda.org/conda-forge/qt.py)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Qt-py/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)

Qt.py enables you to write software that runs on any of the 4 supported bindings - PySide2, PyQt5, PySide and PyQt4.
Expand All @@ -12,6 +15,7 @@ Qt.py enables you to write software that runs on any of the 4 supported bindings

| Date | Version | Event
|:---------|:----------|:----------
| Jan 2024 | [1.3.9][] | Run CI on Github Actions, instead of Travis CI.
| Sep 2020 | [1.3.0][] | Stability improvements and greater ability for `QtCompat.wrapInstance` to do its job
| Jun 2019 | [1.2.1][] | Bugfixes and [additional members](https://github.com/mottosso/Qt.py/releases/tag/1.2.0)
| Jan 2018 | [1.1.0][] | Adds new test suite, new members
Expand All @@ -29,6 +33,7 @@ Qt.py enables you to write software that runs on any of the 4 supported bindings
[1.1.0]: https://github.com/mottosso/Qt.py/releases/tag/1.1.0
[1.2.1]: https://github.com/mottosso/Qt.py/releases/tag/1.2.1
[1.3.0]: https://github.com/mottosso/Qt.py/releases/tag/1.3.0
[1.3.9]: https://github.com/mottosso/Qt.py/releases/tag/1.3.9

##### Guides

Expand Down Expand Up @@ -569,7 +574,7 @@ docker run --rm -v %CD%:/Qt.py -e PYTHON=3.6 fredrikaverpil/qt.py:2018
# OK
```

Now both you and Travis are operating on the same assumptions which means that when the tests pass on your machine, they pass on Travis. And everybody wins!
Now both you and Github Actions are operating on the same assumptions which means that when the tests pass on your machine, they pass on Github Actions. And everybody wins!

For details on the Docker image for testing, see [`DOCKER.md`](DOCKER.md).

Expand Down
16 changes: 7 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ set -e

# Start Xvfb
Xvfb :99 -screen 0 1024x768x16 2>/dev/null &
while ! ps aux | grep -q '[0]:00 Xvfb :99 -screen 0 1024x768x16'; do
counter=0
while ! pgrep 'Xvfb' &> /dev/null; do
echo "Waiting for Xvfb..."
sleep 1
((counter+=1))
if [[ $counter -ge 60 ]]; then
echo "Xvfb: Exceeded timeout."
exit 124
fi
done

if [ -n "$RELEASE" ]; then
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python${PYTHON} ./get-pip.py
printf "#\n# Installed pip for Python 2.7\n"
else
printf "#\n# Skipped pip, RELEASE not set\n"
fi

printf "#\n# Running tests in Python ${PYTHON}\n"
export NOSETESTS_BINARY=nosetests${PYTHON}
printf "#\n# Testing implementation..\n"
Expand Down
Empty file modified run_docker.sh
100644 → 100755
Empty file.
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,28 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities"
]

DESCRIPTION=(
"Python 2 & 3 compatibility wrapper around all Qt bindings - "
"PySide, PySide2, PyQt4 and PyQt5."
)
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
README_PATH = os.path.join(ROOT_PATH, "README.md")

setup(
name="Qt.py",
version=version,
description="Python 2 & 3 compatibility wrapper around all Qt bindings - "
"PySide, PySide2, PyQt4 and PyQt5.",
description=DESCRIPTION,
long_description=open(README_PATH).read(),
long_description_content_type="text/markdown",
author="Marcus Ottosson",
author_email="[email protected]",
url="https://github.com/mottosso/Qt",
Expand Down

0 comments on commit 9748c22

Please sign in to comment.