Skip to content

Commit ce0d324

Browse files
authored
Merge pull request #56 from man-group/release-0.3.0
0.3.0 with some quality of life improvements
2 parents 6caf2bb + 32c8864 commit ce0d324

File tree

15 files changed

+91
-24
lines changed

15 files changed

+91
-24
lines changed

.circleci/config.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,20 @@ defaults: &defaults
2020
- run:
2121
name: Version checks
2222
command: |
23-
grep -q $VERSION notebooker/_version.py || (echo "ERROR: Version number not found in notebooker/_version.py: $VERSION"; exit 1)
23+
grep -q $VERSION notebooker/version.py || (echo "ERROR: Version number not found in notebooker/_version.py: $VERSION"; exit 1)
2424
grep -q $VERSION CHANGELOG.md || (echo "ERROR: Version number not found in CHANGES.md: $VERSION"; exit 1)
2525
grep -q $VERSION docs/conf.py || (echo "ERROR: Version number not found in docs/source/conf.py: $VERSION"; exit 1)
2626
grep -q $VERSION notebooker/web/static/package.json || (echo "ERROR: Version number not found in package.json: $VERSION"; exit 1)
27+
- run:
28+
name: Output useful stuff
29+
command: |
30+
echo $VERSION > "$CIRCLE_ARTIFACTS/version.txt"
31+
# Find the lines of the changelog between releases, escape double quotes, delete empty lines
32+
sed -n '{ /------/= }' CHANGELOG.md \
33+
| head -n 2 \
34+
| xargs -n 2 bash -c 'sed -n "s/\"/\\\\\"/g;`expr $0 + 1`,`expr $1 - 2`p" CHANGELOG.md' \
35+
| sed '/^$/d' \
36+
> "$CIRCLE_ARTIFACTS/changes.md"
2737
- run:
2838
name: Install MongoDB
2939
command: |
@@ -136,10 +146,6 @@ defaults: &defaults
136146
python setup.py sdist
137147
mkdir -p "$CIRCLE_ARTIFACTS/dist"
138148
cp -r ./dist/* "$CIRCLE_ARTIFACTS/dist"
139-
- run:
140-
name: Upload to PyPI
141-
command: |
142-
echo $VERSION > "$CIRCLE_ARTIFACTS/version.txt"
143149
- run:
144150
name: Upload to PyPI
145151
command: |
@@ -162,6 +168,7 @@ defaults: &defaults
162168
root: /tmp/circleci-artifacts
163169
paths:
164170
- ./*/version.txt
171+
- ./*/changes.md
165172
- ./*/dist/*
166173
version: 2
167174
jobs:
@@ -170,7 +177,7 @@ jobs:
170177
PYTHON_VERSION: "3_6"
171178
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts/3_6
172179
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results/3_6
173-
VERSION: 0.2.1
180+
VERSION: 0.3.0
174181
PANDOC_RELEASES_URL: https://github.com/jgm/pandoc/releases
175182
YARN_STATIC_DIR: notebooker/web/static/
176183
IMAGE_NAME: mangroup/notebooker
@@ -182,7 +189,7 @@ jobs:
182189
environment:
183190
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts/3_7
184191
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results/3_7
185-
VERSION: 0.2.1
192+
VERSION: 0.3.0
186193
PANDOC_RELEASES_URL: https://github.com/jgm/pandoc/releases
187194
YARN_STATIC_DIR: notebooker/web/static/
188195
IMAGE_NAME: mangroup/notebooker
@@ -200,7 +207,15 @@ jobs:
200207
name: "Publish release on GitHub"
201208
command: |
202209
VERSION=$(cat /tmp/circleci-artifacts/3_6/version.txt)
203-
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -soft ${VERSION} /tmp/circleci-artifacts/3_6/dist
210+
CHANGES=$(cat /tmp/circleci-artifacts/3_6/changes.md)
211+
ghr -t ${GITHUB_TOKEN} \
212+
-u ${CIRCLE_PROJECT_USERNAME} \
213+
-r ${CIRCLE_PROJECT_REPONAME} \
214+
-c ${CIRCLE_SHA1} \
215+
-n ${VERSION} \
216+
-b "${CHANGES}" \
217+
-soft \
218+
${VERSION} /tmp/circleci-artifacts/3_6/dist
204219
workflows:
205220
version: 2
206221
build_all:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
0.3.0 (2021-10-05)
2+
------------------
3+
4+
* Major feature: scheduling natively within Notebooker
5+
* See [the docs](https://notebooker.readthedocs.io/en/latest/webapp/webapp.html#scheduling-a-report) for more info.
6+
* Bugfix: Newer versions of uuid now work properly with Notebooker
7+
* Improvement: See the version number in the Notebooker GUI and with a /core/version GET call.
8+
9+
110
0.2.1 (2021-02-11)
211
------------------
312

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Do also make sure to run the webapp and make sure you haven't broken anything.
1818

1919
# Releasing a new version
2020
When releasing a new version, please increment the version number in:
21-
* `notebooker/_version.py`
21+
* `notebooker/version.py`
2222
* `.circleci/config.yml`
2323
* `docs/config.yml`
2424
* `notebooker/web/static/package.json`

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = "Man Group Quant Tech"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = "0.2.1"
26+
release = "0.3.0"
2727

2828

2929
# -- General configuration ---------------------------------------------------

notebooker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from ._version import __version__
1+
from .version import __version__
22

33
__import__("pkg_resources").declare_namespace(__name__)

notebooker/_entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import click
55

66
from notebooker import notebook_templates_example
7-
from notebooker._version import __version__
7+
from notebooker.version import __version__
88
from notebooker.constants import DEFAULT_SERIALIZER
99
from notebooker.execute_notebook import execute_notebook_entrypoint
1010
from notebooker.serialization import SERIALIZER_TO_CLI_OPTIONS

notebooker/_version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

notebooker/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.3.0"

notebooker/web/routes/core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from flask import Blueprint, jsonify, request
22

3+
import notebooker.version
34
from notebooker.utils.results import get_all_available_results_json
45
from notebooker.web.utils import get_serializer, get_all_possible_templates, all_templates_flattened
56

@@ -53,3 +54,13 @@ def all_possible_templates_flattened():
5354
:returns: A JSON which is a list of all possible templates with their full names.
5455
"""
5556
return jsonify({"result": all_templates_flattened()})
57+
58+
59+
@core_bp.route("/core/version")
60+
def get_version_no():
61+
"""
62+
Core function which returns the Notebooker version number.
63+
64+
:returns: A JSON mapping from "version" to the string repr of the version number.
65+
"""
66+
return jsonify({"version": notebooker.version.__version__})

notebooker/web/static/notebooker/header.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
$(document).ready(() => {
2+
$.ajax({
3+
url: '/core/version',
4+
success: (result) => {
5+
$('#versionTitle').text("v" + result.version);
6+
$('#versionTitle').show();
7+
},
8+
error: () => {
9+
$('#versionTitle').hide();
10+
},
11+
});
212
// Check auth is enabled on our host
313
$.ajax({
414
url: '/oauth/health',

0 commit comments

Comments
 (0)