Skip to content

Commit aed7477

Browse files
committed
ci: switch to anaconda
1 parent 11ac62e commit aed7477

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,38 +36,39 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v2
39-
- uses: actions/setup-python@v1
40-
with:
41-
python-version: '3.8'
4239
- uses: actions/setup-node@v1
4340
with:
4441
node-version: '12.x'
45-
- name: Cache pip
42+
- name: Cache Conda
4643
uses: actions/cache@v1
4744
with:
48-
path: ~/.cache/pip # This path is specific to Ubuntu
49-
# Look to see if there is a cache hit for the corresponding requirements file
50-
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile', 'setup.py') }}
45+
path: ~/conda_pkgs_dir
46+
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
5147
restore-keys: |
52-
${{ runner.os }}-pip-
53-
${{ runner.os }}-
54-
- name: setup pipenv
55-
run: |
56-
python -m pip install pipenv
57-
pipenv install --dev
48+
${{ runner.os }}-conda6-
49+
- uses: conda-incubator/setup-miniconda@v2
50+
with:
51+
python-version: 3.8
52+
mamba-version: "*"
53+
channels: conda-forge,defaults
54+
channel-priority: true
55+
activate-environment: upsetjs_jupyter_widget
56+
environment-file: environment.yml
57+
auto-activate-base: false
58+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
5859
- name: pytest
59-
shell: pipenv run bash {0}
60-
run: pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
60+
shell: bash -l {0}
61+
run: npm run test:p:ci
6162
- name: Lint
62-
shell: pipenv run bash {0}
63+
shell: bash -l {0}
6364
run: npm run lint:p
6465

6566
- name: Build Notebooks
66-
shell: pipenv run bash {0}
67-
run: jupyter nbconvert examples/*.ipynb --to html
67+
shell: bash -l {0}
68+
run: npm run nbconvert
6869

6970
- name: Create Docu
70-
shell: pipenv run bash {0}
71+
shell: bash -l {0}
7172
run: npm run docs:p
7273

7374
- run: |

environment.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python==3.9
6+
- python==3.8
77
- mypy
88
- pylint
99
- black
1010
- bumpversion
11+
- pytest
12+
- jupyter
13+
- jupyterlab

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
"eslint": "eslint src --ext .ts,.tsx",
5252
"eslint:fix": "yarn eslint -- --fix",
5353
"lint:p": "mypy -p upsetjs_jupyter_widget && yarn black -- --check && pylint upsetjs_jupyter_widget",
54-
"fix:p": "yarnblack",
54+
"fix:p": "yarn black",
5555
"test:p": "pytest",
56+
"test:p:ci": "pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html",
57+
"nbconvert": "jupyter nbconvert examples/*.ipynb --to html",
5658
"test": "jest --passWithNoTests",
5759
"watch": "npm-run-all -p 'watch:*'",
5860
"watch:lib": "tsc -w -p tsconfig.build.json",

src/__tests__/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class DummyManager {
9999
}
100100

101101
export interface Constructor<T> {
102-
new(attributes?: any, options?: any): T;
102+
new (attributes?: any, options?: any): T;
103103
}
104104

105105
export function createTestModel<T extends widgets.WidgetModel>(constructor: Constructor<T>, attributes?: any): T {

0 commit comments

Comments
 (0)