File tree Expand file tree Collapse file tree 3 files changed +41
-6
lines changed Expand file tree Collapse file tree 3 files changed +41
-6
lines changed Original file line number Diff line number Diff line change
1
+
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
Original file line number Diff line number Diff line change
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" ]
Original file line number Diff line number Diff line change 24
24
url : https://github.com/binder-examples/requirements
25
25
ref : python-3.7
26
26
verify : python -c 'import matplotlib'
27
- # Test that custom channels and downgrades don't
28
- # get blocked by pinning
29
- - name : Xeus-Cling
30
- url : https://github.com/QuantStack/xeus-cling
31
- ref : 0.6.0
32
- verify : jupyter kernelspec list
33
27
# Zenodo record of https://github.com/binder-examples/requirements
34
28
- name : 10.5281/zenodo.3242074
35
29
url : 10.5281/zenodo.3242074
You can’t perform that action at this time.
0 commit comments