Skip to content

Commit 6161fd9

Browse files
CopilotmsyycscbeddCopilot
authored
Drop Python 3.9, bump repo minimum to 3.10 (outside sdk/) (#46508)
* Initial plan * Drop Python 3.9, bump minimum Python to 3.10 (outside sdk/) Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/6c92999a-fe77-4d48-9037-58f7bc2aea0a Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update doc/dev/packaging.md Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com> * Reconcile remaining Python 3.8 references in doc/dev/packaging.md Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/aa3aacbc-bb69-49ed-bf89-9bc2c3d4cb9d Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 6937f74 commit 6161fd9

28 files changed

Lines changed: 39 additions & 52 deletions

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ azpysdk pylint .
6666
- [MyPy fixing guide](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/static_type_checking_cheat_sheet.md)
6767

6868
**REQUIREMENTS:**
69-
- Use Python 3.9 compatible environment
69+
- Use Python 3.10 compatible environment
7070
- Follow official fixing guidelines
7171
- Run `azpysdk mypy .` from the package directory
7272

.github/skills/ml/fix-mypy/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Read the issue to understand which files/modules and specific error codes to fix
6565
# Activate the provided virtual environment (e.g., envml, env, venv)
6666
.\<venv-name>\Scripts\Activate.ps1
6767
68-
# If creating new virtual environment (Python 3.9+):
68+
# If creating new virtual environment (Python 3.10+):
6969
python -m venv env
7070
.\env\Scripts\Activate.ps1
7171
```
@@ -85,7 +85,7 @@ pip install -r dev_requirements.txt
8585
pip install -e .
8686
```
8787

88-
**Important:** Use Python 3.9 compatible environment for mypy checks.
88+
**Important:** Use Python 3.10 compatible environment for mypy checks.
8989

9090
### Step 3: Identify Target Files (within activated venv)
9191

@@ -300,7 +300,7 @@ azpysdk mypy .
300300

301301
- Always read the existing code to understand type annotation patterns before making changes
302302
- Prefer following existing patterns over adding new complex types
303-
- Use Python 3.9+ compatible type hints (use `Optional[X]` instead of `X | None`)
303+
- Use Python 3.10+ compatible type hints (use `Optional[X]` instead of `X | None`)
304304
- If unsure about a fix, mark it for manual review
305305
- Some errors may require architectural changes - don't force fixes
306306
- Test the code after fixing to ensure functionality is preserved

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Python
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: '3.9'
19+
python-version: '3.10'
2020
cache: 'pip'
2121

2222
- name: Create and activate virtual environment

doc/dev/dataplane_generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For more questions and general overview of the process, please refer to <https:/
66

77
## Prerequisites
88

9-
- Python 3.9 or later is required
9+
- Python 3.10 or later is required
1010
- [download for windows](https://www.python.org/downloads/windows/)
1111
- linux
1212
- sudo apt install python3

doc/dev/mgmt/generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ IMPORTANT NOTE: All the commands prefixed by `python` in this page assumes you h
77
### Prerequisites
88

99
#### Setting Up Your Basic Environment
10-
- Python 3.9 or newer is required
10+
- Python 3.10 or newer is required
1111
- [Download for Windows](https://www.python.org/downloads/windows/)
1212
- For Linux:
1313
- Install Python 3 with `sudo apt install python3`

doc/dev/packaging.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ While this article provides an example using setup.py, this can also be achieved
2121

2222
We want to build sdist and wheels in order to follow the following constraints:
2323
- Solution should work with *recent* versions of pip and setuptools (not the very latest only, but not archaeology either)
24-
- Wheels must work with Python 3.8+
24+
- Wheels must work with Python 3.10+
2525
- mixed dev installation and PyPI installation should be explicitly addressed
2626

2727
# What do I do in my files to achieve that
@@ -59,7 +59,7 @@ The "packages" section MUST EXCLUDE the `azure` package. Example:
5959

6060
Since the package is Python 3 only, you must notify it in the setup.py as well:
6161
```python
62-
python_requires=">=3.8",
62+
python_requires=">=3.10",
6363
```
6464

6565
Example of a full setup.py
@@ -113,14 +113,12 @@ setup(
113113
'Programming Language :: Python',
114114
'Programming Language :: Python :: 3 :: Only',
115115
'Programming Language :: Python :: 3',
116-
'Programming Language :: Python :: 3.8',
117-
'Programming Language :: Python :: 3.9',
118116
'Programming Language :: Python :: 3.10',
119117
'Programming Language :: Python :: 3.11',
120118
'Programming Language :: Python :: 3.12',
121119
'License :: OSI Approved :: MIT License',
122120
],
123-
python_requires=">=3.8",
121+
python_requires=">=3.10",
124122
zip_safe=False,
125123
packages=find_packages(exclude=[
126124
'tests',
@@ -150,7 +148,7 @@ Since the package is Python 3 only, do NOT make this wheel universal. This usual
150148
- Remove "universal" from setup.cfg, or completely remove the file if it was the only option
151149
- In setup.py:
152150
- Remove `extra_requires`
153-
- Add `python_requires=">=3.8",`
151+
- Add `python_requires=">=3.10",`
154152
- Remove the Python 2 and 3.5/3.6 classifiers
155153
- Add classifier `Programming Language :: Python :: 3 :: Only`
156154
- Remove the "azure" check if applicable (see next note)

doc/dev/tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ testing infrastructure, and demonstrates how to write and run tests for a servic
3030

3131
## Set up your development environment
3232

33-
The Azure SDK Python team creates libraries that are compatible with Python 3.8 and up. We walk through setting up a
34-
Python virtual environment for Python 3.8, but having a virtual environment for each minor version can make it
33+
The Azure SDK Python team creates libraries that are compatible with Python 3.10 and up. We walk through setting up a
34+
Python virtual environment for Python 3.10, but having a virtual environment for each minor version can make it
3535
easier to debug PRs locally.
3636

37-
- Python 3.8+: Use the [python website](https://www.python.org/downloads/) or the one-click experience from the Windows store ([3.8](https://www.microsoft.com/p/python-38/9mssztt1n39l), [3.9](https://www.microsoft.com/p/python-39/9p7qfqmjrfp7), [3.10](https://www.microsoft.com/p/python-310/9pjpw5ldxlz5), [3.11](https://apps.microsoft.com/detail/9nrwmjp3717k?hl=en-us&gl=US), [3.12](https://apps.microsoft.com/detail/9ncvdn91xzqp?hl=en-us&gl=US)) (Windows only).
37+
- Python 3.10+: Use the [python website](https://www.python.org/downloads/) or the one-click experience from the Windows store ([3.10](https://www.microsoft.com/p/python-310/9pjpw5ldxlz5), [3.11](https://apps.microsoft.com/detail/9nrwmjp3717k?hl=en-us&gl=US), [3.12](https://apps.microsoft.com/detail/9ncvdn91xzqp?hl=en-us&gl=US)) (Windows only).
3838

3939

4040
```cmd

doc/tool_usage_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To utilize this feature, add `--isolate` to any `azpysdk` invocation:
6464
## Prerequisite
6565

6666
- You need to have Python installed
67-
- The monorepo requires a minimum of `python 3.9`, but `>=3.11` is required for the `sphinx` check due to compatibility constraints with external processes.
67+
- The monorepo requires a minimum of `python 3.10`, but `>=3.11` is required for the `sphinx` check due to compatibility constraints with external processes.
6868
- You may optionally use the ["uv"](https://docs.astral.sh/uv/) tool, which is fast and handles Python version and venv creation automatically.
6969

7070
## Initial setup

eng/pipelines/autorest_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pr:
1515

1616
variables:
1717
NodeVersion: '18.x'
18-
PythonVersion: '3.9'
18+
PythonVersion: '3.10'
1919
auto_rest_clone_url: 'https://github.com/Azure/autorest.python.git'
2020
source_path_azure_core: 'sdk/core/azure-core'
2121
source_path_azure_mgmt_core: 'sdk/core/azure-mgmt-core'

eng/pipelines/templates/jobs/regression.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ jobs:
8282
BuildTargetingString: ${{ parameters.BuildTargetingString }}
8383

8484
- task: UsePythonVersion@0
85-
displayName: 'Use Python 3.9'
85+
displayName: 'Use Python 3.10'
8686
inputs:
87-
versionSpec: '3.9'
87+
versionSpec: '3.10'
8888

8989
- template: /eng/pipelines/templates/steps/use-venv.yml
9090

0 commit comments

Comments
 (0)