Skip to content

Commit

Permalink
CI: Put Spyder source tree outside the plugin source tree
Browse files Browse the repository at this point in the history
Before, the Spyder source tree was nested inside the plugin source
tree which was messy and may have generated errors.
  • Loading branch information
jitseniesen committed Apr 18, 2024
1 parent 0506d7d commit 251bee8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
10 changes: 7 additions & 3 deletions .github/scripts/generate-without-spyder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
"""Script to generate requirements/without-spyder.txt"""

import re
from pathlib import Path

with open('requirements/conda.txt') as infile:
with open('requirements/without-spyder.txt', 'w') as outfile:
rootdir = Path(__file__).parents[2]
input_filename = rootdir / 'requirements' / 'conda.txt'
output_filename = rootdir / 'requirements' / 'without-spyder.txt'

with open(input_filename) as infile:
with open(output_filename, 'w') as outfile:
for line in infile:
package_name = re.match('[-a-z0-9_]*', line).group(0)
if package_name != 'spyder':
outfile.write(line)

18 changes: 10 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
path: 'spyder-unittest'
- name: Install System Packages
if: matrix.OS == 'ubuntu'
run: |
Expand Down Expand Up @@ -64,20 +66,20 @@ jobs:
if: matrix.SPYDER_SOURCE == 'git'
shell: bash -l {0}
run: |
python .github/scripts/generate-without-spyder.py
mamba install --file requirements/without-spyder.txt -y
python spyder-unittest/.github/scripts/generate-without-spyder.py
mamba install --file spyder-unittest/requirements/without-spyder.txt -y
- name: Install plugin dependencies
if: matrix.SPYDER_SOURCE == 'conda'
shell: bash -l {0}
run: mamba install --file requirements/conda.txt -y
run: mamba install --file spyder-unittest/requirements/conda.txt -y
- name: Install test dependencies
shell: bash -l {0}
run: |
mamba install nomkl -y -q
mamba install --file requirements/tests.txt -y
mamba install --file spyder-unittest/requirements/tests.txt -y
- name: Install plugin
shell: bash -l {0}
run: pip install --no-deps -e .
run: pip install --no-deps -e spyder-unittest
- name: Show environment information
shell: bash -l {0}
run: |
Expand All @@ -92,7 +94,7 @@ jobs:
shell: bash
command: |
. ~/.profile
xvfb-run --auto-servernum pytest spyder_unittest -vv
xvfb-run --auto-servernum pytest spyder-unittest/spyder_unittest -vv
- name: Run tests (MacOS)
if: matrix.OS == 'macos'
uses: nick-fields/retry@v3
Expand All @@ -102,11 +104,11 @@ jobs:
shell: bash
command: |
. ~/.profile
pytest spyder_unittest -vv
pytest spyder-unittest/spyder_unittest -vv
- name: Run tests (Windows)
if: matrix.OS == 'windows'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pytest spyder_unittest -vv
command: pytest spyder-unittest/spyder_unittest -vv

0 comments on commit 251bee8

Please sign in to comment.