Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert CI/CD to GitHub actions. #391

Merged
merged 20 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
02e0e77
run_docker.sh: Add execution permissions.
martin-chatterjee Jan 4, 2024
e4ffb10
entrypoint.sh: Switch to using pgrep to verify running Xvfb process.
martin-chatterjee Jan 4, 2024
95f7d6b
entrypoint.sh: Exit with code 124 if Xvfb is not running after 60 secs.
martin-chatterjee Jan 4, 2024
782c2db
Github Actions: Add 'run-tests' workflow.
martin-chatterjee Jan 4, 2024
a2cadee
entrypoint.sh: Remove obsolete pip installation.
martin-chatterjee Jan 4, 2024
1c1a99f
run-tests.yaml: Only run on pushed commits, not on pushed tags.
martin-chatterjee Jan 10, 2024
ba39275
Rename Github workflow config file suffix to '.yml'.
martin-chatterjee Jan 10, 2024
92a5dc2
Github Actions: Add 'release-to-pypi' workflow.
martin-chatterjee Jan 10, 2024
d90800a
setup.py: Pass content of 'README.md' in as long_description.
martin-chatterjee Jan 10, 2024
f7e2064
README.md: Load logo with absolute URL.
martin-chatterjee Jan 10, 2024
1618938
README.md: Replace Travis CI badge with Github Actions badge.
martin-chatterjee Jan 10, 2024
636dc16
README.md: Add CI changes to News section.
martin-chatterjee Jan 10, 2024
f117855
Update documentation.
martin-chatterjee Jan 10, 2024
cd4cb74
setup.py: Add support for Python 3.7 – 3.10.
martin-chatterjee Jan 10, 2024
c1f5885
Remove obsolete Travis CI config file.
martin-chatterjee Jan 10, 2024
7734178
Release test: Change project name and version.
martin-chatterjee Jan 10, 2024
e9a79fb
Revert project name and version after release test.
martin-chatterjee Jan 10, 2024
8415b61
Release to PyPi: Un-comment 'repository_owner' constraint.
martin-chatterjee Jan 10, 2024
009591d
README.md: Change absolute badge URLs to 'mottosso/Qt.py'.
martin-chatterjee Jan 10, 2024
65d87b3
Qt.py: Update version to '1.3.9'.
martin-chatterjee Jan 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
# TODO: Remove with: block before actual release.
with:
repository-url: https://test.pypi.org/legacy/
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
2 changes: 1 addition & 1 deletion Qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import json


__version__ = "1.3.8"
__version__ = "1.3.9"

# Enable support for `from Qt import *`
__all__ = []
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="konstruktion@gmail.com",
url="https://github.com/mottosso/Qt",
Expand Down