mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
Python unit test GitHub Action (#418)
This will run Python unit tests when code is pushed to the branch. ### Description - Runs `poetry run pytest` on ubuntu-latest, macos-latest, and windows-latest for python versions 3.8, 3.9, and 3.10 - This action was run when this workflow was pushed to my forked branch: https://github.com/mkarle/semantic-kernel/actions/runs/4672544786
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# This workflow will install Python dependencies and run tests with a variety of Python versions and OSes
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Python tests
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install poetry pytest
|
||||
cd python && poetry install
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
cd python && poetry run pytest
|
||||
+5
-2
@@ -1,6 +1,6 @@
|
||||
# System setup
|
||||
|
||||
To get started, you'll need VSCode and a local installation of Python 3.x.
|
||||
To get started, you'll need VSCode and a local installation of at least Python 3.8.
|
||||
|
||||
You can run:
|
||||
|
||||
@@ -84,4 +84,7 @@ it will prompt you to install them).
|
||||
|
||||
# Tests
|
||||
|
||||
You should be able to run the example under the [tests](tests) folder.
|
||||
You should be able to run the examples under the [tests/end-to-end](tests/end-to-end/) folder.
|
||||
Run pytests with the following:
|
||||
|
||||
poetry run pytest
|
||||
|
||||
+4
-5
@@ -19,9 +19,9 @@ AZURE_OPENAI_DEPLOYMENT_NAME=""
|
||||
## Using Poetry
|
||||
|
||||
First, navigate to the directory containing this README using your chosen shell.
|
||||
You will need to have Python 3.10 installed.
|
||||
You will need to have at least Python 3.8 installed.
|
||||
|
||||
Install the Poetry package manager and create a project virtual environment. (Note: we require at least Poetry 1.2.0 and Python 3.10.)
|
||||
Install the Poetry package manager and create a project virtual environment. (Note: we require at least Poetry 1.2.0 and Python 3.8.)
|
||||
|
||||
```bash
|
||||
# Install poetry package
|
||||
@@ -32,10 +32,9 @@ poetry install
|
||||
poetry shell
|
||||
```
|
||||
|
||||
|
||||
# Get Started with Semantic Kernel ⚡
|
||||
|
||||
## Example: Running a simple prompt.
|
||||
## Example: Running a simple prompt
|
||||
|
||||
```python
|
||||
import semantic_kernel as sk
|
||||
@@ -64,7 +63,7 @@ Give me the TLDR in exactly 5 words.""")
|
||||
print(prompt()) # => Robots must not harm humans.
|
||||
```
|
||||
|
||||
## Example: Turn prompts into **reusable functions** with input parameters.
|
||||
## Example: Turn prompts into **reusable functions** with input parameters
|
||||
|
||||
```python
|
||||
# Create a reusable function with one input parameter
|
||||
|
||||
Reference in New Issue
Block a user