Skip to content

Commit

Permalink
Merge pull request #161 from Zsailer/release
Browse files Browse the repository at this point in the history
0.2.0 release
  • Loading branch information
Zsailer authored Dec 19, 2019
2 parents 65617ff + cb1d424 commit 5502b66
Show file tree
Hide file tree
Showing 79 changed files with 4,670 additions and 4,037 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]


## [0.2.0] - 2019-12-19

### Added
- `extension` submodule ([#48](https://github.com/jupyter/jupyter_server/pull/48))
- ExtensionApp - configurable JupyterApp-subclass for server extensions
- Most useful for Jupyter frontends, like Notebook, JupyterLab, nteract, voila etc.
- Launch with entrypoints
- Configure from file or CLI
- Add custom templates, static assets, handlers, etc.
- Static assets are served behind a `/static/<extension_name>` endpoint.
- 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))
- ExtensionHandler - tornado handlers for extensions.
- Finds static assets at `/static/<extension_name>`

### Changed
- `jupyter serverextension <command>` entrypoint has been changed to `jupyter server extension <command>`.
- `toggle_jupyter_server` and `validate_jupyter_server` function no longer take a Logger object as an argument.
- Changed testing framework from nosetests to pytest ([#152](https://github.com/jupyter/jupyter_server/pull/152))
- Depend on pytest-tornasync extension for handling tornado/asyncio eventloop
- Depend on pytest-console-scripts for testing CLI entrypoints
- Added Github actions as a testing framework along side Travis and Azure ([#146](https://github.com/jupyter/jupyter_server/pull/146))

### Removed
- Removed the option to update `root_dir` trait in FileContentsManager and MappingKernelManager in ServerApp ([#135](https://github.com/jupyter/jupyter_server/pull/135))

### Fixed
- Synced Jupyter Server with Notebook PRs in batches (ended on 2019-09-27)
- [Batch 1](https://github.com/jupyter/jupyter_server/pull/95)
- [Batch 2](https://github.com/jupyter/jupyter_server/pull/97)
- [Batch 3](https://github.com/jupyter/jupyter_server/pull/98)
- [Batch 4](https://github.com/jupyter/jupyter_server/pull/99)
- [Batch 5](https://github.com/jupyter/jupyter_server/pull/103)
- [Batch 6](https://github.com/jupyter/jupyter_server/pull/104)
- [Batch 7](https://github.com/jupyter/jupyter_server/pull/105)
- [Batch 8](https://github.com/jupyter/jupyter_server/pull/106)

### Security
- Added a "secure_write to function for cookie/token saves ([#77](https://github.com/jupyter/jupyter_server/pull/77))
5 changes: 2 additions & 3 deletions jupyter_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""The Jupyter Server"""

from ._version import version_info, __version__
import os

DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static")
DEFAULT_TEMPLATE_PATH_LIST = [
os.path.dirname(__file__),
os.path.join(os.path.dirname(__file__), 'templates'),
os.path.join(os.path.dirname(__file__), "templates"),
]

del os

from ._version import version_info, __version__
3 changes: 2 additions & 1 deletion jupyter_server/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import absolute_import

if __name__ == '__main__':
if __name__ == "__main__":
from jupyter_server import serverapp as app

app.launch_new_instance()
25 changes: 14 additions & 11 deletions jupyter_server/_sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import jupyter_server


def pkg_commit_hash(pkg_path):
"""Get short form of commit hash given directory `pkg_path`
Expand Down Expand Up @@ -45,23 +46,25 @@ def pkg_commit_hash(pkg_path):
par_path = pkg_path
while cur_path != par_path:
cur_path = par_path
if p.exists(p.join(cur_path, '.git')):
if p.exists(p.join(cur_path, ".git")):
try:
proc = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=pkg_path)
proc = subprocess.Popen(
["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=pkg_path,
)
repo_commit, _ = proc.communicate()
except OSError:
repo_commit = None

if repo_commit:
return 'repository', repo_commit.strip().decode('ascii')
return "repository", repo_commit.strip().decode("ascii")
else:
return u'', u''
return u"", u""
par_path = p.dirname(par_path)
return u'', u''

return u"", u""


def pkg_info(pkg_path):
Expand Down Expand Up @@ -89,11 +92,11 @@ def pkg_info(pkg_path):
platform=platform.platform(),
os_name=os.name,
default_encoding=encoding.DEFAULT_ENCODING,
)
)


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

11 changes: 9 additions & 2 deletions jupyter_server/_tz.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# constant for zero offset
ZERO = timedelta(0)


class tzUTC(tzinfo):
"""tzinfo object for UTC (zero offset)"""

Expand All @@ -22,21 +23,27 @@ def utcoffset(self, d):
def dst(self, d):
return ZERO


UTC = tzUTC()


def utc_aware(unaware):
"""decorator for adding UTC tzinfo to datetime's utcfoo methods"""

def utc_method(*args, **kwargs):
dt = unaware(*args, **kwargs)
return dt.replace(tzinfo=UTC)

return utc_method


utcfromtimestamp = utc_aware(datetime.utcfromtimestamp)
utcnow = utc_aware(datetime.utcnow)


def isoformat(dt):
"""Return iso-formatted timestamp
Like .isoformat(), but uses Z for UTC instead of +00:00
"""
return dt.isoformat().replace('+00:00', 'Z')
return dt.isoformat().replace("+00:00", "Z")
4 changes: 2 additions & 2 deletions jupyter_server/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

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

version_info = (0, 2, 0, '.dev0')
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
version_info = (0, 2, 0, "")
__version__ = ".".join(map(str, version_info[:3])) + "".join(version_info[3:])
66 changes: 36 additions & 30 deletions jupyter_server/auth/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,44 @@
import argparse
import sys


def set_password(args):
password = args.password
while not password :
password1 = getpass("" if args.quiet else "Provide password: ")
password_repeat = getpass("" if args.quiet else "Repeat password: ")
if password1 != password_repeat:
print("Passwords do not match, try again")
elif len(password1) < 4:
print("Please provide at least 4 characters")
else:
password = password1
password = args.password
while not password:
password1 = getpass("" if args.quiet else "Provide password: ")
password_repeat = getpass("" if args.quiet else "Repeat password: ")
if password1 != password_repeat:
print("Passwords do not match, try again")
elif len(password1) < 4:
print("Please provide at least 4 characters")
else:
password = password1

password_hash = passwd(password)
cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
cfg.update("jupyter_server_config", {"ServerApp": {"password": password_hash,}})
if not args.quiet:
print("password stored in config dir: %s" % jupyter_config_dir())

password_hash = passwd(password)
cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
cfg.update('jupyter_server_config', {
'ServerApp': {
'password': password_hash,
}
})
if not args.quiet:
print("password stored in config dir: %s" % jupyter_config_dir())

def main(argv):
parser = argparse.ArgumentParser(argv[0])
subparsers = parser.add_subparsers()
parser_password = subparsers.add_parser('password', help='sets a password for your jupyter server')
parser_password.add_argument("password", help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
nargs="?")
parser_password.add_argument("--quiet", help="suppress messages", action="store_true")
parser_password.set_defaults(function=set_password)
args = parser.parse_args(argv[1:])
args.function(args)

parser = argparse.ArgumentParser(argv[0])
subparsers = parser.add_subparsers()
parser_password = subparsers.add_parser(
"password", help="sets a password for your jupyter server"
)
parser_password.add_argument(
"password",
help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
nargs="?",
)
parser_password.add_argument(
"--quiet", help="suppress messages", action="store_true"
)
parser_password.set_defaults(function=set_password)
args = parser.parse_args(argv[1:])
args.function(args)


if __name__ == "__main__":
main(sys.argv)
main(sys.argv)
Loading

0 comments on commit 5502b66

Please sign in to comment.