Skip to content

Commit

Permalink
Advertise support for Python 3.11 (#126)
Browse files Browse the repository at this point in the history
- Remove coverage submission for Python 2.7
  • Loading branch information
rmartin16 authored Oct 26, 2022
1 parent e72ae25 commit 405fd45
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 312 deletions.
25 changes: 0 additions & 25 deletions .coveragerc

This file was deleted.

68 changes: 38 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:
workflow_dispatch:

env:
LATEST_PYTHON_VER: "3.10"
LATEST_PYTHON_VER: "3.11"
LATEST_QBT_VER: "v4.4.5"
SUBMIT_COVERAGE_VERSIONS: "2.7, 3.10"
SUBMIT_COVERAGE_VERSIONS: '[ "3.11" ]'
QBITTORRENTAPI_HOST: "localhost:8080"
QBITTORRENTAPI_PASSWORD: "adminadmin"
QBITTORRENTAPI_USERNAME: "admin"
Expand All @@ -32,26 +32,24 @@ jobs:
steps:
- name: Declare Latest qBittorrent Version
id: set-qbittorrent-latest-version
run: echo "::set-output name=qbittorrent-latest-version::${{ env.LATEST_QBT_VER }}"
run: echo "qbittorrent-latest-version=${{ env.LATEST_QBT_VER }}" >> ${GITHUB_OUTPUT}

- name: Declare Latest Python Version
id: set-python-latest-version
run: echo "::set-output name=python-latest-version::${{ env.LATEST_PYTHON_VER }}"

- name: Branch
run: echo Branch ${{ github.ref }} ${{ github.head_ref }}
run: echo "python-latest-version=${{ env.LATEST_PYTHON_VER }}" >> ${GITHUB_OUTPUT}

- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Set up Python ${{ env.LATEST_PYTHON_VER }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.LATEST_PYTHON_VER }}
cache: 'pip'
check-latest: true
cache-dependency-path: ${{ github.workspace }}/setup.cfg

- name: Lint with Pre-commit
- name: Lint
uses: pre-commit/action@v3.0.0

Tests:
Expand All @@ -60,13 +58,18 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 10
env:
IS_QBT_DEV: ${{ matrix.IS_QBT_DEV }}
QBT_VER: ${{ matrix.QBT_VER }}
strategy:
matrix:
PYTHON_VER: [ "${{ needs.verify.outputs.python-latest-version }}" ]
QBT_VER: [ v4.4.4, v4.3.9, v4.3.5, v4.3.4.1, v4.3.3, v4.3.2, v4.3.1, v4.3.0.1, v4.2.5, v4.2.0, v4.1.6, v4.1.0 ]
include:
# test all python versions against latest qBittorrent
- PYTHON_VER: "3.11-dev"
# - PYTHON_VER: "3.12-dev"
# QBT_VER: ${{ needs.verify.outputs.qbittorrent-latest-version }}
- PYTHON_VER: "3.11"
QBT_VER: ${{ needs.verify.outputs.qbittorrent-latest-version }}
- PYTHON_VER: "3.10"
QBT_VER: ${{ needs.verify.outputs.qbittorrent-latest-version }}
Expand Down Expand Up @@ -100,38 +103,40 @@ jobs:
PYTHON_VER: ${{ needs.verify.outputs.python-latest-version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Set up Python ${{ matrix.PYTHON_VER }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.PYTHON_VER }}
cache: 'pip'
check-latest: true
cache-dependency-path: ${{ github.workspace }}/setup.cfg

- name: Start qBittorrent ${{ matrix.QBT_VER }}
run: docker run ${{ env.DOCKER_ARGS }} ${{ env.DOCKER_IMAGE_NAME }}:${{ matrix.QBT_VER }}-debug

- name: Test with pytest
run: |
pip install .[test]
IS_QBT_DEV=${{ matrix.IS_QBT_DEV }}
QBT_VER=${{ matrix.QBT_VER }}
pytest
- name: Install
run: pip install .[test]

- name: Test
run: pytest

- name: qBittorrent Log
run: docker logs qbt

- name: Upload Coverage to Codecov
if: ((contains(env.SUBMIT_COVERAGE_VERSIONS, matrix.PYTHON_VER)) && ((github.event_name == 'pull_request') || (github.event_name == 'push')))
uses: codecov/codecov-action@v3
if: |
contains(fromJson(env.SUBMIT_COVERAGE_VERSIONS), matrix.PYTHON_VER)
&& contains(fromJson('["push", "pull_request"]'), github.event_name)
uses: codecov/codecov-action@v3.1.1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Send mail
if: failure()
uses: dawidd6/action-send-mail@v3
uses: dawidd6/action-send-mail@v3.7.1
with:
server_address: smtp.gmail.com
server_port: 587
Expand All @@ -153,13 +158,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Set up Python ${{ env.LATEST_PYTHON_VER }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.LATEST_PYTHON_VER }}
cache: 'pip'
cache-dependency-path: ${{ github.workspace }}/setup.cfg

- name: Install Build Tools
run: python -m pip install -U pip setuptools wheel twine build
Expand All @@ -185,13 +191,14 @@ jobs:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Set up Python ${{ env.LATEST_PYTHON_VER }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.LATEST_PYTHON_VER }}
cache: 'pip'
cache-dependency-path: ${{ github.workspace }}/setup.cfg

- name: Install in Dev Mode
run: |
Expand All @@ -210,16 +217,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Set up Python ${{ env.LATEST_PYTHON_VER }}
uses: actions/setup-python@v4
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.LATEST_PYTHON_VER }}
cache: 'pip'
cache-dependency-path: ${{ github.workspace }}/setup.cfg

- name: Install Doc Build Requirements
run: python -m pip install -r requirements-dev.txt
- name: Install requirements
run: python -m pip install .[dev]

- name: Build Docs
run: |
Expand Down
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- dev
Loading

0 comments on commit 405fd45

Please sign in to comment.