Skip to content

Commit 73e6c27

Browse files
kevin-batesSteven Silvester
andauthored
Prevent inclusion of requests_unixsocket on Windows (jupyter#5650)
* Prevent inclusion of requests_unixsocket on Windows * lazily import Co-authored-by: Steven Silvester <[email protected]>
1 parent a8fbe7d commit 73e6c27

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

notebook/tests/launchnotebook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from unittest.mock import patch
1717

1818
import requests
19-
import requests_unixsocket
2019
from tornado.ioloop import IOLoop
2120
import zmq
2221

@@ -231,6 +230,9 @@ def base_url(cls):
231230

232231
@staticmethod
233232
def fetch_url(url):
233+
# Lazily import so it is not required at the module level
234+
if os.name != 'nt':
235+
import requests_unixsocket
234236
with requests_unixsocket.monkeypatch():
235237
return requests.get(url)
236238

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@
117117
],
118118
extras_require = {
119119
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters',
120-
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov',
121-
'requests-unixsocket'],
120+
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov'],
122121
'docs': ['sphinx', 'nbsphinx', 'sphinxcontrib_github_alt'],
123-
'test:sys_platform == "win32"': ['nose-exclude'],
122+
'test:sys_platform != "win32"': ['requests-unixsocket'],
124123
},
125124
python_requires = '>=3.5',
126125
entry_points = {

0 commit comments

Comments
 (0)