diff --git a/.github/workflows/release-to-pypi.yml b/.github/workflows/release-to-pypi.yml new file mode 100644 index 00000000..e58d0bba --- /dev/null +++ b/.github/workflows/release-to-pypi.yml @@ -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 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..783ed953 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 66e50988..00000000 --- a/.travis.yml +++ /dev/null @@ -1,57 +0,0 @@ -matrix: - include: - - # VFX Platform 2018 - - os: linux - env: - - VFXPLATFORM=2018 - - PYTHON=2.7 - - RELEASE=true - - os: linux - env: - - VFXPLATFORM=2018 - - PYTHON=3.4 - - os: linux - env: - - VFXPLATFORM=2018 - - PYTHON=3.5 - - os: linux - env: - - VFXPLATFORM=2018 - - PYTHON=3.6 - - # VFX Platform 2017 - - os: linux - env: - - VFXPLATFORM=2017 - - PYTHON=2.7 - - os: linux - env: - - VFXPLATFORM=2017 - - PYTHON=3.4 - - os: linux - env: - - VFXPLATFORM=2017 - - PYTHON=3.5 - - -language: python -sudo: required -dist: focal - -services: - - docker - -script: - - docker run --rm -v $(pwd):/Qt.py -e PYTHON=${PYTHON} fredrikaverpil/qt.py:${VFXPLATFORM} - -deploy: - provider: pypi - user: mottosso - password: - secure: kDHKpxgDtn6PoS2Hs0jKd3Xeq+ArFwcOKNW+NkZB2S8+MVxwkzsXBWsvK5Bo14GU/Xoo/PPQKMZi61GNXLJdb/5yGUo9hmuRH/UVCBuFar30pROzHLc2slUL1vbAw82pGa3UCpVLDPi/RVyfUWY4KOnlvr7Hb29IMg/NzfibP4cIEUGFqwp9F1KtE9N8oq6aK5rLznJJwq9Hjj564Zqo4JvEUzucLHnNS4WHFEURuF9gxxQ1E4EZXAnIDGEKmKvBRGKXpDGIJ7hIG9+6fEltZRBdb5jevHxbIjBHKbcK780XnR7gYOQwiCUWaQF90CPbHQA3ff9lKZVDAbQiuYhiqCEVnFCTfgB6D8rL2XQYe/A/pRN8eB2m++ft+v+zYAfmPK+wkNga8wXWMLkc7z+n+aEmeWxopj9MoQqzzKqJeRZ6wgqXWL1YB8TAbUiCRkpcxuMJVu5qIOuWw9eKp+yo6zHjxh6a4MxN50107ZR05ZDEdkU3PgJik5IScWDegJGRQALMCU2Wlis1cdbV8qSosrnMYMdcrpd0R3Bpl/2q9WtUZhZJ7z3GN4YV+d/l0fIUXbrHmOzWjoyW9U8zY2oL+5glCahA6IHBDD+Na47TT93EyMkJ5MxukqNi/rnqUvVdqzgG+tX/HeehNiZkPcN+CWSQoOt1Oeo9pkixpVbjmxA= - distributions: "sdist bdist_wheel" - on: - tags: true - repo: mottosso/Qt.py - condition: $RELEASE = true diff --git a/DOCKER.md b/DOCKER.md index 1c8d0467..fccc98ab 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -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. @@ -24,10 +24,10 @@ The Docker images follow the [VFX Reference Platform specifications](http://www. * PyQt51 * PySide21 -1 Per specification from VFX Platform -2 Adds possibility to faster clone large repositories -3 cmake 3.x required to build PySide2 -4 Required for Qt.py testing +1 Per specification from VFX Platform +2 Adds possibility to faster clone large repositories +3 cmake 3.x required to build PySide2 +4 Required for Qt.py testing 5 Required for `PySide2.QtUiTools`
diff --git a/README.md b/README.md index 71552bf1..1460b0b6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ - + -[![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. @@ -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 @@ -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 @@ -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). diff --git a/entrypoint.sh b/entrypoint.sh index b104f7d3..bed3c6b5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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" diff --git a/run_docker.sh b/run_docker.sh old mode 100644 new mode 100755 diff --git a/setup.py b/setup.py index af72d08c..d6b85cfb 100644 --- a/setup.py +++ b/setup.py @@ -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",