Skip to content

Commit 1fb424d

Browse files
committed
Merge remote-tracking branch 'upstream/4.x' into jedi_0.17
Merge!
2 parents 6eea531 + e3a02d8 commit 1fb424d

36 files changed

Lines changed: 502 additions & 161 deletions

File tree

.github/workflows/test-files.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,20 @@ jobs:
6666
if: env.RUN_BUILD == 'true'
6767
shell: bash
6868
run: sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0
69+
- name: Cache conda
70+
uses: actions/cache@v1
71+
env:
72+
# Increase this value to reset cache if requirements/*.txt has not changed
73+
CACHE_NUMBER: 0
74+
with:
75+
path: ~/conda_pkgs_dir
76+
key: ${{ runner.os }}-cacheconda-installconda-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
6977
- name: Cache pip
7078
if: env.RUN_BUILD == 'true'
7179
uses: actions/cache@v1
7280
with:
7381
path: ~/.cache/pip
74-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
75-
restore-keys: ${{ runner.os }}-pip-
82+
key: ${{ runner.os }}-cachepip-installconda-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
7683
- name: Install Conda
7784
if: env.RUN_BUILD == 'true'
7885
uses: goanpeca/setup-miniconda@v1
@@ -81,6 +88,7 @@ jobs:
8188
auto-update-conda: true
8289
auto-activate-base: false
8390
python-version: ${{ matrix.PYTHON_VERSION }}
91+
use-only-tar-bz2: true
8492
- name: Create test environment
8593
if: env.RUN_BUILD == 'true'
8694
shell: bash -l {0}

.github/workflows/test-linux.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,29 @@ jobs:
7777
if: env.RUN_BUILD == 'true'
7878
shell: bash
7979
run: sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0
80+
- name: Cache conda
81+
uses: actions/cache@v1
82+
env:
83+
# Increase this value to reset cache if requirements/*.txt has not changed
84+
CACHE_NUMBER: 0
85+
with:
86+
path: ~/conda_pkgs_dir
87+
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
8088
- name: Cache pip
8189
if: env.RUN_BUILD == 'true'
8290
uses: actions/cache@v1
8391
with:
8492
path: ~/.cache/pip
85-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
86-
restore-keys: ${{ runner.os }}-pip-
93+
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
8794
- name: Install Conda
8895
if: env.RUN_BUILD == 'true'
8996
uses: goanpeca/setup-miniconda@v1
9097
with:
91-
activate-environment: test
92-
auto-update-conda: true
93-
auto-activate-base: false
94-
python-version: ${{ matrix.PYTHON_VERSION }}
98+
activate-environment: test
99+
auto-update-conda: true
100+
auto-activate-base: false
101+
python-version: ${{ matrix.PYTHON_VERSION }}
102+
use-only-tar-bz2: true
95103
- name: Create test environment
96104
if: env.RUN_BUILD == 'true'
97105
shell: bash -l {0}

.github/workflows/test-mac.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,29 @@ jobs:
6666
if: github.event_name != 'pull_request'
6767
shell: bash -l {0}
6868
run: echo "::set-env name=RUN_BUILD::true"
69+
- name: Cache conda
70+
uses: actions/cache@v1
71+
env:
72+
# Increase this value to reset cache if requirements/*.txt has not changed
73+
CACHE_NUMBER: 0
74+
with:
75+
path: ~/conda_pkgs_dir
76+
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
77+
- name: Cache pip
78+
if: env.RUN_BUILD == 'true'
79+
uses: actions/cache@v1
80+
with:
81+
path: ~/Library/Caches/pip
82+
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
6983
- name: Install Conda
7084
if: env.RUN_BUILD == 'true'
7185
uses: goanpeca/setup-miniconda@v1
7286
with:
73-
activate-environment: test
74-
auto-update-conda: true
75-
python-version: ${{ matrix.PYTHON_VERSION }}
87+
activate-environment: test
88+
auto-update-conda: true
89+
auto-activate-base: false
90+
python-version: ${{ matrix.PYTHON_VERSION }}
91+
use-only-tar-bz2: true
7692
- name: Create test environment
7793
if: env.RUN_BUILD == 'true'
7894
shell: bash -l {0}

.github/workflows/test-win.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,29 @@ jobs:
6666
if: github.event_name != 'pull_request'
6767
shell: bash -l {0}
6868
run: echo "::set-env name=RUN_BUILD::true"
69+
- name: Cache conda
70+
uses: actions/cache@v1
71+
env:
72+
# Increase this value to reset cache if requirements/*.txt has not changed
73+
CACHE_NUMBER: 0
74+
with:
75+
path: ~/conda_pkgs_dir
76+
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
6977
- name: Cache pip
7078
if: env.RUN_BUILD == 'true'
7179
uses: actions/cache@v1
7280
with:
7381
path: ~\AppData\Local\pip\Cache
74-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
75-
restore-keys: ${{ runner.os }}-pip-
82+
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
7683
- name: Install Conda
7784
if: env.RUN_BUILD == 'true'
7885
uses: goanpeca/setup-miniconda@v1
7986
with:
80-
activate-environment: test
81-
auto-update-conda: true
82-
python-version: ${{ matrix.PYTHON_VERSION }}
87+
activate-environment: test
88+
auto-update-conda: true
89+
auto-activate-base: false
90+
python-version: ${{ matrix.PYTHON_VERSION }}
91+
use-only-tar-bz2: true
8392
- name: Create test environment
8493
if: env.RUN_BUILD == 'true'
8594
shell: bash -l {0}

binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
- pickleshare >=0.4
2525
- psutil >=5.3
2626
- pygments >=2.0
27-
- pylint >=0.25
27+
- pylint >=1.0
2828
- pyqt <5.13
2929
- pyyaml
3030
- python-language-server >=0.31.9,<0.32.0

external-deps/spyder-kernels/.gitrepo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[subrepo]
77
remote = https://github.com/spyder-ide/spyder-kernels.git
88
branch = 1.x
9-
commit = 70651f2bff9aceccfabde24b7316ba11c0433e23
10-
parent = 052089e3ca67947a4dfedb4a78ae7b97773c2de9
9+
commit = 53304c85e5c352cf05aa4cbef1e188ce18bae358
10+
parent = 30820a779367209f1c1b8d9300efde94a5a84bef
1111
method = merge
1212
cmdver = 0.4.1

external-deps/spyder-kernels/requirements/tests.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
codecov
22
cython
3+
dask
34
flaky
45
matplotlib
56
mock

external-deps/spyder-kernels/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def get_version(module='spyder_kernels'):
4747
TEST_REQUIREMENTS = [
4848
'codecov',
4949
'cython',
50+
'dask',
5051
'flaky',
5152
'matplotlib',
5253
'mock',

external-deps/spyder-kernels/spyder_kernels/console/__main__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
# (see spyder_kernels/__init__.py for details)
77
# -----------------------------------------------------------------------------
88

9+
import sys
10+
import os
11+
12+
913
if __name__ == '__main__':
14+
# Remove the current working directory from sys.path for Python 3.7+
15+
# because since that version it's added by default to sys.path when
16+
# using 'python -m'.
17+
if sys.version_info[0] == 3 and sys.version_info[1] >= 7:
18+
cwd = os.getcwd()
19+
if cwd in sys.path:
20+
sys.path.remove(cwd)
21+
1022
from spyder_kernels.console import start
1123
start.main()

external-deps/spyder-kernels/spyder_kernels/console/tests/test_console_kernel.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,11 @@ def test_cwd_in_sys_path():
396396

397397

398398
@flaky(max_runs=3)
399-
@pytest.mark.skipif(not (os.name == 'nt' and PY3),
400-
reason="Only meant for Windows and Python 3")
399+
@pytest.mark.skipif(not PY3,
400+
reason="Only meant for Python 3")
401401
def test_multiprocessing(tmpdir):
402402
"""
403-
Test that multiprocessing works on Windows and Python 3.
403+
Test that multiprocessing works on Python 3.
404404
"""
405405
# Command to start the kernel
406406
cmd = "from spyder_kernels.console import start; start.main()"
@@ -435,6 +435,48 @@ def f(x):
435435
assert content['found']
436436

437437

438+
@flaky(max_runs=3)
439+
@pytest.mark.skipif(not PY3,
440+
reason="Only meant for Python 3")
441+
def test_dask_multiprocessing(tmpdir):
442+
"""
443+
Test that dask multiprocessing works on Python 3.
444+
"""
445+
# Command to start the kernel
446+
cmd = "from spyder_kernels.console import start; start.main()"
447+
448+
with setup_kernel(cmd) as client:
449+
# Remove all variables
450+
client.execute("%reset -f")
451+
client.get_shell_msg(block=True, timeout=TIMEOUT)
452+
453+
# Write multiprocessing code to a file
454+
# Runs two times to verify that in the second case it doesn't break
455+
code = """
456+
from dask.distributed import Client
457+
458+
if __name__=='__main__':
459+
client = Client()
460+
client.close()
461+
x = 'hello'
462+
"""
463+
p = tmpdir.join("mp-test.py")
464+
p.write(code)
465+
466+
# Run code two times
467+
client.execute("runfile(r'{}')".format(to_text_string(p)))
468+
client.get_shell_msg(block=True, timeout=TIMEOUT)
469+
470+
client.execute("runfile(r'{}')".format(to_text_string(p)))
471+
client.get_shell_msg(block=True, timeout=TIMEOUT)
472+
473+
# Verify that the `x` variable is defined
474+
client.inspect('x')
475+
msg = client.get_shell_msg(block=True, timeout=TIMEOUT)
476+
content = msg['content']
477+
assert content['found']
478+
479+
438480
@flaky(max_runs=3)
439481
def test_runfile(tmpdir):
440482
"""

0 commit comments

Comments
 (0)