Support for Python 3.12 (#1317)

* support for Python 3.12

* add python 3.12 to workflows

* version string fix

* retrieval chat

* teachability

* workflow

* redistribute notebook tests

* fix incorrect notebook introduction

* update banner; remove unused imports; update openai workflow

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
This commit is contained in:
Eric Zhu 2024-01-17 23:15:06 -08:00 committed by GitHub
parent 0f59322bc3
commit 22e36cbb10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 50 additions and 51 deletions

View File

@ -5,14 +5,14 @@ name: Build
on:
push:
branches: ['main']
branches: ["main"]
paths:
- 'autogen/**'
- 'test/**'
- '.github/workflows/build.yml'
- 'setup.py'
- "autogen/**"
- "test/**"
- ".github/workflows/build.yml"
- "setup.py"
pull_request:
branches: ['main']
branches: ["main"]
merge_group:
types: [checks_requested]
@ -22,13 +22,12 @@ concurrency:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}

View File

@ -5,12 +5,12 @@ name: ContribTests
on:
pull_request:
branches: ['main', 'dev/v0.2']
branches: ["main"]
paths:
- 'autogen/**'
- 'test/agentchat/contrib/**'
- '.github/workflows/contrib-tests.yml'
- 'setup.py'
- "autogen/**"
- "test/agentchat/contrib/**"
- ".github/workflows/contrib-tests.yml"
- "setup.py"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
@ -67,7 +67,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
@ -82,7 +82,7 @@ jobs:
run: |
pip install -e .
- name: Test Compression
if: matrix.python-version != '3.10' # diversify the python versions
if: matrix.python-version != '3.10' # diversify the python versions
run: |
pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai
- name: Coverage
@ -104,7 +104,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
@ -119,7 +119,7 @@ jobs:
run: |
pip install -e .
- name: Test GPTAssistantAgent
if: matrix.python-version != '3.11' # diversify the python versions
if: matrix.python-version != '3.11' # diversify the python versions
run: |
pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai
- name: Coverage
@ -156,7 +156,7 @@ jobs:
run: |
pip install -e .[teachable]
- name: Test TeachableAgent
if: matrix.python-version != '3.9' # diversify the python versions
if: matrix.python-version != '3.9' # diversify the python versions
run: |
pytest test/agentchat/contrib/test_teachable_agent.py --skip-openai
- name: Coverage
@ -178,7 +178,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}

View File

@ -5,20 +5,20 @@ name: OpenAI
on:
pull_request_target:
branches: ['main']
branches: ["main"]
paths:
- 'autogen/**'
- 'test/**'
- 'notebook/agentchat_auto_feedback_from_code_execution.ipynb'
- 'notebook/agentchat_function_call.ipynb'
- '.github/workflows/openai.yml'
- "autogen/**"
- "test/**"
- "notebook/agentchat_auto_feedback_from_code_execution.ipynb"
- "notebook/agentchat_function_call.ipynb"
- ".github/workflows/openai.yml"
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
environment: openai1
steps:

View File

@ -1,6 +1,6 @@
[![PyPI version](https://badge.fury.io/py/pyautogen.svg)](https://badge.fury.io/py/pyautogen)
[![Build](https://github.com/microsoft/autogen/actions/workflows/python-package.yml/badge.svg)](https://github.com/microsoft/autogen/actions/workflows/python-package.yml)
![Python Version](https://img.shields.io/badge/3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
![Python Version](https://img.shields.io/badge/3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
[![Downloads](https://static.pepy.tech/badge/pyautogen/week)](https://pepy.tech/project/pyautogen)
[![](https://img.shields.io/discord/1153072414184452236?logo=discord&style=flat)](https://discord.gg/pAbnFJrkgZ)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40pyautogen)](https://twitter.com/pyautogen)
@ -69,7 +69,7 @@ Find detailed instructions for users [here](https://microsoft.github.io/autogen/
### Option 2. Install AutoGen Locally
AutoGen requires **Python version >= 3.8, < 3.12**. It can be installed from pip:
AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:
```bash
pip install pyautogen

View File

@ -15,7 +15,7 @@
"id": "9a71fa36",
"metadata": {},
"source": [
"# Auto Generated Agent Chat: Task Solving with Provided Tools as Functions\n",
"# Auto Generated Agent Chat: Task Solving with Provided Tools as Functions (Asynchronous Function Calls)\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool, or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation. Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n",
"\n",
@ -23,9 +23,9 @@
"\n",
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install the [mathchat] option since we will import functions from `MathUserProxyAgent`:\n",
"AutoGen requires `Python>=3.8`. To run this notebook example, please install `pyautogen`:\n",
"```bash\n",
"pip install \"pyautogen[mathchat]\"\n",
"pip install pyautogen\n",
"```"
]
},
@ -36,7 +36,7 @@
"metadata": {},
"outputs": [],
"source": [
"# %pip install \"pyautogen[mathchat]~=0.1.0\""
"# %pip install \"pyautogen>=0.2.6\""
]
},
{
@ -390,7 +390,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.5"
}
},
"nbformat": 4,

View File

@ -61,5 +61,5 @@ setuptools.setup(
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.8, <3.12",
python_requires=">=3.8,<3.13",
)

View File

@ -46,24 +46,24 @@ def run_notebook(input_nb, output_nb="executed_openai_notebook.ipynb", save=Fals
@pytest.mark.skipif(
skip or not sys.version.startswith("3.11"),
reason="do not run if openai is not installed or py!=3.11",
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
)
def test_agentchat_auto_feedback_from_code(save=False):
run_notebook("agentchat_auto_feedback_from_code_execution.ipynb", save=save)
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.11"),
reason="do not run if openai is not installed or py!=3.11",
)
def _test_oai_completion(save=False):
run_notebook("oai_completion.ipynb", save=save)
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.12"),
reason="do not run if openai is not installed or py!=3.12",
)
def test_agentchat_function_call(save=False):
run_notebook("agentchat_function_call.ipynb", save=save)
@ -78,32 +78,32 @@ def test_agentchat_function_call_currency_calculator(save=False):
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.11"),
reason="do not run if openai is not installed or py!=3.11",
)
def test_agentchat_function_call_async(save=False):
run_notebook("agentchat_function_call_async.ipynb", save=save)
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.12"),
reason="do not run if openai is not installed or py!=3.12",
)
def _test_agentchat_MathChat(save=False):
run_notebook("agentchat_MathChat.ipynb", save=save)
@pytest.mark.skipif(
skip or not sys.version.startswith("3.11"),
reason="do not run if openai is not installed or py!=3.11",
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
)
def _test_oai_chatgpt_gpt4(save=False):
run_notebook("oai_chatgpt_gpt4.ipynb", save=save)
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.11"),
reason="do not run if openai is not installed or py!=3.11",
)
def _test_hierarchy_flow_using_select_speaker(save=False):
# TODO: recover this test after rewriting after the new group chat api
@ -111,8 +111,8 @@ def _test_hierarchy_flow_using_select_speaker(save=False):
@pytest.mark.skipif(
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
skip or not sys.version.startswith("3.12"),
reason="do not run if openai is not installed or py!=3.12",
)
def test_graph_modelling_language_using_select_speaker(save=False):
run_notebook("agentchat_graph_modelling_language_using_select_speaker.ipynb", save=save)

View File

@ -151,7 +151,7 @@ Now, you're ready to install AutoGen in the virtual environment you've just crea
## Python
AutoGen requires **Python version >= 3.8, < 3.12**. It can be installed from pip:
AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:
```bash
pip install pyautogen