Files
semantic-kernel/.github/workflows/python-lint.yml
T
Eduard van Valkenburg 299094a493 Python: drop support for python before 3.10 (#5947)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This PR drops support for python 3.8 and 3.9.

Python 3.8 will go out of support in October 2024 and people should not
be building on top of that now.
Python 3.10 introduces the new style of typing and for
KernelFunctionFromMethod that is a crucial feature and maintaining that
with backward compatibility is a lot of work and limits us, hence we
will also drop support for 3.9.

Closes #5628

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Changed pyproject to reflect this
Changed CICD to only run on 3.10, 3.11 and 3.12.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2024-04-22 13:42:49 +02:00

74 lines
2.0 KiB
YAML

name: Python Code Quality Checks
on:
workflow_dispatch:
pull_request:
branches: [ "main", "feature*" ]
paths:
- 'python/**'
jobs:
ruff:
if: '!cancelled()'
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "/root/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install Semantic Kernel
run: cd python && poetry install --no-ansi
- name: Run ruff
run: cd python && poetry run ruff check .
black:
if: '!cancelled()'
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "/root/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install Semantic Kernel
run: cd python && poetry install --no-ansi
- name: Run black
run: cd python && poetry run black --check .
mypy:
if: '!cancelled()'
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "/root/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install Semantic Kernel
run: cd python && poetry install --no-ansi
- name: Run mypy
run: cd python && poetry run mypy -p semantic_kernel --config-file=mypy.ini