Skip to content

Commit 5502b66

Browse files
authored
Merge pull request #161 from Zsailer/release
0.2.0 release
2 parents 65617ff + cb1d424 commit 5502b66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4670
-4037
lines changed

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
11+
## [0.2.0] - 2019-12-19
12+
13+
### Added
14+
- `extension` submodule ([#48](https://github.com/jupyter/jupyter_server/pull/48))
15+
- ExtensionApp - configurable JupyterApp-subclass for server extensions
16+
- Most useful for Jupyter frontends, like Notebook, JupyterLab, nteract, voila etc.
17+
- Launch with entrypoints
18+
- Configure from file or CLI
19+
- Add custom templates, static assets, handlers, etc.
20+
- Static assets are served behind a `/static/<extension_name>` endpoint.
21+
- Run server extensions in "standalone mode" ([#70](https://github.com/jupyter/jupyter_server/pull/70) and [#76](https://github.com/jupyter/jupyter_server/pull/76))
22+
- ExtensionHandler - tornado handlers for extensions.
23+
- Finds static assets at `/static/<extension_name>`
24+
25+
### Changed
26+
- `jupyter serverextension <command>` entrypoint has been changed to `jupyter server extension <command>`.
27+
- `toggle_jupyter_server` and `validate_jupyter_server` function no longer take a Logger object as an argument.
28+
- Changed testing framework from nosetests to pytest ([#152](https://github.com/jupyter/jupyter_server/pull/152))
29+
- Depend on pytest-tornasync extension for handling tornado/asyncio eventloop
30+
- Depend on pytest-console-scripts for testing CLI entrypoints
31+
- Added Github actions as a testing framework along side Travis and Azure ([#146](https://github.com/jupyter/jupyter_server/pull/146))
32+
33+
### Removed
34+
- Removed the option to update `root_dir` trait in FileContentsManager and MappingKernelManager in ServerApp ([#135](https://github.com/jupyter/jupyter_server/pull/135))
35+
36+
### Fixed
37+
- Synced Jupyter Server with Notebook PRs in batches (ended on 2019-09-27)
38+
- [Batch 1](https://github.com/jupyter/jupyter_server/pull/95)
39+
- [Batch 2](https://github.com/jupyter/jupyter_server/pull/97)
40+
- [Batch 3](https://github.com/jupyter/jupyter_server/pull/98)
41+
- [Batch 4](https://github.com/jupyter/jupyter_server/pull/99)
42+
- [Batch 5](https://github.com/jupyter/jupyter_server/pull/103)
43+
- [Batch 6](https://github.com/jupyter/jupyter_server/pull/104)
44+
- [Batch 7](https://github.com/jupyter/jupyter_server/pull/105)
45+
- [Batch 8](https://github.com/jupyter/jupyter_server/pull/106)
46+
47+
### Security
48+
- Added a "secure_write to function for cookie/token saves ([#77](https://github.com/jupyter/jupyter_server/pull/77))

jupyter_server/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"""The Jupyter Server"""
22

3+
from ._version import version_info, __version__
34
import os
45

56
DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static")
67
DEFAULT_TEMPLATE_PATH_LIST = [
78
os.path.dirname(__file__),
8-
os.path.join(os.path.dirname(__file__), 'templates'),
9+
os.path.join(os.path.dirname(__file__), "templates"),
910
]
1011

1112
del os
12-
13-
from ._version import version_info, __version__

jupyter_server/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import absolute_import
22

3-
if __name__ == '__main__':
3+
if __name__ == "__main__":
44
from jupyter_server import serverapp as app
5+
56
app.launch_new_instance()

jupyter_server/_sysinfo.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import jupyter_server
2020

21+
2122
def pkg_commit_hash(pkg_path):
2223
"""Get short form of commit hash given directory `pkg_path`
2324
@@ -45,23 +46,25 @@ def pkg_commit_hash(pkg_path):
4546
par_path = pkg_path
4647
while cur_path != par_path:
4748
cur_path = par_path
48-
if p.exists(p.join(cur_path, '.git')):
49+
if p.exists(p.join(cur_path, ".git")):
4950
try:
50-
proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
51-
stdout=subprocess.PIPE,
52-
stderr=subprocess.PIPE,
53-
cwd=pkg_path)
51+
proc = subprocess.Popen(
52+
["git", "rev-parse", "--short", "HEAD"],
53+
stdout=subprocess.PIPE,
54+
stderr=subprocess.PIPE,
55+
cwd=pkg_path,
56+
)
5457
repo_commit, _ = proc.communicate()
5558
except OSError:
5659
repo_commit = None
5760

5861
if repo_commit:
59-
return 'repository', repo_commit.strip().decode('ascii')
62+
return "repository", repo_commit.strip().decode("ascii")
6063
else:
61-
return u'', u''
64+
return u"", u""
6265
par_path = p.dirname(par_path)
63-
64-
return u'', u''
66+
67+
return u"", u""
6568

6669

6770
def pkg_info(pkg_path):
@@ -89,11 +92,11 @@ def pkg_info(pkg_path):
8992
platform=platform.platform(),
9093
os_name=os.name,
9194
default_encoding=encoding.DEFAULT_ENCODING,
92-
)
95+
)
96+
9397

9498
def get_sys_info():
9599
"""Return useful information about the system as a dict."""
96100
p = os.path
97101
path = p.realpath(p.dirname(p.abspath(p.join(jupyter_server.__file__))))
98102
return pkg_info(path)
99-

jupyter_server/_tz.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# constant for zero offset
1414
ZERO = timedelta(0)
1515

16+
1617
class tzUTC(tzinfo):
1718
"""tzinfo object for UTC (zero offset)"""
1819

@@ -22,21 +23,27 @@ def utcoffset(self, d):
2223
def dst(self, d):
2324
return ZERO
2425

26+
2527
UTC = tzUTC()
2628

29+
2730
def utc_aware(unaware):
2831
"""decorator for adding UTC tzinfo to datetime's utcfoo methods"""
32+
2933
def utc_method(*args, **kwargs):
3034
dt = unaware(*args, **kwargs)
3135
return dt.replace(tzinfo=UTC)
36+
3237
return utc_method
3338

39+
3440
utcfromtimestamp = utc_aware(datetime.utcfromtimestamp)
3541
utcnow = utc_aware(datetime.utcnow)
3642

43+
3744
def isoformat(dt):
3845
"""Return iso-formatted timestamp
39-
46+
4047
Like .isoformat(), but uses Z for UTC instead of +00:00
4148
"""
42-
return dt.isoformat().replace('+00:00', 'Z')
49+
return dt.isoformat().replace("+00:00", "Z")

jupyter_server/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
# Next beta/alpha/rc release: The version number for beta is X.Y.ZbN **without dots**.
1111

12-
version_info = (0, 2, 0, '.dev0')
13-
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
12+
version_info = (0, 2, 0, "")
13+
__version__ = ".".join(map(str, version_info[:3])) + "".join(version_info[3:])

jupyter_server/auth/__main__.py

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,44 @@
55
import argparse
66
import sys
77

8+
89
def set_password(args):
9-
password = args.password
10-
while not password :
11-
password1 = getpass("" if args.quiet else "Provide password: ")
12-
password_repeat = getpass("" if args.quiet else "Repeat password: ")
13-
if password1 != password_repeat:
14-
print("Passwords do not match, try again")
15-
elif len(password1) < 4:
16-
print("Please provide at least 4 characters")
17-
else:
18-
password = password1
10+
password = args.password
11+
while not password:
12+
password1 = getpass("" if args.quiet else "Provide password: ")
13+
password_repeat = getpass("" if args.quiet else "Repeat password: ")
14+
if password1 != password_repeat:
15+
print("Passwords do not match, try again")
16+
elif len(password1) < 4:
17+
print("Please provide at least 4 characters")
18+
else:
19+
password = password1
20+
21+
password_hash = passwd(password)
22+
cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
23+
cfg.update("jupyter_server_config", {"ServerApp": {"password": password_hash,}})
24+
if not args.quiet:
25+
print("password stored in config dir: %s" % jupyter_config_dir())
1926

20-
password_hash = passwd(password)
21-
cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
22-
cfg.update('jupyter_server_config', {
23-
'ServerApp': {
24-
'password': password_hash,
25-
}
26-
})
27-
if not args.quiet:
28-
print("password stored in config dir: %s" % jupyter_config_dir())
2927

3028
def main(argv):
31-
parser = argparse.ArgumentParser(argv[0])
32-
subparsers = parser.add_subparsers()
33-
parser_password = subparsers.add_parser('password', help='sets a password for your jupyter server')
34-
parser_password.add_argument("password", help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
35-
nargs="?")
36-
parser_password.add_argument("--quiet", help="suppress messages", action="store_true")
37-
parser_password.set_defaults(function=set_password)
38-
args = parser.parse_args(argv[1:])
39-
args.function(args)
40-
29+
parser = argparse.ArgumentParser(argv[0])
30+
subparsers = parser.add_subparsers()
31+
parser_password = subparsers.add_parser(
32+
"password", help="sets a password for your jupyter server"
33+
)
34+
parser_password.add_argument(
35+
"password",
36+
help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
37+
nargs="?",
38+
)
39+
parser_password.add_argument(
40+
"--quiet", help="suppress messages", action="store_true"
41+
)
42+
parser_password.set_defaults(function=set_password)
43+
args = parser.parse_args(argv[1:])
44+
args.function(args)
45+
46+
4147
if __name__ == "__main__":
42-
main(sys.argv)
48+
main(sys.argv)

0 commit comments

Comments
 (0)