diff --git a/.travis.yml b/.travis.yml index f352d3d..7668ab8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - 3.6 - 3.7 - 3.8 - - 3.9-dev + - 3.9 arch: - amd64 - ppc64le diff --git a/CHANGELOG b/CHANGELOG index 3f9ca3a..6d0cf86 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,17 @@ v0.6 (unreleased): -- Added support for Python 3.8. -- Dropped support for end-of-life Python 3.4. +Thanks to everyone for their patience with this release! + +- Breaking change: dropped support for end-of-life Python 2.7 and 3.4. +- Added support for Python 3.8 and 3.9. +- Added binary wheels for Linux and macOS. - Updated Wikicode.matches() to recognize underscores as being equivalent to spaces. (#216) +- Add a 'default' parameter to Template.get, and implement dict-style item + access for template parameters. (#252) - Fixed a rare parsing bug involving deeply nested style tags. (#224) +- Updated HTML tag definitions. +- Internal refactoring and cleanup. v0.5.4 (released May 15, 2019): diff --git a/README.rst b/README.rst index bbac7e6..45db387 100644 --- a/README.rst +++ b/README.rst @@ -41,8 +41,7 @@ Normal usage is rather straightforward (where ``text`` is page text): >>> wikicode = mwparserfromhell.parse(text) ``wikicode`` is a ``mwparserfromhell.Wikicode`` object, which acts like an -ordinary ``str`` object with some extra methods. -For example: +ordinary ``str`` object with some extra methods. For example: >>> text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?" >>> wikicode = mwparserfromhell.parse(text) diff --git a/appveyor.yml b/appveyor.yml index ccbaf59..a39024f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -54,6 +54,14 @@ environment: PYTHON_VERSION: "3.8" PYTHON_ARCH: "64" + - PYTHON: "C:\\Python39" + PYTHON_VERSION: "3.9" + PYTHON_ARCH: "32" + + - PYTHON: "C:\\Python39-x64" + PYTHON_VERSION: "3.9" + PYTHON_ARCH: "64" + install: - "%PIP% install --disable-pip-version-check --user --upgrade pip" - "%PIP% install wheel twine" diff --git a/docs/changelog.rst b/docs/changelog.rst index cf3ec8d..59bedc8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,12 +7,21 @@ v0.6 Unreleased (`changes `__): -- Added support for Python 3.8. -- Dropped support for end-of-life Python 3.4. -- Updated Wikicode.matches() to recognize underscores as being equivalent - to spaces. (`#216 `_) +Thanks to everyone for their patience with this release! + +- Breaking change: dropped support for end-of-life Python 2.7 and 3.4. +- Added support for Python 3.8 and 3.9. +- Added binary wheels for Linux and macOS. +- Updated :meth:`.Wikicode.matches` to recognize underscores as being + equivalent to spaces. + (`#216 `_) +- Add a `default` parameter to :meth:`.Template.get`, and implement dict-style + item access for template parameters. + (`#252 `_) - Fixed a rare parsing bug involving deeply nested style tags. (`#224 `_) +- Updated HTML tag definitions. +- Internal refactoring and cleanup. v0.5.4 ------ diff --git a/mwparserfromhell/__init__.py b/mwparserfromhell/__init__.py index 609999b..841f992 100644 --- a/mwparserfromhell/__init__.py +++ b/mwparserfromhell/__init__.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/definitions.py b/mwparserfromhell/definitions.py index bd0e969..c8d37cd 100644 --- a/mwparserfromhell/definitions.py +++ b/mwparserfromhell/definitions.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/__init__.py b/mwparserfromhell/nodes/__init__.py index 4c29a5b..18a1780 100644 --- a/mwparserfromhell/nodes/__init__.py +++ b/mwparserfromhell/nodes/__init__.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/_base.py b/mwparserfromhell/nodes/_base.py index e4a3c2e..e6b2a50 100644 --- a/mwparserfromhell/nodes/_base.py +++ b/mwparserfromhell/nodes/_base.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/argument.py b/mwparserfromhell/nodes/argument.py index a852a65..501788f 100644 --- a/mwparserfromhell/nodes/argument.py +++ b/mwparserfromhell/nodes/argument.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/comment.py b/mwparserfromhell/nodes/comment.py index 56b05b7..fd8a9cc 100644 --- a/mwparserfromhell/nodes/comment.py +++ b/mwparserfromhell/nodes/comment.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/external_link.py b/mwparserfromhell/nodes/external_link.py index ba86659..0423e2a 100644 --- a/mwparserfromhell/nodes/external_link.py +++ b/mwparserfromhell/nodes/external_link.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/extras/__init__.py b/mwparserfromhell/nodes/extras/__init__.py index 43fe862..ef76125 100644 --- a/mwparserfromhell/nodes/extras/__init__.py +++ b/mwparserfromhell/nodes/extras/__init__.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2016 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/extras/attribute.py b/mwparserfromhell/nodes/extras/attribute.py index 442c3ac..9e7b7cd 100644 --- a/mwparserfromhell/nodes/extras/attribute.py +++ b/mwparserfromhell/nodes/extras/attribute.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/extras/parameter.py b/mwparserfromhell/nodes/extras/parameter.py index 9287e00..44fb3aa 100644 --- a/mwparserfromhell/nodes/extras/parameter.py +++ b/mwparserfromhell/nodes/extras/parameter.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/heading.py b/mwparserfromhell/nodes/heading.py index de4dc70..77f2f68 100644 --- a/mwparserfromhell/nodes/heading.py +++ b/mwparserfromhell/nodes/heading.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/html_entity.py b/mwparserfromhell/nodes/html_entity.py index b08d2ee..fa3fa4d 100644 --- a/mwparserfromhell/nodes/html_entity.py +++ b/mwparserfromhell/nodes/html_entity.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/tag.py b/mwparserfromhell/nodes/tag.py index 094853b..eb59c5b 100644 --- a/mwparserfromhell/nodes/tag.py +++ b/mwparserfromhell/nodes/tag.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/template.py b/mwparserfromhell/nodes/template.py index 6f23556..493e2b4 100644 --- a/mwparserfromhell/nodes/template.py +++ b/mwparserfromhell/nodes/template.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/text.py b/mwparserfromhell/nodes/text.py index cce670c..3242170 100644 --- a/mwparserfromhell/nodes/text.py +++ b/mwparserfromhell/nodes/text.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/nodes/wikilink.py b/mwparserfromhell/nodes/wikilink.py index fc78833..7304168 100644 --- a/mwparserfromhell/nodes/wikilink.py +++ b/mwparserfromhell/nodes/wikilink.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/__init__.py b/mwparserfromhell/parser/__init__.py index cde45c5..3fad93b 100644 --- a/mwparserfromhell/parser/__init__.py +++ b/mwparserfromhell/parser/__init__.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/builder.py b/mwparserfromhell/parser/builder.py index 4c14b2a..2f58455 100644 --- a/mwparserfromhell/parser/builder.py +++ b/mwparserfromhell/parser/builder.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/contexts.py b/mwparserfromhell/parser/contexts.py index b6d013e..aecc2f3 100644 --- a/mwparserfromhell/parser/contexts.py +++ b/mwparserfromhell/parser/contexts.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2019 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/errors.py b/mwparserfromhell/parser/errors.py index adf3d5d..f94e62b 100644 --- a/mwparserfromhell/parser/errors.py +++ b/mwparserfromhell/parser/errors.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/tokenizer.py b/mwparserfromhell/parser/tokenizer.py index 93b79d9..d4e6c8c 100644 --- a/mwparserfromhell/parser/tokenizer.py +++ b/mwparserfromhell/parser/tokenizer.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/parser/tokens.py b/mwparserfromhell/parser/tokens.py index 257ed89..f274123 100644 --- a/mwparserfromhell/parser/tokens.py +++ b/mwparserfromhell/parser/tokens.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/smart_list/__init__.py b/mwparserfromhell/smart_list/__init__.py index 723d992..92c75e2 100644 --- a/mwparserfromhell/smart_list/__init__.py +++ b/mwparserfromhell/smart_list/__init__.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # Copyright (C) 2019-2020 Yuri Astrakhan # diff --git a/mwparserfromhell/smart_list/list_proxy.py b/mwparserfromhell/smart_list/list_proxy.py index f1525fc..d2d89e9 100644 --- a/mwparserfromhell/smart_list/list_proxy.py +++ b/mwparserfromhell/smart_list/list_proxy.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # Copyright (C) 2019-2020 Yuri Astrakhan # diff --git a/mwparserfromhell/smart_list/smart_list.py b/mwparserfromhell/smart_list/smart_list.py index f83e181..e2fd87f 100644 --- a/mwparserfromhell/smart_list/smart_list.py +++ b/mwparserfromhell/smart_list/smart_list.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # Copyright (C) 2019-2020 Yuri Astrakhan # diff --git a/mwparserfromhell/string_mixin.py b/mwparserfromhell/string_mixin.py index f39cce7..2aeabf5 100644 --- a/mwparserfromhell/string_mixin.py +++ b/mwparserfromhell/string_mixin.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/utils.py b/mwparserfromhell/utils.py index 2c6df08..5d262b9 100644 --- a/mwparserfromhell/utils.py +++ b/mwparserfromhell/utils.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mwparserfromhell/wikicode.py b/mwparserfromhell/wikicode.py index 381d938..bbd38a2 100644 --- a/mwparserfromhell/wikicode.py +++ b/mwparserfromhell/wikicode.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/scripts/memtest.py b/scripts/memtest.py index 3da1fcc..6f0d1ab 100644 --- a/scripts/memtest.py +++ b/scripts/memtest.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/setup.py b/setup.py index 6fee34a..3c7d2cb 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ from setuptools.command.build_ext import build_ext from mwparserfromhell import __version__ -with open("README.rst", encoding='utf-8') as fp: +with open("README.rst") as fp: long_docs = fp.read() use_extension = True @@ -97,6 +97,7 @@ setup( "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Text Processing :: Markup" ], ) diff --git a/tests/_test_tokenizer.py b/tests/_test_tokenizer.py index 2629671..6a749c7 100644 --- a/tests/_test_tokenizer.py +++ b/tests/_test_tokenizer.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/_test_tree_equality.py b/tests/_test_tree_equality.py index 407711e..3dc28c0 100644 --- a/tests/_test_tree_equality.py +++ b/tests/_test_tree_equality.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_argument.py b/tests/test_argument.py index 110436a..ccf429d 100644 --- a/tests/test_argument.py +++ b/tests/test_argument.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_attribute.py b/tests/test_attribute.py index a8be214..74739b7 100644 --- a/tests/test_attribute.py +++ b/tests/test_attribute.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_builder.py b/tests/test_builder.py index e5f43aa..59f3445 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2019 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_comment.py b/tests/test_comment.py index 60cbba6..071d1d8 100644 --- a/tests/test_comment.py +++ b/tests/test_comment.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_ctokenizer.py b/tests/test_ctokenizer.py index f9b8d2f..53d6700 100644 --- a/tests/test_ctokenizer.py +++ b/tests/test_ctokenizer.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2016 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_docs.py b/tests/test_docs.py index 101a347..e478a5f 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_external_link.py b/tests/test_external_link.py index 1323109..462a438 100644 --- a/tests/test_external_link.py +++ b/tests/test_external_link.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_heading.py b/tests/test_heading.py index a031332..d043bc7 100644 --- a/tests/test_heading.py +++ b/tests/test_heading.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_html_entity.py b/tests/test_html_entity.py index d3a9bd2..85a23ec 100644 --- a/tests/test_html_entity.py +++ b/tests/test_html_entity.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_parameter.py b/tests/test_parameter.py index 3d0028e..fe527f1 100644 --- a/tests/test_parameter.py +++ b/tests/test_parameter.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_parser.py b/tests/test_parser.py index 22a76f6..b16449f 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2016 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_pytokenizer.py b/tests/test_pytokenizer.py index 9fd0c3e..3015b14 100644 --- a/tests/test_pytokenizer.py +++ b/tests/test_pytokenizer.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2019 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_roundtripping.py b/tests/test_roundtripping.py index 9ecd5bd..b5e204c 100644 --- a/tests/test_roundtripping.py +++ b/tests/test_roundtripping.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2016 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_smart_list.py b/tests/test_smart_list.py index 58b327a..0cdb79a 100644 --- a/tests/test_smart_list.py +++ b/tests/test_smart_list.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_string_mixin.py b/tests/test_string_mixin.py index aa13f11..e6d1ff4 100644 --- a/tests/test_string_mixin.py +++ b/tests/test_string_mixin.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_tag.py b/tests/test_tag.py index 1fb82e9..2bea194 100644 --- a/tests/test_tag.py +++ b/tests/test_tag.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_template.py b/tests/test_template.py index 34dd32d..cf812a6 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_text.py b/tests/test_text.py index a54311a..96dff16 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_tokens.py b/tests/test_tokens.py index 1f6c02a..42f54bf 100644 --- a/tests/test_tokens.py +++ b/tests/test_tokens.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_utils.py b/tests/test_utils.py index b8572fd..89ba93c 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2016 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_wikicode.py b/tests/test_wikicode.py index 0188ad0..6e017de 100644 --- a/tests/test_wikicode.py +++ b/tests/test_wikicode.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tests/test_wikilink.py b/tests/test_wikilink.py index 597c18f..1f331e0 100644 --- a/tests/test_wikilink.py +++ b/tests/test_wikilink.py @@ -1,4 +1,3 @@ -# # Copyright (C) 2012-2020 Ben Kurtovic # # Permission is hereby granted, free of charge, to any person obtaining a copy