File tree 3 files changed +16
-12
lines changed
3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -125,12 +125,13 @@ if [[ "$CIRCLE_JOB" == "doc-min-dependencies" ]]; then
125
125
conda config --set restore_free_channel true
126
126
fi
127
127
128
+ # packaging won't be needed once setuptools starts shipping packaging>=17.0
128
129
conda create -n $CONDA_ENV_NAME --yes --quiet python=" ${PYTHON_VERSION:-* } " \
129
130
numpy=" ${NUMPY_VERSION:-* } " scipy=" ${SCIPY_VERSION:-* } " \
130
131
cython=" ${CYTHON_VERSION:-* } " pytest coverage \
131
132
matplotlib=" ${MATPLOTLIB_VERSION:-* } " sphinx=2.1.2 pillow \
132
133
scikit-image=" ${SCIKIT_IMAGE_VERSION:-* } " pandas=" ${PANDAS_VERSION:-* } " \
133
- joblib memory_profiler
134
+ joblib memory_profiler packaging
134
135
135
136
source activate testenv
136
137
pip install sphinx-gallery==0.3.1
Original file line number Diff line number Diff line change 16
16
import os
17
17
import warnings
18
18
import re
19
+ from packaging .version import parse
19
20
20
21
# If extensions (or modules to document with autodoc) are in another
21
22
# directory, add these directories to sys.path here. If the directory
85
86
#
86
87
# The short X.Y version.
87
88
import sklearn
88
- version = sklearn .__version__
89
+ version = parse ( sklearn .__version__ ). base_version
89
90
# The full version, including alpha/beta/rc tags.
90
91
release = sklearn .__version__
91
92
245
246
'joblib' : ('https://joblib.readthedocs.io/en/latest/' , None ),
246
247
}
247
248
248
- if 'dev' in version :
249
+ v = parse (release )
250
+ if v .release is None :
251
+ raise ValueError (
252
+ 'Ill-formed version: {!r}. Version should follow '
253
+ 'PEP440' .format (version ))
254
+
255
+ if v .is_devrelease :
249
256
binder_branch = 'master'
250
257
else :
251
- match = re .match (r'^(\d+)\.(\d+)(?:\.\d+)?$' , version )
252
- if match is None :
253
- raise ValueError (
254
- 'Ill-formed version: {!r}. Expected either '
255
- "a version containing 'dev' "
256
- 'or a version like X.Y or X.Y.Z.' .format (version ))
257
-
258
- major , minor = match .groups ()
258
+ major , minor = v .release [:2 ]
259
259
binder_branch = '{}.{}.X' .format (major , minor )
260
260
261
261
Original file line number Diff line number Diff line change @@ -537,9 +537,12 @@ Building the documentation
537
537
First, make sure you have :ref: `properly installed <install_bleeding_edge >`
538
538
the development version.
539
539
540
+ ..
541
+ packaging is not needed once setuptools starts shipping packaging>=17.0
542
+
540
543
Building the documentation requires installing some additional packages::
541
544
542
- pip install sphinx sphinx-gallery numpydoc matplotlib Pillow pandas scikit-image
545
+ pip install sphinx sphinx-gallery numpydoc matplotlib Pillow pandas scikit-image packaging
543
546
544
547
To build the documentation, you need to be in the ``doc `` folder::
545
548
You can’t perform that action at this time.
0 commit comments