Skip to content

Commit 0a4cd19

Browse files
authored
Merge pull request #1219 from yuvipanda/new-default
Switch default python to 3.10
2 parents 8c0f49e + 847fdff commit 0a4cd19

File tree

14 files changed

+135
-80
lines changed

14 files changed

+135
-80
lines changed

repo2docker/buildpacks/conda/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def get_build_scripts(self):
143143
),
144144
]
145145

146-
major_pythons = {"2": "2.7", "3": "3.7"}
146+
major_pythons = {"2": "2.7", "3": "3.10"}
147147

148148
def get_build_script_files(self):
149149
"""

repo2docker/buildpacks/conda/environment-linux-64.lock

Lines changed: 40 additions & 30 deletions
Large diffs are not rendered by default.

repo2docker/buildpacks/conda/environment-linux-aarch64.lock

Lines changed: 40 additions & 30 deletions
Large diffs are not rendered by default.

repo2docker/buildpacks/conda/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
channels:
22
- conda-forge
33
dependencies:
4-
- python=3.7
4+
- python=3.10
55
- nodejs=18
66
- pip
77
- ipywidgets==8.0.2

repo2docker/buildpacks/conda/freeze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def set_python(py_env_file, py):
126126
default=("linux-64", "linux-aarch64"),
127127
)
128128
args = parser.parse_args()
129-
default_py = "3.7"
129+
default_py = "3.10"
130130
for py in args.py:
131131
for platform in args.platform:
132132
env_file = pathlib.Path(str(ENV_FILE_T).format(py=py))

tests/conda/downgrade/environment.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# originally [email protected]
2+
# added python=3.9 pin because implicit downgrade of Python from 3.10 to 3.9 isn't allowed
3+
name: xeus-cling
4+
channels:
5+
- conda-forge
6+
dependencies:
7+
- python=3.9
8+
- xeus-cling=0.6.0
9+
- xtensor=0.20.8
10+
- xtensor-blas=0.16.1
11+
- notebook

tests/conda/downgrade/verify

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import pprint
4+
from subprocess import check_output
5+
6+
7+
def json_sh(cmd):
8+
"""Run a command that produces JSON on stdout and return the parsed result"""
9+
buf = check_output(cmd)
10+
return json.loads(buf.decode("utf8", "replace"))
11+
12+
13+
conda_pkg_list = json_sh(["conda", "list", "--json"])
14+
pprint.pprint(conda_pkg_list)
15+
# make it a dict
16+
pkgs = {pkg["name"]: pkg for pkg in conda_pkg_list}
17+
18+
# base env resolved
19+
assert pkgs["python"]["version"].startswith("3.9"), pkgs["python"]
20+
assert "xeus-cling" in pkgs
21+
assert pkgs["xeus-cling"]["version"] == "0.6.0"
22+
23+
# verify downgrade
24+
# this may be brittle, but it's unlikely any of these old versions
25+
# of packages will be rebuilt
26+
# xeus-cling 0.6.0 pins xeus 0.20, which pins openssl 1.1.1,
27+
# which in turn downgrades Python from >=3.9.16 to 3.9.6
28+
29+
assert pkgs["openssl"]["version"].startswith("1.1.1"), pkgs["openssl"]["version"]
30+
assert pkgs["python"]["version"] == "3.9.6", pkgs["python"]["version"]

tests/conda/py-r-postbuild-file/verify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55

66
def test_sys_version():
7-
"""The default python version should be 3.7"""
8-
assert sys.version_info[:2] == (3, 7)
7+
"""The default python version should be 3.10"""
8+
assert sys.version_info[:2] == (3, 10)
99

1010

1111
def test_there():

tests/conda/py2/verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
import sys
33

4-
assert sys.version_info[:2] == (3, 7), sys.version
4+
assert sys.version_info[:2] == (3, 10), sys.version
55

66
# verify that we have Python 2 and Python 3 kernelspecs
77
from jupyter_client.kernelspec import KernelSpecManager

tests/conda/py35-binder-dir/verify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os
33
import sys
44
from subprocess import STDOUT, check_output
55

6-
assert sys.version_info[:2] == (3, 7), sys.version
6+
assert sys.version_info[:2] == (3, 10), sys.version
77

88

99
def sh(cmd, **kwargs):

0 commit comments

Comments
 (0)