Skip to content

Commit 43a35b9

Browse files
committed
Add test for dependency integrity in spyder
1 parent 8c806a4 commit 43a35b9

5 files changed

Lines changed: 281 additions & 111 deletions

File tree

binder/environment.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,34 @@ dependencies:
77
# the contents of this requirements/conda.txt to this file.yml.
88
# Please *DO NOT* make changes directly just to here - make changes
99
# to requirements/conda.txt, and copy it here.
10-
- applaunchservices
11-
- atomicwrites
10+
- applaunchservices >=0.1.7
11+
- atomicwrites >=1.2.0
1212
- chardet >=2.0.0
13-
- cloudpickle
14-
- diff-match-patch
13+
- cloudpickle >=0.5.0
14+
- diff-match-patch >=20181111
1515
- intervaltree
16+
- ipython >=4.0
1617
- jedi =0.14.1
1718
- keyring
18-
- nbconvert
19-
- numpydoc
19+
- nbconvert >=4.0
20+
- numpydoc >=0.6.0
21+
- paramiko >=2.4.0
2022
- parso =0.5.2
21-
- pexpect
22-
- pickleshare
23-
- psutil
23+
- pexpect >=4.4.0
24+
- pickleshare >=0.4
25+
- psutil >=5.3
2426
- pygments >=2.0
25-
- pylint
27+
- pylint >=0.25
2628
- pyqt <5.13
2729
- python-language-server >=0.31.2,<0.32.0
28-
- pyxdg
29-
- pyzmq
30+
- pyxdg >=0.26
31+
- pyzmq >=17
3032
- qdarkstyle >=2.7
3133
- qtawesome >=0.5.7
3234
- qtconsole >=4.6.0
3335
- qtpy >=1.5.0
34-
- rtree
35-
- sphinx
36+
- rtree >=0.8.3
37+
- sphinx >=0.6.6
3638
- spyder-kernels >=1.8.1,<2.0.0
3739
- watchdog
3840

requirements/conda.txt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,32 @@
22
# So to get performant launches on mybinder.org, we have copied
33
# the contents of this file to binder/environment.yml. If you
44
# make changes here, please copy them over there too.
5-
applaunchservices
6-
atomicwrites
5+
applaunchservices >=0.1.7
6+
atomicwrites >=1.2.0
77
chardet >=2.0.0
8-
cloudpickle
9-
diff-match-patch
8+
cloudpickle >=0.5.0
9+
diff-match-patch >=20181111
1010
intervaltree
11+
IPython >=4.0
1112
jedi =0.14.1
1213
keyring
13-
nbconvert
14-
numpydoc
14+
nbconvert >=4.0
15+
numpydoc >=0.6.0
16+
Paramiko >=2.4.0
1517
parso =0.5.2
16-
pexpect
17-
pickleshare
18+
pexpect >=4.4.0
19+
pickleshare >=0.4
1820
psutil >=5.3
1921
pygments >=2.0
20-
pylint
22+
pylint >=0.25
2123
pyqt <5.13
2224
python-language-server >=0.31.2,<0.32.0
23-
pyxdg
24-
pyzmq
25+
pyxdg >=0.26
26+
pyzmq >=17
2527
qdarkstyle >=2.7
2628
qtawesome >=0.5.7
2729
qtconsole >=4.6.0
2830
qtpy >=1.5.0
29-
rtree
30-
sphinx
31+
sphinx >=0.6.6
3132
spyder-kernels >=1.8.1,<2.0.0
3233
watchdog

setup.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,38 +200,39 @@ def run(self):
200200
import setuptools # analysis:ignore
201201

202202
install_requires = [
203-
'applaunchservices;platform_system=="Darwin"',
204-
'atomicwrites',
203+
'applaunchservices>=0.1.7;platform_system=="Darwin"',
204+
'atomicwrites>=1.2.0',
205205
'chardet>=2.0.0',
206-
'cloudpickle',
207-
'diff-match-patch',
206+
'cloudpickle>=0.5.0',
207+
'diff-match-patch>=20181111',
208208
'intervaltree',
209+
'ipython>=4.0',
209210
# This is here until Jedi 0.15+ fixes completions for
210211
# Numpy and Pandas
211212
'jedi==0.14.1',
212213
# Don't require keyring for Python 2 and Linux
213214
# because it depends on system packages
214215
'keyring;sys_platform!="linux2"',
215-
'nbconvert',
216-
'numpydoc',
216+
'nbconvert>=4.0',
217+
'numpydoc>=0.6.0',
217218
# Required to get SSH connections to remote kernels
218-
'paramiko;platform_system=="Windows"',
219+
'paramiko>=2.4.0;platform_system=="Windows"',
219220
'parso==0.5.2',
220-
'pexpect',
221-
'pickleshare',
222-
'psutil',
221+
'pexpect>=4.4.0',
222+
'pickleshare>=0.4',
223+
'psutil>=5.3',
223224
'pygments>=2.0',
224-
'pylint',
225+
'pylint>=0.25',
225226
'pyqt5<5.13;python_version>="3"',
226227
'pyqtwebengine<5.13;python_version>="3"',
227228
'python-language-server[all]>=0.31.2,<0.32.0',
228229
'pyxdg>=0.26;platform_system=="Linux"',
229-
'pyzmq',
230+
'pyzmq>=17',
230231
'qdarkstyle>=2.7',
231232
'qtawesome>=0.5.7',
232233
'qtconsole>=4.6.0',
233234
'qtpy>=1.5.0',
234-
'sphinx',
235+
'sphinx>=0.6.6',
235236
'spyder-kernels>=1.8.1,<2.0.0',
236237
'watchdog',
237238
]

spyder/dependencies.py

Lines changed: 40 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
NBCONVERT_REQVER = '>=4.0'
4242
NUMPYDOC_REQVER = '>=0.6.0'
4343
PARAMIKO_REQVER = '>=2.4.0'
44+
PARSO_REQVER = '=0.5.2'
4445
PEXPECT_REQVER = '>=4.4.0'
4546
PICKLESHARE_REQVER = '>=0.4'
4647
PSUTIL_REQVER = '>=5.3'
@@ -73,17 +74,12 @@
7374
# NOTE: We declare our dependencies in **alphabetical** order
7475
# =============================================================================
7576
# List of descriptions
76-
DESCRIPTIONS = []
77-
78-
if sys.platform == "darwin":
79-
DESCRIPTIONS.append(
80-
{'modname': "applaunchservices",
81-
'package_name': "applaunchservices",
82-
'features': _("Notify macOS that Spyder can open Python files"),
83-
'required_version': APPLAUNCHSERVICES_REQVER})
84-
85-
86-
DESCRIPTIONS += [
77+
DESCRIPTIONS = [
78+
{'modname': "applaunchservices",
79+
'package_name': "applaunchservices",
80+
'features': _("Notify macOS that Spyder can open Python files"),
81+
'required_version': APPLAUNCHSERVICES_REQVER,
82+
'display': sys.platform == "darwin"},
8783
{'modname': "atomicwrites",
8884
'package_name': "atomicwrites",
8985
'features': _("Atomic file writes in the Editor"),
@@ -97,7 +93,7 @@
9793
'features': _("Handle communications between kernel and frontend"),
9894
'required_version': CLOUDPICKLE_REQVER},
9995
{'modname': "diff_match_patch",
100-
'package_name': "diff_match_patch",
96+
'package_name': "diff-match-patch",
10197
'features': _("Compute text file diff changes during edition"),
10298
'required_version': DIFF_MATCH_PATCH_REQVER},
10399
{'modname': "intervaltree",
@@ -111,41 +107,29 @@
111107
{'modname': "jedi",
112108
'package_name': "jedi",
113109
'features': _("Main backend for the Python Language Server"),
114-
'required_version': JEDI_REQVER}
115-
]
116-
117-
118-
if sys.platform.startswith('linux') and not PY2:
119-
DESCRIPTIONS.append(
120-
{'modname': "keyring",
121-
'package_name': "keyring",
122-
'features': _("Save Github credentials to report internal errors securely"),
123-
'required_version': KEYRING_REQVER}
124-
)
125-
126-
127-
DESCRIPTIONS += [
110+
'required_version': JEDI_REQVER},
111+
{'modname': "keyring",
112+
'package_name': "keyring",
113+
'features': _("Save Github credentials to report internal errors securely"),
114+
'required_version': KEYRING_REQVER,
115+
'display': sys.platform.startswith('linux') and not PY2},
128116
{'modname': "nbconvert",
129117
'package_name': "nbconvert",
130118
'features': _("Manipulate Jupyter notebooks in the Editor"),
131119
'required_version': NBCONVERT_REQVER},
132120
{'modname': "numpydoc",
133121
'package_name': "numpydoc",
134122
'features': _("Improve code completion for objects that use Numpy docstrings"),
135-
'required_version': NUMPYDOC_REQVER}
136-
]
137-
138-
139-
if sys.platform == 'nt':
140-
DESCRIPTIONS.append(
141-
{'modname': "paramiko",
142-
'package_name': "paramiko",
143-
'features': _("Connect to remote kernels through SSH"),
144-
'required_version': PARAMIKO_REQVER}
145-
)
146-
147-
148-
DESCRIPTIONS += [
123+
'required_version': NUMPYDOC_REQVER},
124+
{'modname': "paramiko",
125+
'package_name': "paramiko",
126+
'features': _("Connect to remote kernels through SSH"),
127+
'required_version': PARAMIKO_REQVER,
128+
'display': sys.platform == 'nt'},
129+
{'modname': "parso",
130+
'package_name': "parso",
131+
'features': _("Python parser that supports error recovery and round-trip parsing"),
132+
'required_version': PARSO_REQVER},
149133
{'modname': "pexpect",
150134
'package_name': "pexpect",
151135
'features': _("Stdio support for our language server client"),
@@ -169,20 +153,12 @@
169153
{'modname': 'pyls',
170154
'package_name': 'python-language-server',
171155
'features': _("Code completion and linting for the Editor"),
172-
'required_version': PYLS_REQVER}
173-
]
174-
175-
176-
if sys.platform.startswith('linux'):
177-
DESCRIPTIONS.append(
178-
{'modname': "xdg",
179-
'package_name': "pyxdg",
180-
'features': _("Parse desktop files on Linux"),
181-
'required_version': PYXDG_REQVER}
182-
)
183-
184-
185-
DESCRIPTIONS += [
156+
'required_version': PYLS_REQVER},
157+
{'modname': "xdg",
158+
'package_name': "pyxdg",
159+
'features': _("Parse desktop files on Linux"),
160+
'required_version': PYXDG_REQVER,
161+
'display': sys.platform.startswith('linux')},
186162
{'modname': "zmq",
187163
'package_name': "pyzmq",
188164
'features': _("Client for the language server protocol (LSP)"),
@@ -202,20 +178,12 @@
202178
{'modname': "qtpy",
203179
'package_name': "qtpy",
204180
'features': _("Abstraction layer for Python Qt bindings."),
205-
'required_version': QTPY_REQVER}
206-
]
207-
208-
209-
if is_anaconda():
210-
DESCRIPTIONS.append(
211-
{'modname': "rtree",
212-
'package_name': "rtree",
213-
'features': _("Fast access to code snippets regions"),
214-
'required_version': RTREE_REQVER}
215-
)
216-
217-
218-
DESCRIPTIONS += [
181+
'required_version': QTPY_REQVER},
182+
{'modname': "rtree",
183+
'package_name': "rtree",
184+
'features': _("Fast access to code snippets regions"),
185+
'required_version': RTREE_REQVER,
186+
'display': is_anaconda()},
219187
{'modname': "sphinx",
220188
'package_name': "sphinx",
221189
'features': _("Show help for objects in the Editor and Consoles in a dedicated pane"),
@@ -398,6 +366,7 @@ def missing_dependencies():
398366

399367
def declare_dependencies():
400368
for dep in DESCRIPTIONS:
401-
add(dep['modname'], dep['package_name'],
402-
dep['features'], dep['required_version'],
403-
kind=dep.get('kind', MANDATORY))
369+
if dep.get('display', True):
370+
add(dep['modname'], dep['package_name'],
371+
dep['features'], dep['required_version'],
372+
kind=dep.get('kind', MANDATORY))

0 commit comments

Comments
 (0)