Skip to content

Introduce the "denoise" option to try_real and try_forceint (and real) #322

Introduce the "denoise" option to try_real and try_forceint (and real)

Introduce the "denoise" option to try_real and try_forceint (and real) #322

Workflow file for this run

name: Tests
# Only run on branches (e.g. not tags)
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
# Note, clang is used on macos, even though it says gcc
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install pytest pytest-faulthandler hypothesis typing_extensions numpy
- name: Patch Doctests
run: python dev/patch_doctest.py
- name: Set CFLAGS
if: matrix.os == 'ubuntu-latest'
# Need no optimization for code coverage
run: echo CFLAGS="--coverage -Og" >> $GITHUB_ENV
- name: Build and Install Using pip
if: matrix.os != 'ubuntu-latest'
run: |
python setup.py build # to see compilation output
python -m pip install --editable .
- name: Build and Install Using setuptools
if: matrix.os == 'ubuntu-latest'
run: python setup.py install # to see the compilation output and get coverage
- name: Run Doctests
run: python -m doctest fastnumbers
- name: Run Unit Tests
run: pytest --hypothesis-profile=standard --doctest-glob=README.rst
- name: Upload to CodeCov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
gcov: true
test_no_numpy:
name: Try Without NumpPy
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install --editable .
- name: Ensure Run Without Error
run: python -c "import fastnumbers; print(fastnumbers.try_float('8.6'))"
tests_aarch64:
name: Tests on aarch64
strategy:
matrix:
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
runs-on: ubuntu-latest
env:
py: /opt/python/${{ matrix.pyver }}/bin/python
img: quay.io/pypa/manylinux2014_aarch64
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
- name: Run tests on aarch64
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc '${{ env.py }} -m venv .env && \
source .env/bin/activate && \
echo -e "\e[1;34m Install Dependencies \e[0m" && \
python -m pip install --upgrade pip && \
python -m pip install pytest pytest-faulthandler hypothesis typing_extensions numpy && \
echo -e "\e[1;34m Run Tests \e[0m" && \
python -m pip install --editable . && \
pytest --hypothesis-profile=fast && \
deactivate'