comparison mupdf-source/.github/workflows/test_python_pip.yml @ 3:2c135c81b16c

MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:44:09 +0200
parents b50eed0cc0ef
children
comparison
equal deleted inserted replaced
0:6015a75abc2d 3:2c135c81b16c
1 name: Pip build/install and test of Python Bindings
2
3 on:
4 schedule:
5 - cron: '13 5 * * *'
6 workflow_dispatch:
7 inputs:
8
9 jobs:
10
11 test:
12 name: Pip build/install and test of Python Bindings
13 runs-on: ${{ matrix.os }}
14 strategy:
15 matrix:
16 os: [ubuntu-latest, windows-2019, macos-latest]
17
18 # Avoid cancelling of all runs after a single failure.
19 fail-fast: false
20
21 steps:
22
23 - uses: actions/checkout@v2
24 with:
25 submodules: true
26 - uses: actions/setup-python@v2
27
28 - name: Pip build/install and test of Python Bindings
29
30 # We use a python script to run a series of commands, all inside a venv
31 # so that packages can be installed as required.
32 #
33 # We use pip to build and install the Python bindings. This
34 # will automatically install required packages as specified in
35 # pyproject.toml, and then use setup.py to build and install into the
36 # venv.
37 #
38 # Then we run MuPDF's python tests using the venv's newly-installed
39 # `mupdf` module.
40 #
41
42 run: |
43 import os
44 import platform
45 import subprocess
46 import sys
47
48 venv_name = 'pylocal'
49
50 command = ''
51 command += f'{sys.executable} -m venv {venv_name}'
52 if platform.system() == 'Windows':
53 command += f' && ./{venv_name}/Scripts/activate'.replace('/', os.sep)
54 else:
55 command += f' && . {venv_name}/bin/activate'
56 command += f' && python -m pip install -U pip setuptools'
57 command += f' && python -m pip install -vv .'
58 command += f' && python scripts/mupdfwrap.py -d - --test-python'
59
60 print(f'Running: {command}')
61 sys.stdout.flush()
62 subprocess.run( command, check=1, shell=1)
63
64 shell: python
65
66 - name: Archive generated code
67 uses: actions/upload-artifact@v4
68 if: failure()
69 with:
70 name: generated-code
71 path: |
72 platform/c++/
73 platform/python/