Skip to content

build(deps): bump actions/setup-python from 4 to 5 #94

build(deps): bump actions/setup-python from 4 to 5

build(deps): bump actions/setup-python from 4 to 5 #94

Workflow file for this run

name: CI
on:
- push
- pull_request
- workflow_dispatch
env:
# Allow automated checks.
DJVULIBRE_VERSION: 3.5.28
jobs:
main:
strategy:
matrix:
python: [3.8, 3.9, '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
- name: set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: apt update
run:
sudo apt-get update
- name: apt install deps
run: |
sudo apt-get install language-pack-ja ghostscript
- name: install ccache
run: |
sudo apt-get install ccache
echo "/usr/lib/ccache:$PATH" >> $GITHUB_PATH
- name: restore ccache data
uses: actions/cache@v3
with:
path: ~/.ccache
key:
ccache-${{ env.DJVULIBRE_VERSION }}-py${{ matrix.python }}
restore-keys:
ccache-${{ env.DJVULIBRE_VERSION }}-py${{ matrix.python }}
- name: install DjVuLibre
run: |
wget https://downloads.sourceforge.net/project/djvu/DjVuLibre/${DJVULIBRE_VERSION}/djvulibre-${DJVULIBRE_VERSION}.tar.gz
tar -xvvf djvulibre-*.tar.gz
(cd djvulibre-*/ && ./configure --disable-desktopfiles --prefix ~/.local CXXFLAGS="-fpermissive -include cstddef" || cat config.log /fail)
make -C djvulibre-*/libdjvu/ install
make -C djvulibre-*/tools/ install
make -C djvulibre-*/ install
echo CPATH=~/.local/include/ >> $GITHUB_ENV
echo PKG_CONFIG_PATH=~/.local/lib/pkgconfig/ >> $GITHUB_ENV
echo LD_LIBRARY_PATH=~/.local/lib/ >> $GITHUB_ENV
- name: update PIP
run:
python -m pip install --upgrade pip
- name: install wheel
run:
python -m pip install wheel
# `setuptools` is not included inside a virtual environment any more since Python 3.12:
# https://discuss.python.org/t/announcement-pip-23-2-release/29702
- name: install setuptools
run:
python -m pip install --upgrade setuptools
- name: install Cython
run:
python -m pip install Cython
- name: install packaging
run:
python -m pip install packaging
- name: check changelog syntax
run:
dpkg-parsechangelog -ldoc/changelog --all 2>&1 >/dev/null | { ! grep .; }
- name: build the extension in-place
run:
PYTHONWARNINGS=error::FutureWarning python setup.py build_ext --inplace
- name: run tests
run:
LC_ALL=C python -m unittest discover tests/ -v
- name: build the docs
run: |
python -m pip install sphinx
PYTHONPATH=$PWD sphinx-build -W -b doctest doc/api/ tmp
- name: check reST syntax
run:
private/check-rst
- name: install flake8
run:
python -m pip install --upgrade flake8 pep8-naming
- name: run flake8
run:
python -m flake8 tests/ doc/ setup.py
- name: run pycodestyle
run:
python -m pycodestyle djvu/
- name: build sdist
run:
python setup.py sdist
- name: check sdist tarball
run: |
tar -tvf dist/*.tar.gz | { ! grep -F /djvu/config.pxi; }
tar -tvf dist/*.tar.gz | { grep -F /djvu/sexpr.pyx; }
tar -tvf dist/*.tar.gz | { grep -F /djvu/sexpr.pxd; }
- name: install via sdist
run:
python -m pip install dist/*.tar.gz
- name: check import
run: |
cd /
python -c 'import djvu.sexpr, djvu.decode'
- name: uninstall
run: |
cd /
pip uninstall -y python-djvulibre
set +e; python -c 'import djvu'; [ $? -eq 1 ]
- name: build wheel
run:
python -m pip wheel --verbose --no-deps --wheel-dir dist .
# Wheels are basically ZIP files.
- name: check wheel file
run: |
unzip -l dist/*.whl | { ! grep -F /djvu/config.pxi; }
unzip -l dist/*.whl | { grep "sexpr\.cpython-3[[:digit:]]\+-x86_64-linux-gnu\.so"; }
- name: install via wheel
run:
python -m pip install dist/*.whl
- name: check import
run: |
cd /
python -c 'import djvu.sexpr, djvu.decode'
- name: uninstall
run: |
cd /
pip uninstall -y python-djvulibre
set +e; python -c 'import djvu'; [ $? -eq 1 ]
- name: install directly
run:
python -m pip install --verbose .
- name: check import
run: |
cd /
python -c 'import djvu.sexpr, djvu.decode'
# vim:ts=2 sts=2 sw=2 et