Skip to content

Enable use with python -m or pythonw -m #663

Enable use with python -m or pythonw -m

Enable use with python -m or pythonw -m #663

Workflow file for this run

name: CI
on:
push:
branches:
- main
- e*
tags:
- v*
pull_request:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name != 'pull_request' && github.sha || '' }}
cancel-in-progress: true
jobs:
build:
name: Build ${{ matrix.os.name }} ${{ matrix.python.name }}-${{ matrix.bitness.name }} ${{ matrix.qt.pyqt_version }}
runs-on: ${{ matrix.os.runs-on }}
container: ${{ format(matrix.os.container, matrix.python.docker) }}
strategy:
fail-fast: false
matrix:
os:
- name: Linux
runs-on: ubuntu-latest
python_platform: linux
container: docker://python:{0}-buster
# - name: Windows
# runs-on: windows-latest
# python_platform: win32
# vs_path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat
# - name: macOS
# runs-on: macos-latest
# python_platform: darwin
python:
- name: '3.10'
tox: py310
action: '3.10'
docker: '3.10'
matrix: '3.10'
qt:
- name: 5.15.9
pyqt_version: 5.15.9
qt_version: 5.15.2
matrix: 5.15.9
major: 5
tox: qt5
- name: 6.3.1
pyqt_version: 6.3.1
qt_version: 6.3.2
matrix: 6.3.1
major: 6
tox: qt6
- name: 6.4.2
pyqt_version: 6.4.2
qt_version: 6.4.3
matrix: 6.4.2
major: 6
tox: qt6
bitness:
- name: x64
action: x64
ilammy: x64
exclude:
- bitness:
name: x32
os:
name: Linux
- bitness:
name: x32
os:
name: macOS
- bitness:
name: x32
os:
name: Windows
qt:
major: 6
env:
QT_VERSION: ${{ matrix.qt.qt_version }}
PYQT_VERSION: ${{ matrix.qt.pyqt_version }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python.name }}-${{ matrix.bitness.name }}
if: matrix.os.python_platform != 'linux'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.action }}
architecture: ${{ matrix.bitness.action }}
- name: pip/setuptools/tox
run: |
python -m pip install --upgrade pip setuptools wheel
pip install 'tox<4' pep517
- name: Report info
shell: bash
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git show --quiet HEAD
python --version --version
pip --version
pip list
pip freeze --all
python -c "import sysconfig; print('Py_ENABLE_SHARED -> {}'.format(sysconfig.get_config_var('Py_ENABLE_SHARED')))"
python -c 'import sys; print("sys.maxsize:", sys.maxsize, sys.maxsize > 2**32)'
- name: Install Linux build dependencies
if: matrix.os.python_platform == 'linux'
run: |
apt-get update --yes
apt-get install --yes libgl1-mesa-dev libdbus-1-3 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- uses: altendky/QTBUG-88688-libxcb-util@v3
- name: Build wheel
shell: bash
run: |
python -m pep517.build --binary --out-dir dist/ .
- name: Archive individual wheel
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.qt.name }}
path: dist/
- name: Archive all wheels
uses: actions/upload-artifact@v3
with:
name: all_wheels
path: dist/
test:
name: Test ${{ matrix.os.name }} ${{ matrix.python.name }}-${{ matrix.bitness.name }} ${{ matrix.qt.name }}
runs-on: ${{ matrix.os.runs-on }}
container: ${{ matrix.os.container[matrix.python.docker] }}
needs:
- build
strategy:
fail-fast: false
matrix:
os:
- name: Linux
runs-on: ubuntu-latest
python_platform: linux
container:
'3.7': docker://python:3.7-buster
'3.8': docker://python:3.8-buster
'3.9': docker://python:3.9-buster
'3.10': docker://python:3.10-buster
'3.11': docker://python:3.11-buster
miniconda3: docker://continuumio/miniconda3
matrix: linux
- name: macOS
runs-on: macos-latest
python_platform: darwin
matrix: macos
- name: Windows
runs-on: windows-latest
python_platform: win32
vs_path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat
matrix: windows
python:
- name: '3.7'
tox: py37
action: '3.7'
docker: '3.7'
matrix: '3.7'
- name: '3.8'
tox: py38
action: '3.8'
docker: '3.8'
matrix: '3.8'
- name: '3.9'
tox: py39
action: '3.9'
docker: '3.9'
matrix: '3.9'
- name: '3.10'
tox: py310
action: '3.10'
docker: '3.10'
matrix: '3.10'
- name: '3.11'
tox: py311
action: '3.11'
docker: '3.11'
matrix: '3.11'
# https://github.com/altendky/pyqt-tools/issues/116
# - name: Miniconda
# tox: py310
# action: miniconda3
# docker: miniconda3
# matrix: miniconda3
qt:
- name: 5.15.9
pyqt_version: 5.15.9
qt_version: 5.15.2
env: 5.15.2
matrix: 5.15.9
major: 5
tox: qt5
- name: 6.3.1
pyqt_version: 6.3.1
qt_version: 6.3.2
env: 6.3.1
matrix: 6.3.1
major: 6
tox: qt6
- name: 6.4.2
pyqt_version: 6.4.2
qt_version: 6.4.3
env: 6.4.2
matrix: 6.4.2
major: 6
tox: qt6
bitness:
- name: x32
action: x86
ilammy: x86
- name: x64
action: x64
ilammy: x64
exclude:
- bitness:
name: x32
os:
name: Linux
- bitness:
name: x32
os:
name: macOS
- bitness:
name: x32
os:
name: Windows
qt:
major: 6
- python:
matrix: miniconda3
os:
matrix: windows
- python:
matrix: miniconda3
os:
matrix: macos
env:
QT_VERSION: ${{ matrix.qt.qt_version }}
PYQT_VERSION: ${{ matrix.qt.pyqt_version }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download
uses: actions/download-artifact@v3
with:
name: ${{ matrix.qt.name }}
path: dist/
- name: Set up Python ${{ matrix.python.name }}-${{ matrix.bitness.name }}
if: matrix.os.matrix != 'linux'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.action }}
architecture: ${{ matrix.bitness.action }}
- name: pip/setuptools/tox
run: |
python -m pip install --upgrade pip setuptools
pip install 'tox<4'
- name: Report info
shell: bash
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git show --quiet HEAD
python --version --version
pip --version
pip list
pip freeze --all
python -c "import sysconfig; print('Py_ENABLE_SHARED -> {}'.format(sysconfig.get_config_var('Py_ENABLE_SHARED')))"
python -c 'import sys; print("sys.maxsize:", sys.maxsize, sys.maxsize > 2**32)'
- name: Set WHEEL_PATH
shell: python
run: |
import os
import pathlib
fspath = getattr(os, 'fspath', str)
dist = pathlib.Path.cwd() / 'dist'
[wheel] = dist.glob('*.whl')
with open(os.environ['GITHUB_ENV'], 'a') as github_env:
github_env.write('WHEEL_PATH={}\n'.format(fspath(wheel)))
github_env.write('WHEEL_STEM={}\n'.format(wheel.stem))
- name: Install Linux test dependencies
if: matrix.os.matrix == 'linux'
run: |
apt-get update --yes
apt-get install --yes g++ make libgl1-mesa-dri libgl1-mesa-dev libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xvfb x11-utils
- uses: altendky/QTBUG-88688-libxcb-util@v3
if: matrix.python.matrix != 'miniconda3'
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os.python_platform == 'win32'
with:
arch: ${{ matrix.bitness.ilammy }}
- name: Test
run: |
tox -e ${{ matrix.python.tox }}-${{ matrix.qt.tox }} --installpkg ${{ env['WHEEL_PATH'] }}
maybe_publish:
name: Maybe Publish
runs-on: ubuntu-latest
container: docker://python:3.10-buster
needs:
- test
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: trust the git repo
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Download all wheels
uses: actions/download-artifact@v3
with:
name: all_wheels
path: dist/
- name: Install Python packages
run: |
pip install --upgrade twine
- name: Maybe publish
run: |
python twineontag.py
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
all:
name: All
runs-on: ubuntu-latest
needs:
- build
- test
- maybe_publish
steps:
- name: This
shell: python
run: |
import this