Skip to content

Commit

Permalink
Merge pull request #240 from davidbrochart/win_py36
Browse files Browse the repository at this point in the history
Fix python<3.7 on windows
  • Loading branch information
Zsailer authored Jun 2, 2020
2 parents f1df254 + 9a64b9d commit 104e0c1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.5', '3.6', '3.7', '3.8' ]
exclude:
- os: windows-latest
python-version: '3.5'
- os: windows-latest
python-version: '3.6'
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ To install the latest release locally, make sure you have

$ pip install jupyter_server

Jupyter Server currently supports the following Python versions:

Platform | Python
--- | ---
Linux | >=3.5
OSX | >=3.5
Windows | >=3.7
Jupyter Server currently supports Python>=3.5 on Linux, OSX and Windows.

### Versioning and Branches

Expand Down
15 changes: 15 additions & 0 deletions jupyter_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""The Jupyter Server"""

import os
import sys
import subprocess

DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static")
DEFAULT_TEMPLATE_PATH_LIST = [
Expand All @@ -11,3 +13,16 @@
del os

from ._version import version_info, __version__


def _cleanup():
pass


# patch subprocess on Windows for python<3.7
# see https://bugs.python.org/issue37380
# the fix for python3.7: https://github.com/python/cpython/pull/15706/files
if sys.platform == 'win32':
if sys.version_info < (3, 7):
subprocess._cleanup = _cleanup
subprocess._active = None
14 changes: 4 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
name = "jupyter_server"

# Minimal Python version sanity check
if sys.platform == 'win32':
if sys.version_info < (3,7):
error = "ERROR: %s requires Python version 3.7 or above." % name
print(error, file=sys.stderr)
sys.exit(1)
else:
if sys.version_info < (3,5):
error = "ERROR: %s requires Python version 3.5 or above." % name
print(error, file=sys.stderr)
sys.exit(1)
if sys.version_info < (3,5):
error = "ERROR: %s requires Python version 3.5 or above." % name
print(error, file=sys.stderr)
sys.exit(1)

# At least we're on the python version we need, move on.

Expand Down

0 comments on commit 104e0c1

Please sign in to comment.