Skip to content

Add python3 support

Add python3 support #1

Workflow file for this run

name: Test with Optional Dependencies
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
schedule:
# Run weekly to catch issues with dependency updates
- cron: '0 0 * * 0'
jobs:
test-extras:
name: Test with ${{ matrix.extras }} on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.11']
extras:
- 'tornado'
- 'flask'
- 'jinja2'
- 'redis'
- 'twisted'
- 'tornado,flask,jinja2'
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 ${{ matrix.extras }}
run: |
python -m pip install --upgrade pip
pip install -e ".[${{ matrix.extras }}]"
- name: Run tests
run: |
python -m unittest discover -s tests -p "test_*.py" -v 2>&1 | tee test_output.txt
# Count passed tests vs errors
echo "=== Test Summary ==="
grep -E "^(test_|Ran)" test_output.txt || true
# Check if core tests are passing (ignore import errors for optional deps)
if grep -q "FAILED" test_output.txt; then
errors=$(grep -c "ImportError.*No module named" test_output.txt || echo 0)
total_errors=$(grep -oE "errors=([0-9]+)" test_output.txt | grep -oE "[0-9]+" || echo 0)
if [ "$errors" -eq "$total_errors" ]; then
echo "All errors are due to missing optional dependencies - this is expected"
exit 0
else
echo "Found unexpected test failures"
exit 1
fi
fi