Skip to content

Added prev_prime(x) #378

Added prev_prime(x)

Added prev_prime(x) #378

name: pip_install_gmpy2
on: [push, pull_request]
jobs:
osx:
strategy:
fail-fast: false
matrix:
python-version: [3.11, 3.12]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- run: pip install --upgrade pip
- run: pip --verbose install --editable .[tests]
- run: python test/runtests.py
- run: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
if: ${{ matrix.python-version == '3.11' }}
linux:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get install libmpc-dev texlive texlive-latex-extra latexmk lcov
- run: pip install --upgrade pip
- run: pip --verbose install --editable .[docs,tests]
- run: python test/runtests.py
- run: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
- run: sphinx-build --color -W --keep-going -b doctest docs build/sphinx/doctest
- run: sphinx-build --color -W --keep-going -b html docs build/sphinx/html
- run: sphinx-build --color -W --keep-going -b latex docs build/sphinx/latex
- run: make -C build/sphinx/latex all-pdf
- name: Run coverage tests
# XXX: why this doesn't work with pip install --editable above?
run: |
pip uninstall -y gmpy2
python setup.py clean
CFLAGS="-coverage" python setup.py develop
python test/runtests.py
lcov --capture --directory . --no-external --output-file build/coverage.info
genhtml build/coverage.info --output-directory build/coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
gcov: true
gcov_include: src/*.c
gcov_args: --no-external
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
path: |
build/sphinx/doctest/
build/sphinx/html/
build/sphinx/latex/gmpy2.pdf
build/coverage/
windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
name: Setup msys2
with:
update: true
install: >-
gcc
gmp-devel
mpfr-devel
mpc-devel
python-setuptools
python-pip
- run: pip install --upgrade pip
- run: pip --verbose install -e .[tests]
- run: python test/runtests.py
- run: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py