diff --git a/.chronus/changes/drop-python-39-pipeline-2026-4-28-5-30-0.md b/.chronus/changes/drop-python-39-pipeline-2026-4-28-5-30-0.md new file mode 100644 index 0000000000..1b9cd8dfbd --- /dev/null +++ b/.chronus/changes/drop-python-39-pipeline-2026-4-28-5-30-0.md @@ -0,0 +1,8 @@ +--- +changeKind: internal +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +Drop Python 3.9 from CI pipelines and pin the minimum Python version to 3.10 diff --git a/eng/pipelines/ci.yml b/eng/pipelines/ci.yml index 558c78a474..6bbb6e4f6e 100644 --- a/eng/pipelines/ci.yml +++ b/eng/pipelines/ci.yml @@ -49,20 +49,15 @@ jobs: strategy: matrix: - Linux_Python3.9: + Linux_Python3.10: OSName: "Linux" Pool: ${{ variables.LINUXPOOL }} OSVmImage: ${{ variables.LINUXVMIMAGE}} - PythonVersion: "3.9" - Windows_Python3.9: + PythonVersion: "3.10" + Windows_Python3.10: OSName: "Windows" Pool: ${{ variables.WINDOWSPOOL }} OSVmImage: ${{ variables.WINDOWSVMIMAGE}} - PythonVersion: "3.9" - Linux_Python3.10: - OSName: "Linux" - Pool: ${{ variables.LINUXPOOL }} - OSVmImage: ${{ variables.LINUXVMIMAGE}} PythonVersion: "3.10" Linux_Python3.11: OSName: "Linux" @@ -140,20 +135,15 @@ jobs: strategy: matrix: - Linux_Python3.9: + Linux_Python310: OSName: "Linux" Pool: ${{ variables.LINUXPOOL }} OSVmImage: ${{ variables.LINUXVMIMAGE}} - PythonVersion: "3.9" - Windows_Python3.9: + PythonVersion: "3.10" + Windows_Python310: OSName: "Windows" Pool: ${{ variables.WINDOWSPOOL }} OSVmImage: ${{ variables.WINDOWSVMIMAGE}} - PythonVersion: "3.9" - Linux_Python310: - OSName: "Linux" - Pool: ${{ variables.LINUXPOOL }} - OSVmImage: ${{ variables.LINUXVMIMAGE}} PythonVersion: "3.10" Linux_Python311: OSName: "Linux" diff --git a/eng/pipelines/generated-code-checks-template.yml b/eng/pipelines/generated-code-checks-template.yml index 3f0c63e5dd..5128bf1a22 100644 --- a/eng/pipelines/generated-code-checks-template.yml +++ b/eng/pipelines/generated-code-checks-template.yml @@ -10,7 +10,7 @@ steps: - script: npm run test -- --env=lint --flavor=${{ parameters.folderName }} displayName: Lint ${{ parameters.folderName }} - Python $(PythonVersion) workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.package}} - condition: and(eq(variables['PythonVersion'], '3.9'), or(contains('${{ parameters.folderName }}', 'version-tolerant'), eq('${{parameters.package}}', 'typespec-python'))) + condition: and(eq(variables['PythonVersion'], '3.10'), or(contains('${{ parameters.folderName }}', 'version-tolerant'), eq('${{parameters.package}}', 'typespec-python'))) - script: npm run test -- --env=mypy --flavor=${{ parameters.folderName }} displayName: Mypy ${{ parameters.folderName }} - Python $(PythonVersion) diff --git a/eng/pipelines/preview.yml b/eng/pipelines/preview.yml index 4040a14935..a409fefb3e 100644 --- a/eng/pipelines/preview.yml +++ b/eng/pipelines/preview.yml @@ -76,9 +76,9 @@ extends: versionSpec: 3.11 SdkInitializationSteps: - task: UsePythonVersion@0 - displayName: "Use Python 3.9" + displayName: "Use Python 3.10" inputs: - versionSpec: 3.9 + versionSpec: 3.10 - script: | echo "npm install -g @azure-tools/typespec-client-generator-cli" npm install -g @azure-tools/typespec-client-generator-cli diff --git a/eng/pipelines/publish-dev-release.yml b/eng/pipelines/publish-dev-release.yml index 6285827ee6..3dc9241c93 100644 --- a/eng/pipelines/publish-dev-release.yml +++ b/eng/pipelines/publish-dev-release.yml @@ -3,7 +3,7 @@ pr: none variables: NodeVersion: "20.x" - PythonVersion: "3.9" + PythonVersion: "3.10" TestFolder: "$(Build.SourcesDirectory)/test/" pool: @@ -16,9 +16,9 @@ steps: versionSpec: "$(NodeVersion)" - task: UsePythonVersion@0 - displayName: "Use Python 3.9" + displayName: "Use Python 3.10" inputs: - versionSpec: 3.9 + versionSpec: 3.10 - script: | cd $(Build.SourcesDirectory) diff --git a/eng/scripts/run_pylint.py b/eng/scripts/run_pylint.py index 7224cc3cea..81d0fcb52e 100644 --- a/eng/scripts/run_pylint.py +++ b/eng/scripts/run_pylint.py @@ -38,7 +38,7 @@ def _single_dir_pylint(mod): "--load-plugins=pylint_guidelines_checker", "--output-format=parseable", "--recursive=y", - "--py-version=3.9", + "--py-version=3.10", str(inner_class.absolute()), ] ) @@ -49,7 +49,7 @@ def _single_dir_pylint(mod): if __name__ == "__main__": - if sys.version_info >= (3, 10, 0): - # only run pylint with python 3.9 + if sys.version_info >= (3, 11, 0) or sys.version_info < (3, 10, 0): + # only run pylint with python 3.10 sys.exit(0) run_check("pylint", _single_dir_pylint, "Pylint")