Version 7.1.0 #278
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Tests | |
on: | |
push: | |
branches: [ test, tests ] | |
pull_request: | |
branches: [ master, development, develop, test, tests ] | |
jobs: | |
package-checks: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy-3.8"] | |
os: [ubuntu-latest, macos-11, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors, undefined names or print statements | |
flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics | |
# exit-zero treats all errors as warnings. | |
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203 | |
- name: Run mypy | |
run: mypy box | |
- name: Build Wheel and check distribution log description | |
run: | | |
python setup.py sdist bdist_wheel | |
twine check dist/* | |
- name: Test packaged wheel on *nix | |
if: matrix.os != 'windows-latest' | |
run: | | |
pip install dist/*.whl | |
rm -rf box | |
python -m pytest -vv | |
- name: Test packaged wheel on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
$wheel = (Get-ChildItem dist\*.whl | Sort lastWriteTime | Select-Object -last 1).Name | |
pip install dist\${wheel} | |
Remove-item box -recurse -force | |
python -m pytest -vv | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python_box | |
path: dist/*.whl | |
package-manylinux-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython | |
- uses: RalfG/[email protected]_x86_64 | |
with: | |
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' | |
build-requirements: 'cython' | |
- name: Test packaged wheel on linux | |
run: | | |
pip install dist/*cp310-manylinux*.whl | |
rm -rf box | |
python -m pytest -vv | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python_box | |
path: dist/*-manylinux*.whl | |
test: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
os: [ubuntu-latest, macos-11, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
pip install setuptools wheel Cython | |
python setup.py build_ext --inplace | |
- name: Test with pytest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pytest --cov=box -vv test/ |