Skip to content

Commit e2fae39

Browse files
committed
CI: Put Spyder source tree outside the plugin source tree
Before, the Spyder source tree was nested inside the plugin source tree which was messy and may have generated errors.
1 parent b0b1d82 commit e2fae39

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

.github/scripts/generate-without-spyder.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
"""Script to generate requirements/without-spyder.txt"""
88

99
import re
10+
from pathlib import Path
1011

11-
with open('requirements/conda.txt') as infile:
12-
with open('requirements/without-spyder.txt', 'w') as outfile:
12+
rootdir = Path(__file__).parents[2]
13+
input_filename = rootdir / 'requirements' / 'conda.txt'
14+
output_filename = rootdir / 'requirements' / 'without-spyder.txt'
15+
16+
with open(input_filename) as infile:
17+
with open(output_filename, 'w') as outfile:
1318
for line in infile:
1419
package_name = re.match('[-a-z0-9_]*', line).group(0)
1520
if package_name != 'spyder':
1621
outfile.write(line)
17-

.github/workflows/run-tests.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout branch
2626
uses: actions/checkout@v4
27+
with:
28+
path: spyder-notebook
2729
- name: Install System Packages
2830
if: matrix.OS == 'ubuntu'
2931
run: |
@@ -32,8 +34,8 @@ jobs:
3234
- name: Install Conda
3335
uses: conda-incubator/setup-miniconda@v3
3436
with:
35-
auto-update-conda: true
36-
python-version: ${{ matrix.PYTHON_VERSION }}
37+
auto-update-conda: true
38+
python-version: ${{ matrix.PYTHON_VERSION }}
3739
- name: Checkout Spyder from git
3840
if: matrix.SPYDER_SOURCE == 'git'
3941
uses: actions/checkout@v4
@@ -63,26 +65,26 @@ jobs:
6365
if: matrix.SPYDER_SOURCE == 'git'
6466
shell: bash -l {0}
6567
run: |
66-
python .github/scripts/generate-without-spyder.py
67-
conda install --file requirements/without-spyder.txt -y
68+
python spyder-notebook/.github/scripts/generate-without-spyder.py
69+
conda install --file spyder-notebook/requirements/without-spyder.txt -y
6870
- name: Install plugin dependencies
6971
if: matrix.SPYDER_SOURCE == 'conda'
7072
shell: bash -l {0}
71-
run: conda install --file requirements/conda.txt -y
73+
run: conda install --file spyder-notebook/requirements/conda.txt -y
7274
- name: Install test dependencies
7375
shell: bash -l {0}
7476
run: |
7577
conda install nomkl -y -q
76-
conda install --file requirements/tests.txt -y
78+
conda install --file spyder-notebook/requirements/tests.txt -y
7779
- name: Build JavaScript
7880
shell: bash -l {0}
7981
run: |
80-
cd spyder_notebook/server
82+
cd spyder-notebook/spyder_notebook/server
8183
jlpm install
8284
jlpm build
8385
- name: Install plugin
8486
shell: bash -l {0}
85-
run: pip install --no-deps -e .
87+
run: pip install --no-deps -e spyder-notebook
8688
- name: Show environment information
8789
shell: bash -l {0}
8890
run: |
@@ -97,7 +99,7 @@ jobs:
9799
shell: bash
98100
command: |
99101
. ~/.profile
100-
xvfb-run --auto-servernum pytest spyder_notebook --cov=spyder_notebook --cov-report=xml -vv
102+
xvfb-run --auto-servernum pytest spyder-notebook/spyder_notebook -vv
101103
- name: Run tests (MacOS)
102104
if: matrix.OS == 'macos'
103105
uses: nick-fields/retry@v3
@@ -107,11 +109,11 @@ jobs:
107109
shell: bash
108110
command: |
109111
. ~/.profile
110-
pytest spyder_notebook -vv
112+
pytest spyder-notebook/spyder_notebook -vv
111113
- name: Run tests (Windows)
112114
if: matrix.OS == 'windows'
113115
uses: nick-fields/retry@v3
114116
with:
115117
timeout_minutes: 10
116118
max_attempts: 3
117-
command: pytest spyder_notebook -vv
119+
command: pytest spyder-notebook/spyder_notebook -vv

0 commit comments

Comments
 (0)