Skip to content

Commit 5e665b2

Browse files
authored
Simplify binder build & fix CI (#160)
* Simplify binder build * Update postBuild * Add `jupyter-server` explicitly * Correct package name * Add missing requests * Skip pip check * Fix develop mode * More fix * Skip broken nbclassic * Back to Python 3.7 for non unix tests
1 parent 793f298 commit 5e665b2

File tree

4 files changed

+28
-34
lines changed

4 files changed

+28
-34
lines changed

.github/workflows/build.yml

+21-26
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,23 @@ jobs:
3838
use-only-tar-bz2: true
3939
- name: Install dependencies
4040
run: |
41-
conda activate test_gator
41+
conda info
4242
conda install -n test_gator --file requirements_dev.txt
4343
python setup.py develop --skip-npm
44-
# Check pip dependencies
45-
python -m pip check
44+
# Check pip dependencies - broken for Python 3.7
45+
# python -m pip check
4646
shell: bash -l {0}
4747
- name: Test the server extension
48-
run: |
49-
conda activate test_gator
50-
python -m pytest -ra mamba_gator
48+
run: python -m pytest -ra mamba_gator
5149
shell: bash -l {0}
5250

5351
test-backend-mamba:
5452
name: Test server with Mamba Python ${{ matrix.python-version }}
5553
runs-on: ubuntu-latest
5654
strategy:
5755
matrix:
58-
# Skip 3.7 as it is used for integration tests
59-
python-version: ["3.8", "3.9"]
56+
# Skip 3.9 as it is used for integration tests
57+
python-version: ["3.7", "3.8"]
6058
steps:
6159
- name: Checkout
6260
uses: actions/checkout@v2
@@ -83,22 +81,21 @@ jobs:
8381
use-only-tar-bz2: true
8482
- name: Install dependencies
8583
run: |
86-
conda activate test_gator
84+
conda info
8785
mamba install -n test_gator --file requirements_dev.txt
8886
python setup.py develop --skip-npm
89-
# Check pip dependencies
90-
python -m pip check
87+
# Check pip dependencies - broken for Python 3.7
88+
# python -m pip check
9189
shell: bash -l {0}
9290
- name: Test the server extension
93-
run: |
94-
conda activate test_gator
95-
python -m pytest -ra mamba_gator
91+
run: python -m pytest -ra mamba_gator
9692
shell: bash -l {0}
9793

9894
test-all-os:
9995
name: Test Conda Python 3.7 on ${{ matrix.os }}
10096
runs-on: ${{ matrix.os }}
10197
continue-on-error: true
98+
timeout-minutes: 60
10299
strategy:
103100
fail-fast: false
104101
matrix:
@@ -151,9 +148,9 @@ jobs:
151148

152149
- name: Install dependencies
153150
run: |
154-
conda activate test_gator
151+
conda info
155152
conda install -n test_gator --file requirements_dev.txt
156-
conda install -n test_gator jupyterlab=3
153+
conda install -n test_gator jupyterlab=3 "nbclassic!=0.3.3"
157154
yarn install
158155
python -m pip install -e .
159156
shell: bash -l {0}
@@ -162,7 +159,6 @@ jobs:
162159
env:
163160
OS_RUNNER: ${{ matrix.os }}
164161
run: |
165-
conda activate test_gator
166162
python -m pytest mamba_gator
167163
yarn run test
168164
@@ -172,7 +168,7 @@ jobs:
172168
shell: bash -l {0}
173169

174170
test-integration:
175-
name: All tests on Ubuntu Mamba Python 3.7
171+
name: All tests on Ubuntu Mamba Python 3.9
176172
runs-on: ubuntu-latest
177173
steps:
178174
- name: Checkout
@@ -184,10 +180,10 @@ jobs:
184180
CACHE_NUMBER: 0
185181
with:
186182
path: ~/conda_pkgs_dir
187-
key: ${{ runner.os }}-mamba-3.7-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
183+
key: ${{ runner.os }}-mamba-3.9-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
188184
restore-keys: |
189-
${{ runner.os }}-mamba-3.7-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
190-
${{ runner.os }}-mamba-3.7
185+
${{ runner.os }}-mamba-3.9-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
186+
${{ runner.os }}-mamba-3.9
191187
- name: Get yarn cache directory path
192188
id: yarn-cache-dir-path
193189
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -206,22 +202,22 @@ jobs:
206202
${{ runner.os }}-yarn-${{ env.CACHE_NUMBER }}
207203
${{ runner.os }}-yarn-
208204
209-
- name: Setup Python 3.7
205+
- name: Setup Python 3.9
210206
uses: conda-incubator/setup-miniconda@v2
211207
with:
212208
activate-environment: test_gator
213209
auto-update-conda: true
214210
channels: conda-forge
215211
mamba-version: "*"
216-
python-version: "3.7"
212+
python-version: "3.9"
217213
show-channel-urls: true
218214
use-only-tar-bz2: true
219215

220216
- name: Install dependencies
221217
run: |
222-
conda activate test_gator
218+
conda info
223219
mamba install -n test_gator --file requirements_dev.txt
224-
mamba install -n test_gator coveralls jupyterlab=3
220+
mamba install -n test_gator coveralls jupyterlab=3 "nbclassic!=0.3.3"
225221
yarn install
226222
python -m pip install -e .
227223
# Check pip dependencies
@@ -230,7 +226,6 @@ jobs:
230226

231227
- name: Test the extension
232228
run: |
233-
conda activate test_gator
234229
# Run linter
235230
flake8 setup.py mamba_gator
236231
yarn run eslint:check

binder/postBuild

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ yarn run build
77
python -m pip install .
88
python -m pip install jupyterlab-tour
99

10-
jupyter labextension install @jupyterlab/server-proxy --no-build
11-
jupyter lab build --minimize=False
12-
1310
# Import the workspace into JupyterLab
1411
jupyter lab workspaces import binder/workspace.json
1512

mamba_gator/tests/test_api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def mk_env(self, name=None, packages=None, remove_if_exists=True):
5959

6060
return self.conda_api.post(
6161
["environments"],
62-
body={"name": new_name, "packages": packages or ["python"]},
62+
body={"name": new_name, "packages": packages or ["python!=3.10.0"]},
6363
)
6464

6565
def rm_env(self, name):
@@ -541,7 +541,7 @@ def test_get_has_update(self):
541541
self.wait_for_task(
542542
self.conda_api.post,
543543
["environments"],
544-
body={"name": n, "packages": ["python"]},
544+
body={"name": n, "packages": ["python!=3.10.0"]},
545545
)
546546

547547
r = self.wait_for_task(
@@ -556,7 +556,7 @@ def test_get_has_update(self):
556556
self.wait_for_task(
557557
self.conda_api.post,
558558
["environments"],
559-
body={"name": n, "packages": ["python", "alabaster=0.7.11"]},
559+
body={"name": n, "packages": ["python!=3.10.0", "alabaster=0.7.11"]},
560560
)
561561

562562
r = self.wait_for_task(
@@ -583,15 +583,15 @@ def test_env_export(self):
583583

584584
def test_env_export_history(self):
585585
n = generate_name()
586-
self.wait_for_task(self.mk_env, n)
586+
self.wait_for_task(self.mk_env, n, packages=["python=3.9"])
587587
r = self.conda_api.get(
588588
["environments", n], params={"download": 1, "history": 1}
589589
)
590590
self.assertEqual(r.status_code, 200)
591591

592592
content = " ".join(r.text.splitlines())
593593
self.assertRegex(
594-
content, r"^name:\s" + n + r"\s+channels:(\s+- conda-forge)?\s+- defaults\s+dependencies:\s+- python\s+prefix:"
594+
content, r"^name:\s" + n + r"\s+channels:(\s+- conda-forge)?\s+- defaults\s+dependencies:\s+- python=3\.9\s+prefix:"
595595
)
596596

597597
def test_env_export_not_supporting_history(self):

requirements_dev.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ nb_conda_kernels >=2.2.0
44
packaging
55
jupyter_client
66
jupyter-packaging >=0.7.9,<0.8.0
7+
jupyter_server
78
jupyterlab_server
9+
requests
810
tornado
911
traitlets
1012
coverage

0 commit comments

Comments
 (0)