From b58180a5414752a59b58ca312c68fce264d85deb Mon Sep 17 00:00:00 2001 From: Eduard van Valkenburg Date: Tue, 27 Aug 2024 18:45:09 +0200 Subject: [PATCH] Python: bump version to 1.8.1 (#8391) ### Motivation and Context Bumped the version to 1.8.1, slight updates in pyproject and make to build automatically. ### Description ### Contribution Checklist - [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 - [x] I didn't break anyone :smile: --- python/.pre-commit-config.yaml | 1 + python/LICENSE | 21 +++++++++++++++++++ python/Makefile | 8 +++++-- python/pyproject.toml | 8 ++++--- .../getting_started/00-getting-started.ipynb | 9 +++++--- .../01-basic-loading-the-kernel.ipynb | 9 +++++--- .../02-running-prompts-from-file.ipynb | 7 +++++-- .../03-prompt-function-inline.ipynb | 7 +++++-- .../04-kernel-arguments-chat.ipynb | 7 +++++-- .../05-using-the-planner.ipynb | 9 +++++--- .../06-memory-and-embeddings.ipynb | 11 +++++----- .../07-hugging-face-for-plugins.ipynb | 7 +++++-- .../08-native-function-inline.ipynb | 7 +++++-- .../09-groundedness-checking.ipynb | 7 +++++-- .../10-multiple-results-per-prompt.ipynb | 9 +++++--- .../11-streaming-completions.ipynb | 7 +++++-- .../weaviate-persistent-memory.ipynb | 6 +++++- python/semantic_kernel/__init__.py | 2 +- 18 files changed, 104 insertions(+), 38 deletions(-) create mode 100644 python/LICENSE diff --git a/python/.pre-commit-config.yaml b/python/.pre-commit-config.yaml index e964cebe7613..56ae96fa7e1e 100644 --- a/python/.pre-commit-config.yaml +++ b/python/.pre-commit-config.yaml @@ -43,6 +43,7 @@ repos: hooks: # Update the uv lockfile - id: uv-lock + files: ^\./python/(uv\.lock|pyproject\.toml)$ - repo: local hooks: - id: mypy diff --git a/python/LICENSE b/python/LICENSE new file mode 100644 index 000000000000..9e841e7a26e4 --- /dev/null +++ b/python/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/python/Makefile b/python/Makefile index a4eb077db5d7..060ee561bfa1 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,6 +1,6 @@ SHELL = /bin/bash -.PHONY: help install clean +.PHONY: help install clean build .SILENT: all: install @@ -22,6 +22,7 @@ help: echo " install-sk - install Semantic Kernel and all dependencies" echo " install-pre-commit - install pre-commit hooks" echo " clean - remove the virtualenvs" + echo " build - build the project" echo "" echo -e "\033[1mVARIABLES:\033[0m" echo " PYTHON_VERSION - Python version to use. Default is 3.10" @@ -67,4 +68,7 @@ install-sk: .ONESHELL: clean: # Remove the virtualenv - rm -rf .venv \ No newline at end of file + rm -rf .venv + +build: + uvx --from build pyproject-build --installer uv \ No newline at end of file diff --git a/python/pyproject.toml b/python/pyproject.toml index c012607968bc..f59e68580514 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -5,9 +5,8 @@ authors = [{ name = "Microsoft", email = "SK-Support@microsoft.com"}] readme = "pip/README.md" # Version read from __version__ field in __init__.py by Flit dynamic = ["version"] -packages = [{include = "semantic_kernel"}] requires-python = ">=3.10,<3.13" -license = {file = "../LICENSE"} +license = {file = "LICENSE"} urls.homepage = "https://learn.microsoft.com/en-us/semantic-kernel/overview/" urls.source = "https://github.com/microsoft/semantic-kernel/tree/main/python" urls.release_notes = "https://github.com/microsoft/semantic-kernel/releases?q=tag%3Apython-1&expanded=true" @@ -191,7 +190,10 @@ min-file-size = 1 targets = ["semantic_kernel"] exclude_dirs = ["tests"] +[tool.flit.module] +name = "semantic_kernel" + [build-system] -requires = ["flit-core >= 3.8"] +requires = ["flit-core >= 3.9,<4.0"] build-backend = "flit_core.buildapi" diff --git a/python/samples/getting_started/00-getting-started.ipynb b/python/samples/getting_started/00-getting-started.ipynb index 950d9ce88a32..c7997783b82e 100644 --- a/python/samples/getting_started/00-getting-started.ipynb +++ b/python/samples/getting_started/00-getting-started.ipynb @@ -16,8 +16,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { @@ -229,4 +232,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/python/samples/getting_started/01-basic-loading-the-kernel.ipynb b/python/samples/getting_started/01-basic-loading-the-kernel.ipynb index 24cae548a047..d74ac91859e5 100644 --- a/python/samples/getting_started/01-basic-loading-the-kernel.ipynb +++ b/python/samples/getting_started/01-basic-loading-the-kernel.ipynb @@ -23,8 +23,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { @@ -196,7 +199,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.10.12" }, "polyglot_notebook": { "kernelInfo": { diff --git a/python/samples/getting_started/02-running-prompts-from-file.ipynb b/python/samples/getting_started/02-running-prompts-from-file.ipynb index 4346ee3479d9..3d975adca1c2 100644 --- a/python/samples/getting_started/02-running-prompts-from-file.ipynb +++ b/python/samples/getting_started/02-running-prompts-from-file.ipynb @@ -34,8 +34,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/03-prompt-function-inline.ipynb b/python/samples/getting_started/03-prompt-function-inline.ipynb index 1b2fd84dede3..27ce5177424d 100644 --- a/python/samples/getting_started/03-prompt-function-inline.ipynb +++ b/python/samples/getting_started/03-prompt-function-inline.ipynb @@ -24,8 +24,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/04-kernel-arguments-chat.ipynb b/python/samples/getting_started/04-kernel-arguments-chat.ipynb index bd41cf5be190..3e9ad0861860 100644 --- a/python/samples/getting_started/04-kernel-arguments-chat.ipynb +++ b/python/samples/getting_started/04-kernel-arguments-chat.ipynb @@ -26,8 +26,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/05-using-the-planner.ipynb b/python/samples/getting_started/05-using-the-planner.ipynb index 07869285daa2..c8e7f4d58994 100644 --- a/python/samples/getting_started/05-using-the-planner.ipynb +++ b/python/samples/getting_started/05-using-the-planner.ipynb @@ -31,8 +31,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { @@ -583,4 +586,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +} diff --git a/python/samples/getting_started/06-memory-and-embeddings.ipynb b/python/samples/getting_started/06-memory-and-embeddings.ipynb index 637f0ce70496..37ad963e983f 100644 --- a/python/samples/getting_started/06-memory-and-embeddings.ipynb +++ b/python/samples/getting_started/06-memory-and-embeddings.ipynb @@ -36,10 +36,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0\n", - "%pip install azure-core==1.30.1\n", - "%pip install azure-search-documents==11.8.0b4" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel[azure]\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { @@ -611,7 +612,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/python/samples/getting_started/07-hugging-face-for-plugins.ipynb b/python/samples/getting_started/07-hugging-face-for-plugins.ipynb index c9f6a1a01263..22e27fd6cdf0 100644 --- a/python/samples/getting_started/07-hugging-face-for-plugins.ipynb +++ b/python/samples/getting_started/07-hugging-face-for-plugins.ipynb @@ -20,8 +20,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel[hugging_face]==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/08-native-function-inline.ipynb b/python/samples/getting_started/08-native-function-inline.ipynb index fbe2012bb967..0ce818d6f757 100644 --- a/python/samples/getting_started/08-native-function-inline.ipynb +++ b/python/samples/getting_started/08-native-function-inline.ipynb @@ -54,8 +54,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/09-groundedness-checking.ipynb b/python/samples/getting_started/09-groundedness-checking.ipynb index 367d1949d6a7..5e87acce7e68 100644 --- a/python/samples/getting_started/09-groundedness-checking.ipynb +++ b/python/samples/getting_started/09-groundedness-checking.ipynb @@ -35,8 +35,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/10-multiple-results-per-prompt.ipynb b/python/samples/getting_started/10-multiple-results-per-prompt.ipynb index 14d893a24b8b..c3edd2fd5c45 100644 --- a/python/samples/getting_started/10-multiple-results-per-prompt.ipynb +++ b/python/samples/getting_started/10-multiple-results-per-prompt.ipynb @@ -33,8 +33,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { @@ -501,7 +504,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/python/samples/getting_started/11-streaming-completions.ipynb b/python/samples/getting_started/11-streaming-completions.ipynb index 25dff07897d1..ca26d21ead5c 100644 --- a/python/samples/getting_started/11-streaming-completions.ipynb +++ b/python/samples/getting_started/11-streaming-completions.ipynb @@ -26,8 +26,11 @@ "metadata": {}, "outputs": [], "source": [ - "# Note: if using a Poetry virtual environment, do not run this cell\n", - "%pip install semantic-kernel==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb b/python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb index 3b7821605e7b..a9b2635e5442 100644 --- a/python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb +++ b/python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb @@ -156,7 +156,11 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install semantic-kernel[weaviate]==1.8.0" + "# Note: if using a virtual environment, do not run this cell\n", + "%pip install -U semantic-kernel[weaviate]\n", + "from semantic_kernel import __version__\n", + "\n", + "__version__" ] }, { diff --git a/python/semantic_kernel/__init__.py b/python/semantic_kernel/__init__.py index 08cd98c223d2..003edae59a41 100644 --- a/python/semantic_kernel/__init__.py +++ b/python/semantic_kernel/__init__.py @@ -2,5 +2,5 @@ from semantic_kernel.kernel import Kernel -__version__ = "1.8.0" +__version__ = "1.8.1" __all__ = ["Kernel", "__version__"]