Skip to content

Commit abe2cc8

Browse files
committed
import downgrade test
rather than building old xeus-cling, which requires a downgrade of Python from 3.10 to 3.9, which is _not_ supported, run the build with a 3.9 pin. This still results in patch-level downgrade of Python, major downgrade of openssl, etc.
1 parent fbab2cd commit abe2cc8

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

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/external/reproductions.repos.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
url: https://github.com/binder-examples/requirements
2525
ref: python-3.7
2626
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
3327
# Zenodo record of https://github.com/binder-examples/requirements
3428
- name: 10.5281/zenodo.3242074
3529
url: 10.5281/zenodo.3242074

0 commit comments

Comments
 (0)