Skip to content

Commit

Permalink
Drop Python 3.7 support (microsoft#21962)
Browse files Browse the repository at this point in the history
Drop Python 3.7 support, and replace with Python 3.8
Resolves: microsoft#21532

/vscode-python/requirements.txt generated same hash even when running:
```pip-compile --generate-hashes requirements.in```
from the Python3.8 virtual environment.

- Same result with pythonFiles/jedilsp_requirements/requirements.txt when running:
```pip-compile --generate-hashes
pythonFiles/jedilsp_requirements/requirements.in```
  • Loading branch information
anthonykim1 committed Sep 12, 2023
1 parent 30cbd03 commit 6ae656d
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ runs:
cache: 'npm'

# Jedi LS depends on dataclasses which is not in the stdlib in Python 3.7.
- name: Use Python 3.7 for JediLSP
- name: Use Python 3.8 for JediLSP
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
cache: 'pip'
cache-dependency-path: |
requirements.txt
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 @@ -38,7 +38,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 build/ci/conda_env_1.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: conda_env_1
dependencies:
- python=3.7
- python=3.8
- pip
2 changes: 1 addition & 1 deletion pythonFiles/jedilsp_requirements/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 --upgrade pythonFiles\jedilsp_requirements\requirements.in

Expand Down
2 changes: 1 addition & 1 deletion pythonFiles/jedilsp_requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# 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 'pythonFiles\jedilsp_requirements\requirements.in'
Expand Down
2 changes: 1 addition & 1 deletion pythonFiles/tests/test_data/missing-deps.data
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# 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-test.in
Expand Down
2 changes: 1 addition & 1 deletion pythonFiles/tests/test_data/no-missing-deps.data
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# 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-test.in
Expand Down
2 changes: 1 addition & 1 deletion pythonFiles/tests/test_data/pyproject-missing-deps.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ build-backend = "flit_core.buildapi"
[project]
name = "something"
version = "2023.0.0"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = ["pytest==7.3.1", "flake8-csv"]
2 changes: 1 addition & 1 deletion pythonFiles/tests/test_data/pyproject-no-missing-deps.data
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ build-backend = "flit_core.buildapi"
[project]
name = "something"
version = "2023.0.0"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [jedi-language-server"]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# 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 requirements.in
Expand Down
8 changes: 4 additions & 4 deletions scripts/onCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
source ~/.bashrc

# Install Python via pyenv .
pyenv install 3.7:latest 3.8:latest 3.9:latest 3.10:latest 3.11:latest
pyenv install 3.8:latest 3.9:latest 3.10:latest 3.11:latest

# Set default Python version to 3.7 .
pyenv global 3.7.17
# Set default Python version to 3.8 .
pyenv global 3.8.18

npm ci

# Create Virutal environment.
pyenv exec python3.7 -m venv .venv
pyenv exec python3.8 -m venv .venv

# Activate Virtual environment.
source /workspaces/vscode-python/.venv/bin/activate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function getCondaBaseEnv(): Promise<string | undefined> {
}

export async function pickPythonVersion(token?: CancellationToken): Promise<string | undefined> {
const items: QuickPickItem[] = ['3.10', '3.11', '3.9', '3.8', '3.7'].map((v) => ({
const items: QuickPickItem[] = ['3.10', '3.11', '3.9', '3.8'].map((v) => ({
label: v === RECOMMENDED_CONDA_PYTHON ? `${Octicons.Star} Python` : 'Python',
description: v,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ verify_ssl = true
[packages]

[requires]
python_version = "3.7"
python_version = "3.8"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ verify_ssl = true
[packages]

[requires]
python_version = "3.7"
python_version = "3.8"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ verify_ssl = true
[packages]

[requires]
python_version = "3.7"
python_version = "3.8"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ verify_ssl = true
[packages]

[requires]
python_version = "3.7"
python_version = "3.8"
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getPyProjectTomlFile(): typemoq.IMock<TextDocument> {
.setup((p) => p.getText(typemoq.It.isAny()))
.returns(
() =>
'[build-system]\nrequires = ["flit_core >=3.2,<4"]\nbuild-backend = "flit_core.buildapi"\n\n[project]\nname = "something"\nversion = "2023.0.0"\nrequires-python = ">=3.7"\ndependencies = ["attrs>=21.3.0", "flake8-csv"]\n ',
'[build-system]\nrequires = ["flit_core >=3.2,<4"]\nbuild-backend = "flit_core.buildapi"\n\n[project]\nname = "something"\nversion = "2023.0.0"\nrequires-python = ">=3.8"\ndependencies = ["attrs>=21.3.0", "flake8-csv"]\n ',
);
return someFile;
}
Expand All @@ -76,7 +76,7 @@ function getSomeTomlFile(): typemoq.IMock<TextDocument> {
.setup((p) => p.getText(typemoq.It.isAny()))
.returns(
() =>
'[build-system]\nrequires = ["flit_core >=3.2,<4"]\nbuild-backend = "flit_core.buildapi"\n\n[something]\nname = "something"\nversion = "2023.0.0"\nrequires-python = ">=3.7"\ndependencies = ["attrs>=21.3.0", "flake8-csv"]\n ',
'[build-system]\nrequires = ["flit_core >=3.2,<4"]\nbuild-backend = "flit_core.buildapi"\n\n[something]\nname = "something"\nversion = "2023.0.0"\nrequires-python = ">=3.8"\ndependencies = ["attrs>=21.3.0", "flake8-csv"]\n ',
);
return someFile;
}
Expand Down

0 comments on commit 6ae656d

Please sign in to comment.