Skip to content

Commit

Permalink
feat: adds support for python 3.13
Browse files Browse the repository at this point in the history
* Add support for Python 3.13

Fixes #704

Add support for Python 3.13 and update dependencies.

* **pyproject.toml**
  - Add Python 3.13 to the `requires-python` field.
  - Add Python 3.13 to the `classifiers` field.
  - Set higher requirement for all `microsoft-kiota-....` packages to at least 1.8.0.

* **.github/workflows/build.yml**
  - Add Python 3.13 to the `matrix` for testing.

* **requirements-dev.txt**
  - Update dependencies to be compatible with Python 3.13.

* **tests/conftest.py**
  - Add a test to check for Python 3.13 compatibility.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoftgraph/msgraph-sdk-python-core/issues/704?shareId=XXXX-XXXX-XXXX-XXXX).

* Update `pyproject.toml` to support Python 3.13 and set higher package requirements

* Add Python 3.13 to the `requires-python` field
* Add Python 3.13 to the `classifiers` field
* Set higher requirement for all `microsoft-kiota-....` packages to at least 1.8.0

* chore: Copilot added something it shouldn't had

* fix(ci): Publish pipeline to 3.13

* fix: Python 3.13 changes to typing

* chore: revert typing changes

---------

Co-authored-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Andrew Omondi <andrew.omondi@microsoft.com>
  • Loading branch information
3 people authored Feb 3, 2025
1 parent 471018e commit b972a20
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/python:3.9-bookworm",
// "image": "mcr.microsoft.com/devcontainers/python:3.10-bookworm",
// "image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm",
// "image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
// "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
// "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
"image": "mcr.microsoft.com/devcontainers/python:3.13-bullseye",

"features": {
"ghcr.io/hspaans/devcontainer-features/pytest:1": {},
"ghcr.io/devcontainers-extra/features/pylint:2": {},
"ghcr.io/devcontainers-extra/features/poetry:2": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "git config --global core.autocrlf true && pip3 install --user -r requirements-dev.txt",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": ["ms-python.python"]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"editor.formatOnSave": true
"editor.formatOnSave": true,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ version = "1.2.1"
authors = [{name = "Microsoft", email = "graphtooling+python@microsoft.com"}]
description = "Core component of the Microsoft Graph Python SDK"
dependencies = [
"microsoft-kiota-abstractions >=1.0.0,<2.0.0",
"microsoft-kiota-authentication-azure >=1.0.0,<2.0.0",
"microsoft-kiota-http >=1.0.0,<2.0.0",
"microsoft-kiota-abstractions >=1.8.0,<2.0.0",
"microsoft-kiota-authentication-azure >=1.8.0,<2.0.0",
"microsoft-kiota-http >=1.8.0,<2.0.0",
"httpx[http2] >=0.23.0",
]
requires-python = ">=3.9"
Expand All @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]

Expand Down

0 comments on commit b972a20

Please sign in to comment.