From 5cf13093ea55318160bb9de604f61c9ff69faff8 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 30 Jul 2015 03:34:17 -0400 Subject: [PATCH 01/24] Version bump for 0.5. Nicer commit message for release merges. --- CHANGELOG | 4 ++++ docs/changelog.rst | 8 ++++++++ mwparserfromhell/__init__.py | 2 +- scripts/release.sh | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index add76d5..d95b3a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v0.5 (unreleased): + +- + v0.4.2 (released July 30, 2015): - Fixed setup script not including header files in releases. diff --git a/docs/changelog.rst b/docs/changelog.rst index b37bc9a..acb09fc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Changelog ========= +v0.5 +---- + +Unreleased +(`changes `__): + +- + v0.4.2 ------ diff --git a/mwparserfromhell/__init__.py b/mwparserfromhell/__init__.py index 2f6d2c2..2611813 100644 --- a/mwparserfromhell/__init__.py +++ b/mwparserfromhell/__init__.py @@ -29,7 +29,7 @@ outrageously powerful parser for `MediaWiki `_ wikicode. __author__ = "Ben Kurtovic" __copyright__ = "Copyright (C) 2012, 2013, 2014, 2015 Ben Kurtovic" __license__ = "MIT License" -__version__ = "0.4.2" +__version__ = "0.5.dev0" __email__ = "ben.kurtovic@gmail.com" from . import (compat, definitions, nodes, parser, smart_list, string_mixin, diff --git a/scripts/release.sh b/scripts/release.sh index dd4e1d4..1171718 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -65,7 +65,7 @@ do_git_stuff() { git commit -qam "release/$VERSION" git tag v$VERSION -s -m "version $VERSION" git checkout -q master - git merge -q --no-ff develop -m "Merge branch 'develop'" + git merge -q --no-ff develop -m "Merge develop into master (release/$VERSION)" echo -n " pushing..." git push -q --tags origin master git checkout -q develop From 8ee131287918078350444a66c57a4e0fc68dbc67 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 7 Aug 2015 18:48:05 -0700 Subject: [PATCH 02/24] Add debian packaging --- debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 13 +++++++++++++ debian/copyright | 26 ++++++++++++++++++++++++++ debian/rules | 4 ++++ 5 files changed, 49 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..34dd0b7 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +python3-mwparserfromhell (0.5) UNRELEASED; urgency=medium + + * Initial version of the package + + -- yuvipanda Fri, 07 Aug 2015 18:16:37 -0700 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8f0dba5 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: python3-mwparserfromhell +Maintainer: Ben Kurtovic +Section: python +Priority: optional +Build-Depends: python3-setuptools, python3-all, debhelper (>= 9) +Standards-Version: 3.9.6 + +Package: python3-mwparserfromhell +Architecture: all +Depends: ${misc:Depends}, ${python3:Depends} +Description: **mwparserfromhell** (the *MediaWiki Parser from Hell*) is a Python package + that provides an easy-to-use and outrageously powerful parser for MediaWiki_ + wikicode. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..4b980fb --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mwparserfromhell + +Files: * +Copyright: 2012-2015 Ben Kurtovic +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..641186e --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with python3 --buildsystem=pybuild From 8e713c7596bb8342bc9757a3c25b05abd8b7fbb5 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 7 Aug 2015 18:50:03 -0700 Subject: [PATCH 03/24] Update debian version number to match reality --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 34dd0b7..35e60c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python3-mwparserfromhell (0.5) UNRELEASED; urgency=medium +python3-mwparserfromhell (0.4.2) UNRELEASED; urgency=medium * Initial version of the package From 81dc28ff9555c08cd9b1628de74c60bff2f3d8e7 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 7 Aug 2015 21:53:14 -0400 Subject: [PATCH 04/24] Remove formatting artifacts in Debian description. --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 8f0dba5..90685cf 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,6 @@ Standards-Version: 3.9.6 Package: python3-mwparserfromhell Architecture: all Depends: ${misc:Depends}, ${python3:Depends} -Description: **mwparserfromhell** (the *MediaWiki Parser from Hell*) is a Python package - that provides an easy-to-use and outrageously powerful parser for MediaWiki_ - wikicode. +Description: mwparserfromhell (the MediaWiki Parser from Hell) is a Python + package that provides an easy-to-use and outrageously powerful parser for + MediaWiki wikicode. From 635b84b222b784f665c89654f48a21cf6deb7e9a Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Wed, 26 Aug 2015 20:13:02 +0200 Subject: [PATCH 05/24] Remove debian/ folder out of upstream As I read more and talked to more people, I've realized that people were right and I should maintain the debian package outside of the upstream repo :) Specifically, see https://wiki.debian.org/DebianMentorsFaq#What.27s_wrong_with_upstream_shipping_a_debian.2F_directory.3F The package is now maintained at github.com/yuvipanda/mwparserfromhell and should hopefully go into debian soon! --- debian/changelog | 5 ----- debian/compat | 1 - debian/control | 13 ------------- debian/copyright | 26 -------------------------- debian/rules | 4 ---- 5 files changed, 49 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 35e60c8..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -python3-mwparserfromhell (0.4.2) UNRELEASED; urgency=medium - - * Initial version of the package - - -- yuvipanda Fri, 07 Aug 2015 18:16:37 -0700 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 90685cf..0000000 --- a/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: python3-mwparserfromhell -Maintainer: Ben Kurtovic -Section: python -Priority: optional -Build-Depends: python3-setuptools, python3-all, debhelper (>= 9) -Standards-Version: 3.9.6 - -Package: python3-mwparserfromhell -Architecture: all -Depends: ${misc:Depends}, ${python3:Depends} -Description: mwparserfromhell (the MediaWiki Parser from Hell) is a Python - package that provides an easy-to-use and outrageously powerful parser for - MediaWiki wikicode. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 4b980fb..0000000 --- a/debian/copyright +++ /dev/null @@ -1,26 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: mwparserfromhell - -Files: * -Copyright: 2012-2015 Ben Kurtovic -License: MIT - -License: MIT - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - . - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 641186e..0000000 --- a/debian/rules +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ --with python3 --buildsystem=pybuild From 4f3ab48375a3a5e3097efed85798875a182d2792 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 22 Sep 2015 14:04:05 -0500 Subject: [PATCH 06/24] Edge cases involving wikilink -> external link fallback (fixes #120) --- CHANGELOG | 2 +- docs/changelog.rst | 2 +- mwparserfromhell/parser/ctokenizer/tok_parse.c | 64 +++++++++++++++++++++----- mwparserfromhell/parser/tokenizer.py | 31 ++++++++++--- tests/tokenizer/external_links.mwtest | 7 +++ tests/tokenizer/integration.mwtest | 16 ++++++- 6 files changed, 101 insertions(+), 21 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d95b3a3..462d2dc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ v0.5 (unreleased): -- +- Fixed edge cases involving wikilinks inside of external links and vice versa. v0.4.2 (released July 30, 2015): diff --git a/docs/changelog.rst b/docs/changelog.rst index acb09fc..7ca9f29 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,7 +7,7 @@ v0.5 Unreleased (`changes `__): -- +- Fixed edge cases involving wikilinks inside of external links and vice versa. v0.4.2 ------ diff --git a/mwparserfromhell/parser/ctokenizer/tok_parse.c b/mwparserfromhell/parser/ctokenizer/tok_parse.c index 23cc246..60eef6e 100644 --- a/mwparserfromhell/parser/ctokenizer/tok_parse.c +++ b/mwparserfromhell/parser/ctokenizer/tok_parse.c @@ -47,6 +47,8 @@ typedef struct { /* Forward declarations */ +static PyObject* Tokenizer_really_parse_external_link( + Tokenizer*, int, Textbuffer*); static int Tokenizer_parse_entity(Tokenizer*); static int Tokenizer_parse_comment(Tokenizer*); static int Tokenizer_handle_dl_term(Tokenizer*); @@ -362,30 +364,70 @@ static PyObject* Tokenizer_handle_argument_end(Tokenizer* self) static int Tokenizer_parse_wikilink(Tokenizer* self) { Py_ssize_t reset; - PyObject *wikilink; + PyObject *extlink, *wikilink, *kwargs; + reset = self->head + 1; self->head += 2; - reset = self->head - 1; - wikilink = Tokenizer_parse(self, LC_WIKILINK_TITLE, 1); + // If the wikilink looks like an external link, parse it as such: + extlink = Tokenizer_really_parse_external_link(self, 1, NULL); if (BAD_ROUTE) { RESET_ROUTE(); + self->head = reset + 1; + // Otherwise, actually parse it as a wikilink: + wikilink = Tokenizer_parse(self, LC_WIKILINK_TITLE, 1); + if (BAD_ROUTE) { + RESET_ROUTE(); + self->head = reset; + if (Tokenizer_emit_text(self, "[[")) + return -1; + return 0; + } + if (!wikilink) + return -1; + if (Tokenizer_emit(self, WikilinkOpen)) { + Py_DECREF(wikilink); + return -1; + } + if (Tokenizer_emit_all(self, wikilink)) { + Py_DECREF(wikilink); + return -1; + } + Py_DECREF(wikilink); + if (Tokenizer_emit(self, WikilinkClose)) + return -1; + return 0; + } + if (!extlink) + return -1; + if (self->topstack->context & LC_EXT_LINK_TITLE) { + // In this exceptional case, an external link that looks like a + // wikilink inside of an external link is parsed as text: + Py_DECREF(extlink); self->head = reset; if (Tokenizer_emit_text(self, "[[")) return -1; return 0; } - if (!wikilink) + if (Tokenizer_emit_text(self, "[")) { + Py_DECREF(extlink); return -1; - if (Tokenizer_emit(self, WikilinkOpen)) { - Py_DECREF(wikilink); + } + kwargs = PyDict_New(); + if (!kwargs) { + Py_DECREF(extlink); return -1; } - if (Tokenizer_emit_all(self, wikilink)) { - Py_DECREF(wikilink); + PyDict_SetItemString(kwargs, "brackets", Py_True); + if (Tokenizer_emit_kwargs(self, ExternalLinkOpen, kwargs)) { + Py_DECREF(extlink); + return -1; + } + if (Tokenizer_emit_all(self, extlink)) { + Py_DECREF(extlink); return -1; } - Py_DECREF(wikilink); - if (Tokenizer_emit(self, WikilinkClose)) + Py_DECREF(extlink); + if (Tokenizer_emit(self, ExternalLinkClose)) return -1; return 0; } @@ -553,7 +595,7 @@ static int Tokenizer_handle_free_link_text( Tokenizer* self, int* parens, Textbuffer* tail, Unicode this) { #define PUSH_TAIL_BUFFER(tail, error) \ - if (tail->length > 0) { \ + if (tail && tail->length > 0) { \ if (Textbuffer_concat(self->topstack->textbuffer, tail)) \ return error; \ if (Textbuffer_reset(tail)) \ diff --git a/mwparserfromhell/parser/tokenizer.py b/mwparserfromhell/parser/tokenizer.py index 5c89455..3a1c775 100644 --- a/mwparserfromhell/parser/tokenizer.py +++ b/mwparserfromhell/parser/tokenizer.py @@ -299,17 +299,34 @@ class Tokenizer(object): def _parse_wikilink(self): """Parse an internal wikilink at the head of the wikicode string.""" + reset = self._head + 1 self._head += 2 - reset = self._head - 1 try: - wikilink = self._parse(contexts.WIKILINK_TITLE) + # If the wikilink looks like an external link, parse it as such: + link, extra, delta = self._really_parse_external_link(True) except BadRoute: - self._head = reset - self._emit_text("[[") + self._head = reset + 1 + try: + # Otherwise, actually parse it as a wikilink: + wikilink = self._parse(contexts.WIKILINK_TITLE) + except BadRoute: + self._head = reset + self._emit_text("[[") + else: + self._emit(tokens.WikilinkOpen()) + self._emit_all(wikilink) + self._emit(tokens.WikilinkClose()) else: - self._emit(tokens.WikilinkOpen()) - self._emit_all(wikilink) - self._emit(tokens.WikilinkClose()) + if self._context & contexts.EXT_LINK_TITLE: + # In this exceptional case, an external link that looks like a + # wikilink inside of an external link is parsed as text: + self._head = reset + self._emit_text("[[") + return + self._emit_text("[") + self._emit(tokens.ExternalLinkOpen(brackets=True)) + self._emit_all(link) + self._emit(tokens.ExternalLinkClose()) def _handle_wikilink_separator(self): """Handle the separator between a wikilink's title and its text.""" diff --git a/tests/tokenizer/external_links.mwtest b/tests/tokenizer/external_links.mwtest index 1abc74f..d2efdfc 100644 --- a/tests/tokenizer/external_links.mwtest +++ b/tests/tokenizer/external_links.mwtest @@ -82,6 +82,13 @@ output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com"), Exter --- +name: brackets_recursive_2 +label: bracket-enclosed link with a double bracket-enclosed link as the title +input: "[http://example.com [[http://example.com]]]" +output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com"), ExternalLinkSeparator(), Text(text="[[http://example.com"), ExternalLinkClose(), Text(text="]]")] + +--- + name: period_after label: a period after a free link that is excluded input: "http://example.com." diff --git a/tests/tokenizer/integration.mwtest b/tests/tokenizer/integration.mwtest index 4d6b940..5b8ff25 100644 --- a/tests/tokenizer/integration.mwtest +++ b/tests/tokenizer/integration.mwtest @@ -175,7 +175,7 @@ output: [WikilinkOpen(), Text(text="File:Example.png"), WikilinkSeparator(), Tex --- name: external_link_inside_wikilink_title -label: an external link inside a wikilink title, which is invalid +label: an external link inside a wikilink title, which is not parsed input: "[[File:Example.png http://example.com]]" output: [WikilinkOpen(), Text(text="File:Example.png http://example.com"), WikilinkClose()] @@ -318,3 +318,17 @@ name: incomplete_comment_in_link_title_6 label: incomplete comments are invalid in link titles input: "[[foo%MAJOR_PYTHON_VERSION%<-- -->%MINOR_PYTHON_VERSION%<-- +ECHO SDK -->%WINDOWS_SDK_VERSION%<-- 64? -->SET_SDK_64<-- + IF %PYTHON_ARCH% == 64 ( IF %SET_SDK_64% == Y ( SET DISTUTILS_USE_SDK=1 SET MSSdk=1 "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release + ) ELSE ( + IF EXIST "%WIN_WDK%" ( + :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ + REN "%WIN_WDK%" 0wdf + ) ) ) + call %COMMAND_TO_RUN% || EXIT 1 From 69075a653a1d7224e41cb8613c50fcf62d34faf8 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 28 Oct 2015 23:06:41 -0500 Subject: [PATCH 20/24] Fix typos. --- scripts/win_wrapper.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/win_wrapper.cmd b/scripts/win_wrapper.cmd index 4c981b7..74f7159 100644 --- a/scripts/win_wrapper.cmd +++ b/scripts/win_wrapper.cmd @@ -41,8 +41,8 @@ IF %MAJOR_PYTHON_VERSION% == 3 ( ) ) -ECHO Python: -->%MAJOR_PYTHON_VERSION%<-- -->%MINOR_PYTHON_VERSION%<-- -ECHO SDK -->%WINDOWS_SDK_VERSION%<-- 64? -->SET_SDK_64<-- +ECHO "Python: %MAJOR_PYTHON_VERSION%, %MINOR_PYTHON_VERSION%" +ECHO "SDK %WINDOWS_SDK_VERSION%, 64? %SET_SDK_64%" IF %PYTHON_ARCH% == 64 ( IF %SET_SDK_64% == Y ( From 53930b0b3ef6a86478cc6d6807987da413d780d4 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 29 Oct 2015 00:29:04 -0500 Subject: [PATCH 21/24] Try another approach (#126) --- scripts/win_wrapper.cmd | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/scripts/win_wrapper.cmd b/scripts/win_wrapper.cmd index 74f7159..e85ccc7 100644 --- a/scripts/win_wrapper.cmd +++ b/scripts/win_wrapper.cmd @@ -26,36 +26,31 @@ SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2% -:: Based on the Python version, determine what SDK version to use, and whether -:: to set the SDK for 64-bit. +SET NO_SET_SDK_64=N IF %MAJOR_PYTHON_VERSION% == 2 ( SET WINDOWS_SDK_VERSION="v7.0" - SET SET_SDK_64=Y -) -IF %MAJOR_PYTHON_VERSION% == 3 ( +) ELSE IF %MAJOR_PYTHON_VERSION% == 3 ( SET WINDOWS_SDK_VERSION="v7.1" - IF %MINOR_PYTHON_VERSION% LEQ 4 ( + IF %MINOR_PYTHON_VERSION% GEQ 5 ( SET SET_SDK_64=Y - ) ELSE ( - SET SET_SDK_64=N ) +) ELSE ( + ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" + EXIT 1 ) -ECHO "Python: %MAJOR_PYTHON_VERSION%, %MINOR_PYTHON_VERSION%" -ECHO "SDK %WINDOWS_SDK_VERSION%, 64? %SET_SDK_64%" - -IF %PYTHON_ARCH% == 64 ( - IF %SET_SDK_64% == Y ( - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ) ELSE ( - IF EXIST "%WIN_WDK%" ( - :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ - REN "%WIN_WDK%" 0wdf - ) +IF "%NO_SET_SDK_64%"=="Y" ( + IF EXIST "%WIN_WDK%" ( + :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ + REN "%WIN_WDK%" 0wdf ) + call %COMMAND_TO_RUN% || EXIT 1 +) ELSE IF "%PYTHON_ARCH%"=="64" ( + SET DISTUTILS_USE_SDK=1 + SET MSSdk=1 + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release + call %COMMAND_TO_RUN% || EXIT 1 +) ELSE ( + call %COMMAND_TO_RUN% || EXIT 1 ) - -call %COMMAND_TO_RUN% || EXIT 1 From aaa643e4e9af08810d177451d89c78efa466e8a2 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 29 Oct 2015 00:30:51 -0500 Subject: [PATCH 22/24] Typo. --- scripts/win_wrapper.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/win_wrapper.cmd b/scripts/win_wrapper.cmd index e85ccc7..0254108 100644 --- a/scripts/win_wrapper.cmd +++ b/scripts/win_wrapper.cmd @@ -32,7 +32,7 @@ IF %MAJOR_PYTHON_VERSION% == 2 ( ) ELSE IF %MAJOR_PYTHON_VERSION% == 3 ( SET WINDOWS_SDK_VERSION="v7.1" IF %MINOR_PYTHON_VERSION% GEQ 5 ( - SET SET_SDK_64=Y + SET NO_SET_SDK_64=Y ) ) ELSE ( ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" From 0aa0d677a102ec68796cad471e1c6edcf391743d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 29 Oct 2015 00:44:27 -0500 Subject: [PATCH 23/24] Tweak for clarity (#126) --- scripts/win_wrapper.cmd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/win_wrapper.cmd b/scripts/win_wrapper.cmd index 0254108..3a590df 100644 --- a/scripts/win_wrapper.cmd +++ b/scripts/win_wrapper.cmd @@ -26,7 +26,6 @@ SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2% -SET NO_SET_SDK_64=N IF %MAJOR_PYTHON_VERSION% == 2 ( SET WINDOWS_SDK_VERSION="v7.0" ) ELSE IF %MAJOR_PYTHON_VERSION% == 3 ( @@ -39,18 +38,18 @@ IF %MAJOR_PYTHON_VERSION% == 2 ( EXIT 1 ) -IF "%NO_SET_SDK_64%"=="Y" ( +IF "%PYTHON_ARCH%"=="32" ( + call %COMMAND_TO_RUN% || EXIT 1 +) ELSE IF "%NO_SET_SDK_64%"=="Y" ( IF EXIST "%WIN_WDK%" ( :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ REN "%WIN_WDK%" 0wdf ) call %COMMAND_TO_RUN% || EXIT 1 -) ELSE IF "%PYTHON_ARCH%"=="64" ( +) ELSE ( SET DISTUTILS_USE_SDK=1 SET MSSdk=1 "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release call %COMMAND_TO_RUN% || EXIT 1 -) ELSE ( - call %COMMAND_TO_RUN% || EXIT 1 ) From eb89f386d729ffeba29484a8132f6e213592ee77 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 29 Oct 2015 01:28:37 -0500 Subject: [PATCH 24/24] release/0.4.3 --- CHANGELOG | 2 +- appveyor.yml | 2 +- docs/changelog.rst | 4 ++-- mwparserfromhell/__init__.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 696e806..2629dc6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -v0.4.3 (unreleased): +v0.4.3 (released October 29, 2015): - Added Windows binaries for Python 3.5. - Fixed edge cases involving wikilinks inside of external links and vice versa. diff --git a/appveyor.yml b/appveyor.yml index 4f3e536..1432a2b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ # This config file is used by appveyor.com to build Windows release binaries -version: 0.4.3.dev0-b{build} +version: 0.4.3-b{build} branches: only: diff --git a/docs/changelog.rst b/docs/changelog.rst index 89bf1e6..ef26aa2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,8 +4,8 @@ Changelog v0.4.3 ------ -Unreleased -(`changes `__): +`Released October 29, 2015 `_ +(`changes `__): - Added Windows binaries for Python 3.5. - Fixed edge cases involving wikilinks inside of external links and vice versa. diff --git a/mwparserfromhell/__init__.py b/mwparserfromhell/__init__.py index 2b2bc3f..0d90567 100644 --- a/mwparserfromhell/__init__.py +++ b/mwparserfromhell/__init__.py @@ -29,7 +29,7 @@ outrageously powerful parser for `MediaWiki `_ wikicode. __author__ = "Ben Kurtovic" __copyright__ = "Copyright (C) 2012, 2013, 2014, 2015 Ben Kurtovic" __license__ = "MIT License" -__version__ = "0.4.3.dev0" +__version__ = "0.4.3" __email__ = "ben.kurtovic@gmail.com" from . import (compat, definitions, nodes, parser, smart_list, string_mixin,