Skip to content

Add python3 support

Add python3 support #1

Workflow file for this run

name: Tests
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- 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
pip install -e ".[dev]"
- name: Run flake8
run: |
flake8 ioc/ tests/
- name: Run mypy (optional)
run: |
mypy ioc/ || true
continue-on-error: true
test-core:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install core dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run core tests
run: |
python -m unittest discover -s tests/ioc -p "test_*.py" -v
test-with-extras:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
extras: ['tornado', 'flask', 'jinja2', 'redis', 'twisted']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with extras
run: |
python -m pip install --upgrade pip
pip install -e ".[${{ matrix.extras }}]"
- name: Run tests for ${{ matrix.extras }}
run: |
if [ "${{ matrix.extras }}" = "tornado" ]; then
python -m unittest tests.ioc.extra.tornado.test_router -v || true
elif [ "${{ matrix.extras }}" = "jinja2" ]; then
python -m unittest tests.ioc.extra.jinja.test_helper -v || true
fi
continue-on-error: true
test-all-extras:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install all dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[tornado,flask,jinja2,redis,twisted,dev]"
- name: Run all tests
run: |
python -m unittest discover -s tests -p "test_*.py" -v
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install sphinx
- name: Build documentation
run: |
sphinx-build -nW -b html -d docs/_build/doctrees docs docs/_build/html
continue-on-error: true
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
python -m build
- name: Check package
run: |
twine check dist/*