Skip to content

Commit

Permalink
Merge pull request #20460 from ccordoba12/fix-failure-installing-spyd…
Browse files Browse the repository at this point in the history
…er-kernels

PR: Fix failure installing Spyder-kernels from master on Windows and other minor fixes on CIS
  • Loading branch information
ccordoba12 authored Feb 2, 2023
2 parents 3e24ec4 + 137eb14 commit 12a5f2c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ conda list -n jedi-test-env

# Create environment to test conda env activation before launching a kernel
conda create -n spytest-ž -q -y -c conda-forge python=3.9
conda run -n spytest-ž python -m pip install git+https://github.com/spyder-ide/spyder-kernels.git@master

# `conda run` fails on Windows without a clear reason
if [ "$OS" = "win" ]; then
/c/Miniconda/envs/spytest-ž/python -m pip install git+https://github.com/spyder-ide/spyder-kernels.git@master
else
conda run -n spytest-ž python -m pip install git+https://github.com/spyder-ide/spyder-kernels.git@master
fi

conda list -n spytest-ž

# Install pyenv on Linux systems
Expand Down
25 changes: 13 additions & 12 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def pytest_collection_modifyitems(config, items):

# Break test suite in CIs according to the following criteria:
# * Mark all main window tests, and a percentage of the IPython console
# ones on Linux and Mac, as slow.
# ones, as slow.
# * All other tests will be considered as fast.
# This provides a more balanced partitioning of our test suite (in terms of
# necessary time to run it) between the slow and fast slots we have on CIs.
Expand All @@ -79,19 +79,20 @@ def pytest_collection_modifyitems(config, items):
item for item in items if 'test_mainwindow' in item.nodeid
]

if not os.name == 'nt':
ipyconsole_items = [
item for item in items if 'test_ipythonconsole' in item.nodeid
]
ipyconsole_items = [
item for item in items if 'test_ipythonconsole' in item.nodeid
]

if sys.platform == 'darwin':
percentage = 0.6
else:
percentage = 0.5
if os.name == 'nt':
percentage = 0.6
elif sys.platform == 'darwin':
percentage = 0.6
else:
percentage = 0.5

for i, item in enumerate(ipyconsole_items):
if i < len(ipyconsole_items) * percentage:
slow_items.append(item)
for i, item in enumerate(ipyconsole_items):
if i < len(ipyconsole_items) * percentage:
slow_items.append(item)

for item in items:
if slow_option:
Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,7 @@ def test_calltip(ipyconsole, qtbot):
@pytest.mark.test_environment_interpreter
@pytest.mark.skipif(not is_anaconda(), reason='Only works with Anaconda')
@pytest.mark.skipif(not running_in_ci(), reason='Only works on CIs')
@pytest.mark.skipif(not os.name == 'nt', reason='Works reliably on Windows')
def test_conda_env_activation(ipyconsole, qtbot):
"""
Test that the conda environment associated with an external interpreter
Expand Down

0 comments on commit 12a5f2c

Please sign in to comment.