From 95eda925bea5ad986e7a35898be7496b4b32ea3b Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 21 Mar 2018 16:13:51 -0700 Subject: Add tool for building NEP index --- doc/neps/.gitignore | 1 + doc/neps/Makefile | 7 ++- doc/neps/index.rst | 56 ---------------------- doc/neps/index.rst.tmpl | 51 ++++++++++++++++++++ doc/neps/nep-0000.rst | 6 +-- doc/neps/nep-0001-npy-format.rst | 6 +-- doc/neps/nep-0002-warnfix.rst | 39 +++++++++------- doc/neps/nep-0003-math_config_clean.rst | 1 + doc/neps/nep-0004-datetime-proposal3.rst | 2 +- doc/neps/nep-0005-generalized-ufuncs.rst | 2 + doc/neps/nep-0006-newbugtracker.rst | 1 + doc/neps/nep-0007-datetime-proposal.rst | 1 + doc/neps/nep-0008-groupby_additions.rst | 18 ++----- doc/neps/nep-0009-structured_array_extensions.rst | 2 + doc/neps/nep-0010-new-iterator-ufunc.rst | 1 + doc/neps/nep-0011-deferred-ufunc-evaluation.rst | 1 + doc/neps/nep-0012-missing-data.rst | 1 + doc/neps/nep-0013-ufunc-overrides.rst | 8 ++-- doc/neps/nep-0014-dropping-python2.7-proposal.rst | 2 + doc/neps/nep-template.rst | 2 +- doc/neps/tools/build_index.py | 57 +++++++++++++++++++++++ 21 files changed, 164 insertions(+), 101 deletions(-) create mode 100644 doc/neps/.gitignore delete mode 100644 doc/neps/index.rst create mode 100644 doc/neps/index.rst.tmpl create mode 100644 doc/neps/tools/build_index.py diff --git a/doc/neps/.gitignore b/doc/neps/.gitignore new file mode 100644 index 000000000..04163f707 --- /dev/null +++ b/doc/neps/.gitignore @@ -0,0 +1 @@ +index.rst diff --git a/doc/neps/Makefile b/doc/neps/Makefile index 2d1a063de..e1fa63f4c 100644 --- a/doc/neps/Makefile +++ b/doc/neps/Makefile @@ -12,9 +12,12 @@ BUILDDIR = _build help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile +.PHONY: help Makefile index + +index: + python tools/build_index.py # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: Makefile index @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/neps/index.rst b/doc/neps/index.rst deleted file mode 100644 index 8a2df4078..000000000 --- a/doc/neps/index.rst +++ /dev/null @@ -1,56 +0,0 @@ -=========================== -NumPy Enhancement Proposals -=========================== - -NumPy Enhancement Proposals (NEPs) describe proposed changes to NumPy. -NEPs are modeled on Python Enhancement Proposals (PEPs), and are typically -written up when large changes to NumPy are proposed. - -This page provides an overview of all NEPs. - -Meta-NEPs (NEPs about NEPs or Processes) ----------------------------------------- - -.. toctree:: - :maxdepth: 1 - - nep-0000 - nep-template - - -Accepted NEPs, implementation in progress ------------------------------------------ - -.. toctree:: - :maxdepth: 1 - - nep-0014-dropping-python2.7-proposal - - -Implemented NEPs ----------------- - -.. toctree:: - :maxdepth: 1 - - nep-0001-npy-format - nep-0005-generalized-ufuncs - nep-0007-datetime-proposal - nep-0010-new-iterator-ufunc - nep-0013-ufunc-overrides - - -Defunct NEPs ------------- - -.. toctree:: - :maxdepth: 1 - - nep-0002-warnfix - nep-0003-math_config_clean - nep-0004-datetime-proposal3 - nep-0006-newbugtracker - nep-0008-groupby_additions - nep-0009-structured_array_extensions - nep-0011-deferred-ufunc-evaluation - nep-0012-missing-data diff --git a/doc/neps/index.rst.tmpl b/doc/neps/index.rst.tmpl new file mode 100644 index 000000000..7a326e3fb --- /dev/null +++ b/doc/neps/index.rst.tmpl @@ -0,0 +1,51 @@ +=========================== +NumPy Enhancement Proposals +=========================== + +NumPy Enhancement Proposals (NEPs) describe proposed changes to NumPy. +NEPs are modeled on Python Enhancement Proposals (PEPs), and are typically +written up when large changes to NumPy are proposed. + +This page provides an overview of all NEPs. + +Meta-NEPs (NEPs about NEPs or Processes) +---------------------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Type'] == 'Process' %} + NEP {{ nep }} — {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} + + nep-template + +Accepted NEPs, implementation in progress +----------------------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Accepted' %} + NEP {{ nep }} — {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} + +Implemented NEPs +---------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Active' %} + NEP {{ nep }} — {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} + +Defunct NEPs +------------ + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Deferred' %} + NEP {{ nep }} — {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/nep-0000.rst b/doc/neps/nep-0000.rst index ae8603c62..54e3b0062 100644 --- a/doc/neps/nep-0000.rst +++ b/doc/neps/nep-0000.rst @@ -1,6 +1,6 @@ -======================= -NEP Purpose and Process -======================= +=================== +Purpose and Process +=================== :Author: Jarrod Millman :Status: Draft diff --git a/doc/neps/nep-0001-npy-format.rst b/doc/neps/nep-0001-npy-format.rst index 3f12e1bf1..8849853f6 100644 --- a/doc/neps/nep-0001-npy-format.rst +++ b/doc/neps/nep-0001-npy-format.rst @@ -2,9 +2,9 @@ A Simple File Format for NumPy Arrays ===================================== -Author: Robert Kern -Status: Draft -Created: 20-Dec-2007 +:Author: Robert Kern +:Status: Active +:Created: 20-Dec-2007 Abstract diff --git a/doc/neps/nep-0002-warnfix.rst b/doc/neps/nep-0002-warnfix.rst index 4b0a2a56e..60dc885b2 100644 --- a/doc/neps/nep-0002-warnfix.rst +++ b/doc/neps/nep-0002-warnfix.rst @@ -5,6 +5,7 @@ A proposal to build numpy without warning with a big set of warning flags :Author: David Cournapeau :Contact: david@ar.media.kyoto-u.ac.jp :Date: 2008-09-04 +:Status: Deferred Executive summary ================= @@ -20,13 +21,13 @@ Warning flags ============= Each compiler detects a different set of potential errors. The baseline will -be gcc -Wall -W -Wextra. Ideally, a complete set would be nice: +be gcc -Wall -W -Wextra. Ideally, a complete set would be nice:: --W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return --Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast --Wwrite-strings " + -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return + -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast + -Wwrite-strings " -Intel compiler, VS with /W3 /Wall, Sun compilers have extra warnings too. +Intel compiler, VS with ``/W3 /Wall``, Sun compilers have extra warnings too. Kind of warnings ================ @@ -46,27 +47,29 @@ solve it is to tag the function argument with a macro NPY_UNUSED. This macro uses compiler specific code to tag the variable, and mangle it such as it is not possible to use it accidentally once it is tagged. -The code to apply compiler specific option could be: +The code to apply compiler specific option could be:: -#if defined(__GNUC__) - #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) -# elif defined(__ICC) - #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) -#else - #define __COMP_NPY_UNUSED -#endif + #if defined(__GNUC__) + #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) + # elif defined(__ICC) + #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) + #else + #define __COMP_NPY_UNUSED + #endif -The variable mangling would be: +The variable mangling would be:: -#define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED + #define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED -When applied to a variable, one would get: +When applied to a variable, one would get:: -int foo(int * NPY_UNUSED(dummy)) + int foo(int * NPY_UNUSED(dummy)) expanded to -int foo(int * __NPY_UNUSED_TAGGEDdummy __COMP_NPY_UNUSED) +:: + + int foo(int * __NPY_UNUSED_TAGGEDdummy __COMP_NPY_UNUSED) Thus avoiding any accidental use of the variable. The mangling is pure C, and thuse portable. The per-variable warning disabling is compiler specific. diff --git a/doc/neps/nep-0003-math_config_clean.rst b/doc/neps/nep-0003-math_config_clean.rst index 27c0adfa1..5af907437 100644 --- a/doc/neps/nep-0003-math_config_clean.rst +++ b/doc/neps/nep-0003-math_config_clean.rst @@ -5,6 +5,7 @@ Cleaning the math configuration of numpy.core :Author: David Cournapeau :Contact: david@ar.media.kyoto-u.ac.jp :Date: 2008-09-04 +:Status: Deferred Executive summary ================= diff --git a/doc/neps/nep-0004-datetime-proposal3.rst b/doc/neps/nep-0004-datetime-proposal3.rst index fcfb39e54..46d8e314b 100644 --- a/doc/neps/nep-0004-datetime-proposal3.rst +++ b/doc/neps/nep-0004-datetime-proposal3.rst @@ -7,7 +7,7 @@ :Author: Ivan Vilata i Balaguer :Contact: ivan@selidor.net :Date: 2008-07-30 - +:Status: Deferred Executive summary ================= diff --git a/doc/neps/nep-0005-generalized-ufuncs.rst b/doc/neps/nep-0005-generalized-ufuncs.rst index 98e436990..96974c572 100644 --- a/doc/neps/nep-0005-generalized-ufuncs.rst +++ b/doc/neps/nep-0005-generalized-ufuncs.rst @@ -2,6 +2,8 @@ Generalized Universal Functions =============================== +:Status: Active + There is a general need for looping over not only functions on scalars but also over functions on vectors (or arrays), as explained on http://scipy.org/scipy/numpy/wiki/GeneralLoopingFunctions. We propose diff --git a/doc/neps/nep-0006-newbugtracker.rst b/doc/neps/nep-0006-newbugtracker.rst index 5af633552..2b9344ed0 100644 --- a/doc/neps/nep-0006-newbugtracker.rst +++ b/doc/neps/nep-0006-newbugtracker.rst @@ -3,6 +3,7 @@ Replacing Trac with a different bug tracker =========================================== :Author: David Cournapeau, Stefan van der Walt +:Status: Deferred Some release managers of both numpy and scipy are becoming more and more dissatisfied with the current development workflow, in particular for bug diff --git a/doc/neps/nep-0007-datetime-proposal.rst b/doc/neps/nep-0007-datetime-proposal.rst index 76c361f4f..a002fc188 100644 --- a/doc/neps/nep-0007-datetime-proposal.rst +++ b/doc/neps/nep-0007-datetime-proposal.rst @@ -14,6 +14,7 @@ Revised only slightly from the third proposal by :Contact: ivan@selidor.net :Date: 2008-07-30 +:Status: Active Executive summary ================= diff --git a/doc/neps/nep-0008-groupby_additions.rst b/doc/neps/nep-0008-groupby_additions.rst index a86bdd642..fa02f2f9c 100644 --- a/doc/neps/nep-0008-groupby_additions.rst +++ b/doc/neps/nep-0008-groupby_additions.rst @@ -5,6 +5,7 @@ :Author: Travis Oliphant :Contact: oliphant@enthought.com :Date: 2010-04-27 +:Status: Deferred Executive summary @@ -22,9 +23,9 @@ Example Use Case ================ Suppose you have a NumPy structured array containing information about the number of purchases at several stores over multiple days. To be clear, the -structured array data-type is: +structured array data-type is:: -dt = [('year', i2), ('month', i1), ('day', i1), ('time', float), + dt = [('year', i2), ('month', i1), ('day', i1), ('time', float), ('store', i4), ('SKU', 'S6'), ('number', i4)] Suppose there is a 1-d NumPy array of this data-type and you would like @@ -98,14 +99,5 @@ reduceby:: Functions proposed ================== -segment:: - - -edges:: - - -.. Local Variables: -.. mode: rst -.. coding: utf-8 -.. fill-column: 72 -.. End: +- segment +- edges diff --git a/doc/neps/nep-0009-structured_array_extensions.rst b/doc/neps/nep-0009-structured_array_extensions.rst index a4248362c..695d0d516 100644 --- a/doc/neps/nep-0009-structured_array_extensions.rst +++ b/doc/neps/nep-0009-structured_array_extensions.rst @@ -2,6 +2,8 @@ Structured array extensions =========================== +:Status: Deferred + 1. Create with-style context that makes "named-columns" available as names in the namespace. with np.columns(array): diff --git a/doc/neps/nep-0010-new-iterator-ufunc.rst b/doc/neps/nep-0010-new-iterator-ufunc.rst index 7a9e7627c..e5c586658 100644 --- a/doc/neps/nep-0010-new-iterator-ufunc.rst +++ b/doc/neps/nep-0010-new-iterator-ufunc.rst @@ -5,6 +5,7 @@ Optimizing Iterator/UFunc Performance :Author: Mark Wiebe :Content-Type: text/x-rst :Created: 25-Nov-2010 +:Status: Active ***************** Table of Contents diff --git a/doc/neps/nep-0011-deferred-ufunc-evaluation.rst b/doc/neps/nep-0011-deferred-ufunc-evaluation.rst index b00c0dd2d..5f5de3518 100644 --- a/doc/neps/nep-0011-deferred-ufunc-evaluation.rst +++ b/doc/neps/nep-0011-deferred-ufunc-evaluation.rst @@ -5,6 +5,7 @@ Deferred UFunc Evaluation :Author: Mark Wiebe :Content-Type: text/x-rst :Created: 30-Nov-2010 +:Status: Deferred ******** Abstract diff --git a/doc/neps/nep-0012-missing-data.rst b/doc/neps/nep-0012-missing-data.rst index 00a6034f4..1553339f4 100644 --- a/doc/neps/nep-0012-missing-data.rst +++ b/doc/neps/nep-0012-missing-data.rst @@ -6,6 +6,7 @@ Missing Data Functionality in NumPy :Copyright: Copyright 2011 by Enthought, Inc :License: CC By-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/) :Date: 2011-06-23 +:Status: Deferred ***************** Table of Contents diff --git a/doc/neps/nep-0013-ufunc-overrides.rst b/doc/neps/nep-0013-ufunc-overrides.rst index 90869e1ac..cb3e1c8dc 100644 --- a/doc/neps/nep-0013-ufunc-overrides.rst +++ b/doc/neps/nep-0013-ufunc-overrides.rst @@ -1,5 +1,3 @@ -.. _neps.ufunc-overrides: - ================================= A Mechanism for Overriding Ufuncs ================================= @@ -19,6 +17,8 @@ A Mechanism for Overriding Ufuncs :Author: Stephan Hoyer :Date: 2017-03-31 +:Status: Active + Executive summary ================= @@ -154,8 +154,8 @@ Here: - *ufunc* is the ufunc object that was called. - *method* is a string indicating how the Ufunc was called, either ``"__call__"`` to indicate it was called directly, or one of its - :ref:`methods`: ``"reduce"``, ``"accumulate"``, - ``"reduceat"``, ``"outer"``, or ``"at"``. + methods: ``"reduce"``, ``"accumulate"``, ``"reduceat"``, ``"outer"``, + or ``"at"``. - *inputs* is a tuple of the input arguments to the ``ufunc`` - *kwargs* contains any optional or keyword arguments passed to the function. This includes any ``out`` arguments, which are always diff --git a/doc/neps/nep-0014-dropping-python2.7-proposal.rst b/doc/neps/nep-0014-dropping-python2.7-proposal.rst index 3cfe50bd0..03a7cba34 100644 --- a/doc/neps/nep-0014-dropping-python2.7-proposal.rst +++ b/doc/neps/nep-0014-dropping-python2.7-proposal.rst @@ -2,6 +2,8 @@ Plan for dropping Python 2.7 support ==================================== +:Status: Accepted + The Python core team plans to stop supporting Python 2 in 2020. The NumPy project has supported both Python 2 and Python 3 in parallel since 2010, and has found that supporting Python 2 is an increasing burden on our limited diff --git a/doc/neps/nep-template.rst b/doc/neps/nep-template.rst index d51ad3688..56b06049e 100644 --- a/doc/neps/nep-template.rst +++ b/doc/neps/nep-template.rst @@ -4,7 +4,7 @@ NEP Template and Instructions :Author: :Status: -:Type: +:Type: :Created: diff --git a/doc/neps/tools/build_index.py b/doc/neps/tools/build_index.py new file mode 100644 index 000000000..bb11cba8a --- /dev/null +++ b/doc/neps/tools/build_index.py @@ -0,0 +1,57 @@ +""" +Scan the directory of nep files and extract their metadata. The +metadata is passed to Jinja for filling out `index.rst.tmpl`. +""" + +import os +import sys +import jinja2 +import glob +import re + + +def render(tpl_path, context): + path, filename = os.path.split(tpl_path) + return jinja2.Environment( + loader=jinja2.FileSystemLoader(path or './') + ).get_template(filename).render(context) + +def nep_metadata(): + ignore = ('nep-template.rst') + sources = sorted(glob.glob(r'nep-*.rst')) + sources = [s for s in sources if not s in ignore] + + meta_re = r':([a-zA-Z]*): (.*)' + + neps = {} + print('Loading metadata for:') + for source in sources: + print(f' - {source}') + nr = int(re.match(r'nep-([0-9]{4}).*\.rst', source).group(1)) + + with open(source) as f: + lines = f.readlines() + tags = [re.match(meta_re, line) for line in lines] + tags = [match.groups() for match in tags if match is not None] + tags = {tag[0]: tag[1] for tag in tags} + + # We could do a clever regexp, but for now just assume the title is + # the second line of the document + tags['Title'] = lines[1].strip() + tags['Filename'] = source + + neps[nr] = tags + + return {'neps': neps} + + +infile = 'index.rst.tmpl' +outfile = 'index.rst' + +meta = nep_metadata() + +print(f'Compiling {infile} -> {outfile}') +index = render(infile, meta) + +with open(outfile, 'w') as f: + f.write(index) -- cgit v1.2.1 From e12264a519d4bfa49946408d2cdc0fa1cfecaa9b Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 21 Mar 2018 17:24:25 -0700 Subject: Use correct tag Final for merged NEPs. Add resolution to NEP 14. --- doc/neps/index.rst.tmpl | 2 +- doc/neps/nep-0000.rst | 9 ++++++--- doc/neps/nep-0001-npy-format.rst | 3 +-- doc/neps/nep-0005-generalized-ufuncs.rst | 2 +- doc/neps/nep-0007-datetime-proposal.rst | 2 +- doc/neps/nep-0010-new-iterator-ufunc.rst | 2 +- doc/neps/nep-0013-ufunc-overrides.rst | 2 +- doc/neps/nep-0014-dropping-python2.7-proposal.rst | 1 + 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/neps/index.rst.tmpl b/doc/neps/index.rst.tmpl index 7a326e3fb..8d0c5da77 100644 --- a/doc/neps/index.rst.tmpl +++ b/doc/neps/index.rst.tmpl @@ -36,7 +36,7 @@ Implemented NEPs .. toctree:: :maxdepth: 1 -{% for nep, tags in neps.items() if tags['Status'] == 'Active' %} +{% for nep, tags in neps.items() if tags['Status'] == 'Final' %} NEP {{ nep }} — {{ tags['Title'] }} <{{ tags['Filename'] }}> {% endfor %} diff --git a/doc/neps/nep-0000.rst b/doc/neps/nep-0000.rst index 54e3b0062..a7d6d7115 100644 --- a/doc/neps/nep-0000.rst +++ b/doc/neps/nep-0000.rst @@ -121,9 +121,12 @@ updated accordingly. In addition to updating the status field, at the very least the ``Resolution`` header should be added with a link to the relevant post in the mailing list archives. -NEPs can also be ``Replaced`` by a different NEP, rendering the original -obsolete. Process NEPs may also have a status of -``Active`` if they are never meant to be completed. E.g. NEP 0 (this NEP). +NEPs can also be ``Superseded`` by a different NEP, rendering the +original obsolete. The ``Replaced-By`` and ``Replaces`` headers +should be added to the original and new NEPs respectively. + +Process NEPs may also have a status of ``Active`` if they are never +meant to be completed, e.g. NEP 0 (this NEP). Maintenance diff --git a/doc/neps/nep-0001-npy-format.rst b/doc/neps/nep-0001-npy-format.rst index 8849853f6..2057aed83 100644 --- a/doc/neps/nep-0001-npy-format.rst +++ b/doc/neps/nep-0001-npy-format.rst @@ -3,10 +3,9 @@ A Simple File Format for NumPy Arrays ===================================== :Author: Robert Kern -:Status: Active +:Status: Final :Created: 20-Dec-2007 - Abstract -------- diff --git a/doc/neps/nep-0005-generalized-ufuncs.rst b/doc/neps/nep-0005-generalized-ufuncs.rst index 96974c572..54b2b370e 100644 --- a/doc/neps/nep-0005-generalized-ufuncs.rst +++ b/doc/neps/nep-0005-generalized-ufuncs.rst @@ -2,7 +2,7 @@ Generalized Universal Functions =============================== -:Status: Active +:Status: Final There is a general need for looping over not only functions on scalars but also over functions on vectors (or arrays), as explained on diff --git a/doc/neps/nep-0007-datetime-proposal.rst b/doc/neps/nep-0007-datetime-proposal.rst index a002fc188..437bf77b3 100644 --- a/doc/neps/nep-0007-datetime-proposal.rst +++ b/doc/neps/nep-0007-datetime-proposal.rst @@ -14,7 +14,7 @@ Revised only slightly from the third proposal by :Contact: ivan@selidor.net :Date: 2008-07-30 -:Status: Active +:Status: Final Executive summary ================= diff --git a/doc/neps/nep-0010-new-iterator-ufunc.rst b/doc/neps/nep-0010-new-iterator-ufunc.rst index e5c586658..7b388a974 100644 --- a/doc/neps/nep-0010-new-iterator-ufunc.rst +++ b/doc/neps/nep-0010-new-iterator-ufunc.rst @@ -5,7 +5,7 @@ Optimizing Iterator/UFunc Performance :Author: Mark Wiebe :Content-Type: text/x-rst :Created: 25-Nov-2010 -:Status: Active +:Status: Final ***************** Table of Contents diff --git a/doc/neps/nep-0013-ufunc-overrides.rst b/doc/neps/nep-0013-ufunc-overrides.rst index cb3e1c8dc..c97b69023 100644 --- a/doc/neps/nep-0013-ufunc-overrides.rst +++ b/doc/neps/nep-0013-ufunc-overrides.rst @@ -17,7 +17,7 @@ A Mechanism for Overriding Ufuncs :Author: Stephan Hoyer :Date: 2017-03-31 -:Status: Active +:Status: Final Executive summary ================= diff --git a/doc/neps/nep-0014-dropping-python2.7-proposal.rst b/doc/neps/nep-0014-dropping-python2.7-proposal.rst index 03a7cba34..6cfd4707f 100644 --- a/doc/neps/nep-0014-dropping-python2.7-proposal.rst +++ b/doc/neps/nep-0014-dropping-python2.7-proposal.rst @@ -3,6 +3,7 @@ Plan for dropping Python 2.7 support ==================================== :Status: Accepted +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2017-November/077419.html The Python core team plans to stop supporting Python 2 in 2020. The NumPy project has supported both Python 2 and Python 3 in parallel since 2010, and -- cgit v1.2.1 From ad014b9e8774e2aa9713a80ed0756ab0bcbb8ae8 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 21 Mar 2018 17:24:39 -0700 Subject: Raise errors in Sphinx warnings --- doc/neps/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/neps/Makefile b/doc/neps/Makefile index e1fa63f4c..3c023ae9b 100644 --- a/doc/neps/Makefile +++ b/doc/neps/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -W SPHINXBUILD = sphinx-build SPHINXPROJ = NumPyEnhancementProposals SOURCEDIR = . -- cgit v1.2.1 From d6730eeed940706ce1c103b1d021c282513be0ed Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 21 Mar 2018 17:26:56 -0700 Subject: Add consistency check for superseded NEPs A superseded NEP should have a Replaced-By header. The replacing NEP should have a Replaces header. They should point to one another. --- doc/neps/tools/build_index.py | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/doc/neps/tools/build_index.py b/doc/neps/tools/build_index.py index bb11cba8a..134773065 100644 --- a/doc/neps/tools/build_index.py +++ b/doc/neps/tools/build_index.py @@ -21,7 +21,7 @@ def nep_metadata(): sources = sorted(glob.glob(r'nep-*.rst')) sources = [s for s in sources if not s in ignore] - meta_re = r':([a-zA-Z]*): (.*)' + meta_re = r':([a-zA-Z\-]*): (.*)' neps = {} print('Loading metadata for:') @@ -40,8 +40,44 @@ def nep_metadata(): tags['Title'] = lines[1].strip() tags['Filename'] = source + + if tags['Status'] in ('Accepted', 'Rejected', 'Withdrawn'): + if not 'Resolution' in tags: + raise RuntimeError( + f'NEP {nr} is Accepted/Rejected/Withdrawn but ' + 'has no Resolution tag' + ) + neps[nr] = tags + # Now that we have all of the NEP metadata, do some global consistency + # checks + + for nr, tags in neps.items(): + if tags['Status'] == 'Superseded': + if not 'Replaced-By' in tags: + raise RuntimeError( + f'NEP {nr} has been Superseded, but has no Replaced-By tag' + ) + + replaced_by = int(tags['Replaced-By']) + replacement_nep = neps[replaced_by] + + if not int(replacement_nep['Replaces']) == nr: + raise RuntimeError( + f'NEP {nr} is superseded by {replaced_by}, but that NEP has a ' + f"Replaces tag of `{replacement_nep['Replaces']}`." + ) + + if 'Replaces' in tags: + replaced_nep = int(tags['Replaces']) + replaced_nep_tags = neps[replaced_nep] + if not replaced_nep_tags['Status'] == 'Superseded': + raise RuntimeError( + f'NEP {nr} replaces {replaced_nep}, but that NEP has not ' + f'been set to Superseded' + ) + return {'neps': neps} -- cgit v1.2.1 From 10f722f5b169d16d4d31a375a0a3f0392a1380a9 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 22 Mar 2018 00:38:15 -0700 Subject: Add missing check for Replaces tag in replacement NEP --- doc/neps/tools/build_index.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/neps/tools/build_index.py b/doc/neps/tools/build_index.py index 134773065..65225c995 100644 --- a/doc/neps/tools/build_index.py +++ b/doc/neps/tools/build_index.py @@ -63,6 +63,12 @@ def nep_metadata(): replaced_by = int(tags['Replaced-By']) replacement_nep = neps[replaced_by] + if not 'Replaces' in replacement_nep: + raise RuntimeError( + f'NEP {nr} is superseded by {replaced_by}, but that NEP has ' + f"no Replaces tag." + ) + if not int(replacement_nep['Replaces']) == nr: raise RuntimeError( f'NEP {nr} is superseded by {replaced_by}, but that NEP has a ' -- cgit v1.2.1 From 6feff8f4ba41802b4356e651df2e0c130c9ddecb Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 22 Mar 2018 00:39:24 -0700 Subject: Move Status tag to more appropriate location --- doc/neps/nep-0007-datetime-proposal.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/neps/nep-0007-datetime-proposal.rst b/doc/neps/nep-0007-datetime-proposal.rst index 437bf77b3..72d48d244 100644 --- a/doc/neps/nep-0007-datetime-proposal.rst +++ b/doc/neps/nep-0007-datetime-proposal.rst @@ -5,6 +5,7 @@ :Author: Travis Oliphant :Contact: oliphant@enthought.com :Date: 2009-06-09 +:Status: Final Revised only slightly from the third proposal by @@ -14,8 +15,6 @@ Revised only slightly from the third proposal by :Contact: ivan@selidor.net :Date: 2008-07-30 -:Status: Final - Executive summary ================= -- cgit v1.2.1 From 5b3c5646a7bc0e8253e55f68cf9a24bb245d5be7 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 22 Mar 2018 01:00:53 -0700 Subject: Install graphviz on CircleCI --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70cb8adc0..f1989afc8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,8 @@ jobs: python3 -m venv venv . venv/bin/activate pip install cython sphinx matplotlib + sudo apt-get update + sudo apt-get install -y graphviz - run: name: build numpy -- cgit v1.2.1