Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python<3.7 on windows #240

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

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 = [
@@ -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
@@ -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.