Skip to content

Commit 8aa04b9

Browse files
committed
Enforce version number at build time.
Prevent making releases with wrong version number that will confuse pip, or make sdists to appear more recent than wheels.
1 parent 8de7a52 commit 8aa04b9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

notebook/static/base/js/namespace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(function(){
7373
// tree
7474
jglobal('SessionList','tree/js/sessionlist');
7575

76-
Jupyter.version = "5.0.0-rc.1";
76+
Jupyter.version = "5.0.0.dev";
7777
Jupyter._target = '_blank';
7878
return Jupyter;
7979
});

setupbase.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from __future__ import print_function
1515

1616
import os
17+
import re
1718
import pipes
1819
import shutil
1920
import sys
@@ -69,6 +70,11 @@ def execfile(fname, globs, locs=None):
6970
version = version_ns['__version__']
7071

7172

73+
# vendored from pep440 package, we allow `.dev` suffix without trailing number.
74+
loose_pep440re = re.compile(r'^([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*)?)?$')
75+
if not loose_pep440re.match(version):
76+
raise ValueError('Invalid version number `%s`, please follow pep440 convention or pip will get confused about which package is more recent.' % version)
77+
7278
#---------------------------------------------------------------------------
7379
# Find packages
7480
#---------------------------------------------------------------------------

0 commit comments

Comments
 (0)