Skip to content

Commit

Permalink
Merge pull request #605 from jhamrick/0.3.x
Browse files Browse the repository at this point in the history
Create 0.3.2 release
  • Loading branch information
jhamrick committed Jan 11, 2017
2 parents dea6320 + e64f702 commit 61bf4a3
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 44 deletions.
2 changes: 1 addition & 1 deletion conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: nbgrader
version: "0.3.1"
version: "0.3.2"

source:
path: ..
Expand Down
9 changes: 9 additions & 0 deletions dev-requirements-windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pytest
pytest-cov
pytest-rerunfailures
coverage
selenium
invoke
sphinx
codecov
cov-core
9 changes: 1 addition & 8 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
pytest
pytest-cov
coverage
selenium
invoke
sphinx
codecov
cov-core
-r dev-requirements-windows.txt
pyenchant
sphinxcontrib-spelling
sphinx_rtd_theme
2 changes: 1 addition & 1 deletion nbgrader/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 3, 1)
version_info = (0, 3, 2)
__version__ = '.'.join(map(str, version_info))
2 changes: 2 additions & 0 deletions nbgrader/apps/notebookapp.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from tornado import ioloop
from notebook.notebookapp import NotebookApp


class FormgradeNotebookApp(NotebookApp):
"""A Subclass of the regular NotebookApp that can be spawned by the form grader."""
open_browser = False
token = '' # Notebook >=4.3

def _profile_default(self):
return 'nbgrader'
Expand Down
13 changes: 13 additions & 0 deletions nbgrader/docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ A summary of changes to nbgrader.
0.3.x
-----

0.3.2
~~~~~

Version 0.3.2 of nbgrader includes a few bugfixes pertaining to building nbgrader on conda-forge.

- PR #608: Fix Windows tests
- PR #601: Add shell config for invoke on windows
- PR #593: Send xsrf token in the X-XSRF-Token header for ajax
- PR #588: `basename` to wordslist
- PR #584: Changes for Notebook v4.3 tests

Thanks to lgpage, who made all the changes necessary for the 0.3.2 release!

0.3.1
~~~~~

Expand Down
5 changes: 5 additions & 0 deletions nbgrader/docs/source/contributor_guide/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ the rst version of it to ``.gitignore``.
Building documentation locally
------------------------------

.. warning::

Building the docs is not currently well-supported on Windows. This is because one of
the dependencies (enchant) does not install easily in Windows.

If you have made changes to the user guide or other notebooks that need to be
executed, please make sure you re-run all the documentation before committing.
While the documentation gets built automatically on Read The Docs, the notebooks do **not** get execute by Read The Docs -- they must be executed manually.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ nbgrader installs and builds with one command::

pip install -r dev-requirements.txt -e .

Currently, building docs is not supported on Windows because some of the dependencies (enchant)
are not easily installable. Instead of the above command, run the following on windows::

pip install -r dev-requirements-windows.txt -e .

Installing notebook extensions
------------------------------
Install the notebook extensions. The ``--symlink`` option is recommended since it
Expand Down
7 changes: 6 additions & 1 deletion nbgrader/docs/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
admin
Afterwards
ajax
alchemyst
alope
app
Expand All @@ -16,6 +17,7 @@ autograder
Autograder
autograding
backends
basename
Bitdiddle
bugfix
bugfixes
Expand Down Expand Up @@ -152,6 +154,9 @@ whositwhatnow
Wildcards
willingc
wordlist
wordslist
Workflow
workflow
workflows
workflows
xsrf
XSRF
36 changes: 18 additions & 18 deletions nbgrader/docs/source/user_guide/managing_assignment_files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@
"output_type": "stream",
"text": [
"total 40\n",
"-rw-r--r-- 1 jhamrick wheel 5733 Sep 22 13:31 jupyter.png\n",
"-rw-r--r-- 1 jhamrick wheel 8174 Sep 22 13:31 problem1.ipynb\n",
"-rw-r--r-- 1 jhamrick wheel 2518 Sep 22 13:31 problem2.ipynb\n"
"-rw-r--r-- 1 jhamrick wheel 5733 Jan 11 09:43 jupyter.png\n",
"-rw-r--r-- 1 jhamrick wheel 8174 Jan 11 09:43 problem1.ipynb\n",
"-rw-r--r-- 1 jhamrick wheel 2518 Jan 11 09:43 problem2.ipynb\n"
]
}
],
Expand Down Expand Up @@ -496,8 +496,8 @@
"output_type": "stream",
"text": [
"[SubmitApp | INFO] Source: /private/tmp/student_home/ps1\n",
"[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+ps1+2016-09-22 20:31:47 UTC\n",
"[SubmitApp | INFO] Submitted as: example_course ps1 2016-09-22 20:31:47 UTC\n"
"[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+ps1+2017-01-11 17:44:01 UTC\n",
"[SubmitApp | INFO] Submitted as: example_course ps1 2017-01-11 17:44:01 UTC\n"
]
}
],
Expand Down Expand Up @@ -527,9 +527,9 @@
"output_type": "stream",
"text": [
"total 8\n",
"drwxr-xr-x 3 jhamrick wheel 102 Sep 22 13:31 Library\n",
"-rw-r--r-- 1 jhamrick wheel 108 Sep 22 13:31 nbgrader_config.py\n",
"drwxr-xr-x 5 jhamrick wheel 170 Sep 22 13:31 ps1\n"
"drwxr-xr-x 3 jhamrick wheel 102 Jan 11 09:44 Library\n",
"-rw-r--r-- 1 jhamrick wheel 108 Jan 11 09:43 nbgrader_config.py\n",
"drwxr-xr-x 5 jhamrick wheel 170 Jan 11 09:43 ps1\n"
]
}
],
Expand Down Expand Up @@ -559,7 +559,7 @@
"output_type": "stream",
"text": [
"[ListApp | INFO] Submitted assignments:\n",
"[ListApp | INFO] example_course jhamrick ps1 2016-09-22 20:31:47 UTC\n"
"[ListApp | INFO] example_course jhamrick ps1 2017-01-11 17:44:01 UTC\n"
]
}
],
Expand Down Expand Up @@ -589,8 +589,8 @@
"output_type": "stream",
"text": [
"[SubmitApp | INFO] Source: /private/tmp/student_home/ps1\n",
"[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+ps1+2016-09-22 20:31:50 UTC\n",
"[SubmitApp | INFO] Submitted as: example_course ps1 2016-09-22 20:31:50 UTC\n"
"[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+ps1+2017-01-11 17:44:04 UTC\n",
"[SubmitApp | INFO] Submitted as: example_course ps1 2017-01-11 17:44:04 UTC\n"
]
}
],
Expand Down Expand Up @@ -620,8 +620,8 @@
"output_type": "stream",
"text": [
"[ListApp | INFO] Submitted assignments:\n",
"[ListApp | INFO] example_course jhamrick ps1 2016-09-22 20:31:47 UTC\n",
"[ListApp | INFO] example_course jhamrick ps1 2016-09-22 20:31:50 UTC\n"
"[ListApp | INFO] example_course jhamrick ps1 2017-01-11 17:44:01 UTC\n",
"[ListApp | INFO] example_course jhamrick ps1 2017-01-11 17:44:04 UTC\n"
]
}
],
Expand Down Expand Up @@ -774,8 +774,8 @@
"output_type": "stream",
"text": [
"[ListApp | INFO] Submitted assignments:\n",
"[ListApp | INFO] example_course jhamrick ps1 2016-09-22 20:31:47 UTC\n",
"[ListApp | INFO] example_course jhamrick ps1 2016-09-22 20:31:50 UTC\n"
"[ListApp | INFO] example_course jhamrick ps1 2017-01-11 17:44:01 UTC\n",
"[ListApp | INFO] example_course jhamrick ps1 2017-01-11 17:44:04 UTC\n"
]
}
],
Expand Down Expand Up @@ -832,9 +832,9 @@
"output_type": "stream",
"text": [
"total 0\n",
"drwxr-xr-x 3 jhamrick staff 102 Apr 4 13:05 bitdiddle\n",
"drwxr-xr-x 3 jhamrick staff 102 Apr 4 13:05 hacker\n",
"drwxr-xr-x 3 jhamrick staff 102 Sep 22 13:31 jhamrick\n"
"drwxr-xr-x 3 jhamrick staff 102 Sep 25 17:38 bitdiddle\n",
"drwxr-xr-x 3 jhamrick staff 102 Sep 25 17:38 hacker\n",
"drwxr-xr-x 3 jhamrick staff 102 Jan 11 09:44 jhamrick\n"
]
}
],
Expand Down
18 changes: 11 additions & 7 deletions nbgrader/nbextensions/static/assignment_list/assignment_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ define([
], function(Jupyter, $, utils, dialog) {
"use strict";

var ajax = utils.ajax || $.ajax;
// Notebook v4.3.1 enabled xsrf so use notebooks ajax that includes the
// xsrf token in the header data

var AssignmentList = function (released_selector, fetched_selector, submitted_selector, options) {
this.released_selector = released_selector;
this.fetched_selector = fetched_selector;
Expand Down Expand Up @@ -43,7 +47,7 @@ define([
error : utils.log_ajax_error,
};
var url = utils.url_join_encode(this.base_url, 'assignments');
$.ajax(url, settings);
ajax(url, settings);
};


Expand Down Expand Up @@ -95,15 +99,15 @@ define([
// to do the animation (borderSpacing).
$icon.animate({ borderSpacing: 90 }, {
step: function(now,fx) {
$icon.css('transform','rotate(-' + now + 'deg)');
$icon.css('transform','rotate(-' + now + 'deg)');
}
}, 250);
} else {
$link.down = true;
// See comment above.
$icon.animate({ borderSpacing: 0 }, {
step: function(now,fx) {
$icon.css('transform','rotate(-' + now + 'deg)');
$icon.css('transform','rotate(-' + now + 'deg)');
}
}, 250);
}
Expand Down Expand Up @@ -226,7 +230,7 @@ define([
'assignments',
'fetch'
);
$.ajax(url, settings);
ajax(url, settings);
});

} else if (this.data.status == 'fetched') {
Expand All @@ -253,7 +257,7 @@ define([
'assignments',
'submit'
);
$.ajax(url, settings);
ajax(url, settings);
});
}

Expand Down Expand Up @@ -321,7 +325,7 @@ define([
'assignments',
'validate'
);
$.ajax(url, settings);
ajax(url, settings);
});

return container;
Expand Down Expand Up @@ -389,4 +393,4 @@ define([
'Assignment': Assignment,
'Notebook': Notebook
};
});
});
1 change: 1 addition & 0 deletions nbgrader/tests/nbextensions/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def nbserver(request, port, tempdir, coursedir, jupyter_config_dir, jupyter_data
nbserver = sp.Popen([
sys.executable, "-m", "jupyter", "notebook",
"--no-browser",
"--NotebookApp.token=''", # Notebook >=4.3
"--port", str(port)], **kwargs)

def fin():
Expand Down
36 changes: 28 additions & 8 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import re

from invoke import task
from invoke import task, collection
from textwrap import dedent

import sys
Expand Down Expand Up @@ -45,7 +45,7 @@ def docs(ctx):
run(ctx, 'make -C nbgrader/docs spelling')


def _run_tests(ctx, mark=None, skip=None):
def _run_tests(ctx, mark=None, skip=None, junitxml=None):
if not WINDOWS:
import distutils.sysconfig
site = distutils.sysconfig.get_python_lib()
Expand Down Expand Up @@ -76,8 +76,11 @@ def _run_tests(ctx, mark=None, skip=None):
if not WINDOWS:
cmd.append('--cov nbgrader')
cmd.append('--no-cov-on-fail')
if junitxml:
cmd.extend(['--junitxml', junitxml])
cmd.append('-v')
cmd.append('-x')
cmd.extend(['--rerun', '1'])

marks = []
if mark is not None:
Expand All @@ -95,21 +98,21 @@ def _run_tests(ctx, mark=None, skip=None):


@task
def tests(ctx, group='all', skip=None):
def tests(ctx, group='all', skip=None, junitxml=None):
if group == 'python':
_run_tests(ctx, mark="not formgrader and not nbextensions", skip=skip)
_run_tests(ctx, mark="not formgrader and not nbextensions", skip=skip, junitxml=junitxml)

elif group == 'formgrader':
_run_tests(ctx, mark="formgrader", skip=skip)
_run_tests(ctx, mark="formgrader", skip=skip, junitxml=junitxml)

elif group == 'nbextensions':
_run_tests(ctx, mark="nbextensions", skip=skip)
_run_tests(ctx, mark="nbextensions", skip=skip, junitxml=junitxml)

elif group == 'docs':
docs(ctx)

elif group == 'all':
_run_tests(ctx, skip=skip)
_run_tests(ctx, skip=skip, junitxml=junitxml)

else:
raise ValueError("Invalid test group: {}".format(group))
Expand Down Expand Up @@ -139,7 +142,7 @@ def before_install(ctx, group, python_version):
# install jupyterhub
if python_version.startswith('3') and group == 'formgrader':
run(ctx, 'npm install -g configurable-http-proxy')
run(ctx, 'pip install jupyterhub')
run(ctx, 'pip install "jupyterhub<0.7"')


@task
Expand All @@ -150,3 +153,20 @@ def install(ctx, group):
else:
cmd = 'pip install -r dev-requirements.txt -e .'
run(ctx, 'PIP_FIND_LINKS=~/travis-wheels/wheelhouse {}'.format(cmd))


ns = collection.Collection(
after_success,
before_install,
docs,
install,
js,
tests,
)

if WINDOWS:
ns.configure({
'run': {
'shell': os.environ.get('COMSPEC', os.environ.get('SHELL')),
}
})

0 comments on commit 61bf4a3

Please sign in to comment.