Skip to content

Commit

Permalink
Upgrade to Python 3.8 as minimal required version.
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo13 committed Oct 6, 2023
1 parent 2622ef7 commit 6f2eb27
Show file tree
Hide file tree
Showing 15 changed files with 132 additions and 157 deletions.
6 changes: 3 additions & 3 deletions .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ runs:
node-version: ${{ inputs.node_version }}
cache: 'npm'

# Minimum supported version is Python 3.7
- name: Use Python 3.7
# Minimum supported version is Python 3.8
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Pip cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'

- name: Pip cache
uses: actions/cache@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.special-working-directory-relative }}

# Install bundled libs using 3.7 even though you test it on other versions.
- name: Use Python 3.7
# Install bundled libs using 3.8 even though you test it on other versions.
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'

- name: Update pip, install wheel and nox
run: python -m pip install -U pip wheel nox
Expand All @@ -68,7 +68,7 @@ jobs:
run: python -m nox --session install_bundled_libs
shell: bash

# Now that the bundle is installed to target using python 3.7
# Now that the bundle is installed to target using python 3.8
# switch back the python we want to test with
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ jobs:
with:
path: ${{ env.special-working-directory-relative }}

# Install bundled libs using 3.7 even though you test it on other versions.
- name: Use Python 3.7
# Install bundled libs using 3.8 even though you test it on other versions.
- name: Use Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'

- name: Update pip, install wheel and nox
run: python -m pip install -U pip wheel nox
Expand All @@ -73,7 +73,7 @@ jobs:
run: python -m nox --session install_bundled_libs
shell: bash

# Now that the bundle is installed to target using python 3.7
# Now that the bundle is installed to target using python 3.8
# switch back the python we want to test with
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Visual Studio Code extension that provides import sorting using `isort`. The e

Note:

- This extension is supported for all [actively supported versions](https://devguide.python.org/#status-of-python-branches) of the `python` language (i.e., python >= 3.7).
- This extension is supported for all [actively supported versions](https://devguide.python.org/#status-of-python-branches) of the `python` language (i.e., python >= 3.8).
- The bundled `isort` is only used if there is no installed version of `isort` found in the selected `python` environment.
- Minimum supported version of `isort` is `5.10.1`.

Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extends:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
versionSpec: '3.8'
addToPath: true
architecture: 'x64'
displayName: Select Python version
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extends:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
versionSpec: '3.8'
addToPath: true
architecture: 'x64'
displayName: Select Python version
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _update_npm_packages(session: nox.Session) -> None:
session.run("npm", "install", external=True)


@nox.session(python="3.7")
@nox.session(python="3.8")
def install_bundled_libs(session):
"""Installs the libraries that will be bundled with the extension."""
session.install("wheel")
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is used to generate requirements.txt.
# To update requirements.txt, run the following commands.
# Use Python 3.7 when creating the environment or using pip-tools
# Use Python 3.8 when creating the environment or using pip-tools
# 1) pip install pip-tools
# 2) pip-compile --generate-hashes --resolver=backtracking --upgrade ./requirements.in

Expand Down
57 changes: 27 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile with Python 3.7
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --generate-hashes --resolver=backtracking ./requirements.in
# pip-compile --generate-hashes ./requirements.in
#
attrs==23.1.0 \
--hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \
Expand All @@ -14,44 +14,41 @@ cattrs==23.1.2 \
--hash=sha256:b2bb14311ac17bed0d58785e5a60f022e5431aca3932e3fc5cc8ed8639de50a4 \
--hash=sha256:db1c821b8c537382b2c7c66678c3790091ca0275ac486c76f3c8f3920e83c657
# via lsprotocol
exceptiongroup==1.1.2 \
--hash=sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5 \
--hash=sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f
exceptiongroup==1.1.3 \
--hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \
--hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3
# via cattrs
importlib-metadata==6.7.0 \
--hash=sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4 \
--hash=sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5
# via
# attrs
# typeguard
isort==5.11.5 \
--hash=sha256:6be1f76a507cb2ecf16c7cf14a37e41609ca082330be4e3436a18ef74add55db \
--hash=sha256:ba1d72fb2595a01c7895a5128f9585a5cc4b6d395f1c8d514989b9a7eb2a8746
importlib-metadata==6.8.0 \
--hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \
--hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743
# via typeguard
isort==5.12.0 \
--hash=sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504 \
--hash=sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6
# via -r ./requirements.in
lsprotocol==2023.0.0a2 \
--hash=sha256:80aae7e39171b49025876a524937c10be2eb986f4be700ca22ee7d186b8488aa \
--hash=sha256:c4f2f77712b50d065b17f9b50d2b88c480dc2ce4bbaa56eea8269dbf54bc9701
lsprotocol==2023.0.0b1 \
--hash=sha256:ade2cd0fa0ede7965698cb59cd05d3adbd19178fd73e83f72ef57a032fbb9d62 \
--hash=sha256:f7a2d4655cbd5639f373ddd1789807450c543341fa0a32b064ad30dbb9f510d4
# via pygls
packaging==23.1 \
--hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \
--hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f
packaging==23.2 \
--hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \
--hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7
# via -r ./requirements.in
pygls==1.0.2 \
--hash=sha256:6d278d29fa6559b0f7a448263c85cb64ec6e9369548b02f1a7944060848b21f9 \
--hash=sha256:888ed63d1f650b4fc64d603d73d37545386ec533c0caac921aed80f80ea946a4
pygls==1.1.0 \
--hash=sha256:70acb6fe0df1c8a17b7ce08daa0afdb4aedc6913a6a6696003e1434fda80a06e \
--hash=sha256:eb19b818039d3d705ec8adbcdf5809a93af925f30cd7a3f3b7573479079ba00e
# via -r ./requirements.in
typeguard==3.0.2 \
--hash=sha256:bbe993854385284ab42fd5bd3bee6f6556577ce8b50696d6cb956d704f286c8e \
--hash=sha256:fee5297fdb28f8e9efcb8142b5ee219e02375509cd77ea9d270b5af826358d5a
# via pygls
typing-extensions==4.7.1 \
--hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \
--hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via
# cattrs
# importlib-metadata
# typeguard
zipp==3.15.0 \
--hash=sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b \
--hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556
zipp==3.17.0 \
--hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \
--hash=sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0
# via importlib-metadata
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.16
python-3.8.18
4 changes: 2 additions & 2 deletions src/common/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ export async function runPythonExtensionCommand(command: string, ...rest: any[])

export function checkVersion(resolved: ResolvedEnvironment | undefined): boolean {
const version = resolved?.version;
if (version?.major === 3 && version?.minor >= 7) {
if (version?.major === 3 && version?.minor >= 8) {
return true;
}
traceError(`Python version ${version?.major}.${version?.minor} is not supported.`);
traceError(`Selected python path: ${resolved?.executable.uri?.fsPath}`);
traceError('Supported versions are 3.7 and above.');
traceError('Supported versions are 3.8 and above.');
return false;
}
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
'Python interpreter missing:\r\n' +
'[Option 1] Select python interpreter using the ms-python.python.\r\n' +
`[Option 2] Set an interpreter using "${serverId}.interpreter" setting.\r\n`,
'Please use Python 3.7 or greater.',
'Please use Python 3.8 or greater.',
);
} else {
lsClient = await restartServer(workspaceSetting, serverId, serverName, outputChannel, lsClient);
Expand Down
2 changes: 1 addition & 1 deletion src/test/python_tests/requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is used to generate requirements.txt.
# To update requirements.txt, run the following commands.
# Use Python 3.7 when creating the environment or using pip-tools
# Use Python 3.8 when creating the environment or using pip-tools
# 1) pip install pip-tools
# 2) pip-compile --generate-hashes --resolver=backtracking --upgrade ./src/test/python_tests/requirements.in

Expand Down
Loading

0 comments on commit 6f2eb27

Please sign in to comment.