chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: Run coverage tests
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
coverage:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
env:
|
||||
PYTEST_ADDOPTS: --cov mpmath --cov-append -n auto
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[develop,gmpy2,gmp,ci]
|
||||
- name: Run coverage tests
|
||||
run: |
|
||||
pytest
|
||||
pip uninstall -y ipython
|
||||
pytest mpmath/tests/test_cli.py
|
||||
pip uninstall -y gmpy2
|
||||
pytest mpmath/tests/test_basic_ops.py mpmath/tests/test_convert.py \
|
||||
mpmath/tests/test_functions.py mpmath/tests/test_gammazeta.py \
|
||||
mpmath/tests/test_bitwise.py
|
||||
pip uninstall -y python-gmp
|
||||
pytest mpmath/tests/test_basic_ops.py mpmath/tests/test_convert.py \
|
||||
mpmath/tests/test_functions.py mpmath/tests/test_gammazeta.py \
|
||||
mpmath/tests/test_bitwise.py
|
||||
- name: Generate coverage reports
|
||||
run: |
|
||||
coverage xml
|
||||
coverage html
|
||||
diff-cover coverage.xml --fail-under=100 \
|
||||
--compare-branch=origin/master
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: coverage
|
||||
path: |
|
||||
coverage.xml
|
||||
build/coverage/html/
|
||||
@@ -0,0 +1,34 @@
|
||||
name: Build & test docs
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install libs
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install latexmk texlive-xetex
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[docs]
|
||||
- name: Building docs
|
||||
run: |
|
||||
sphinx-build --color -W --keep-going -b html docs build/sphinx/html
|
||||
sphinx-build --color -W --keep-going -b latex docs build/sphinx/latex
|
||||
make -C build/sphinx/latex all-pdf
|
||||
env:
|
||||
NO_COLOR: 1 # workaround for sphinx-contrib/autoprogram#76
|
||||
COLUMNS: 80 # also enable line wrapping for argparse
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: docs
|
||||
path: |
|
||||
build/sphinx/html/
|
||||
build/sphinx/latex/mpmath.pdf
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Linting with flake8, etc
|
||||
on: [workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
linter:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- run: pip install --upgrade .[develop]
|
||||
- run: python -We:invalid -m compileall -f mpmath -q
|
||||
- run: flake518 mpmath
|
||||
@@ -0,0 +1,35 @@
|
||||
name: Publish on PyPI
|
||||
on: [push, workflow_dispatch, workflow_call]
|
||||
jobs:
|
||||
build:
|
||||
name: Build distributions
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- run: pip install build
|
||||
- run: python -m build
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: build
|
||||
path: dist/
|
||||
publish-to-pypi:
|
||||
name: Publish distributions to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: build
|
||||
path: dist/
|
||||
merge-multiple: true
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
@@ -0,0 +1,64 @@
|
||||
name: test
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * 2'
|
||||
jobs:
|
||||
linter:
|
||||
uses: ./.github/workflows/linter.yml
|
||||
coverage:
|
||||
uses: ./.github/workflows/coverage.yml
|
||||
docs:
|
||||
uses: ./.github/workflows/docs.yml
|
||||
frozen-version:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Run frozen version test
|
||||
run: ./mpmath/tests/test_version_frozen.sh
|
||||
tests:
|
||||
needs:
|
||||
- linter
|
||||
- coverage
|
||||
- frozen-version
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14, 3.14t, 3.15, 3.15t]
|
||||
nogmpy: [false]
|
||||
purepy: [false]
|
||||
include:
|
||||
- python-version: "3.x"
|
||||
nogmpy: true
|
||||
- python-version: "3.x"
|
||||
purepy: true
|
||||
- python-version: pypy3.11
|
||||
purepy: true
|
||||
env:
|
||||
PYTEST_ADDOPTS: -n auto --durations=20
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade .[develop,gmpy2,gmp,ci]
|
||||
- run: pip uninstall -y gmpy2
|
||||
if: matrix.nogmpy
|
||||
- run: pip uninstall -y gmpy2 python-gmp
|
||||
if: matrix.purepy
|
||||
- run: pytest
|
||||
Reference in New Issue
Block a user