Browse Source

Move mwparserfromhell to src/ dir

tags/v0.6.1
Ben Kurtovic 3 years ago
parent
commit
297bcb0cee
53 changed files with 24 additions and 20 deletions
  1. +3
    -2
      CHANGELOG
  2. +1
    -1
      MANIFEST.in
  3. +4
    -3
      docs/changelog.rst
  4. +1
    -1
      docs/conf.py
  5. +12
    -10
      setup.py
  6. +2
    -2
      src/mwparserfromhell/__init__.py
  7. +0
    -0
      src/mwparserfromhell/definitions.py
  8. +0
    -0
      src/mwparserfromhell/nodes/__init__.py
  9. +0
    -0
      src/mwparserfromhell/nodes/_base.py
  10. +0
    -0
      src/mwparserfromhell/nodes/argument.py
  11. +0
    -0
      src/mwparserfromhell/nodes/comment.py
  12. +0
    -0
      src/mwparserfromhell/nodes/external_link.py
  13. +0
    -0
      src/mwparserfromhell/nodes/extras/__init__.py
  14. +0
    -0
      src/mwparserfromhell/nodes/extras/attribute.py
  15. +0
    -0
      src/mwparserfromhell/nodes/extras/parameter.py
  16. +0
    -0
      src/mwparserfromhell/nodes/heading.py
  17. +0
    -0
      src/mwparserfromhell/nodes/html_entity.py
  18. +0
    -0
      src/mwparserfromhell/nodes/tag.py
  19. +0
    -0
      src/mwparserfromhell/nodes/template.py
  20. +0
    -0
      src/mwparserfromhell/nodes/text.py
  21. +0
    -0
      src/mwparserfromhell/nodes/wikilink.py
  22. +0
    -0
      src/mwparserfromhell/parser/__init__.py
  23. +0
    -0
      src/mwparserfromhell/parser/builder.py
  24. +0
    -0
      src/mwparserfromhell/parser/contexts.py
  25. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/avl_tree.c
  26. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/avl_tree.h
  27. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/common.h
  28. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/contexts.h
  29. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/definitions.c
  30. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/definitions.h
  31. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tag_data.c
  32. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tag_data.h
  33. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/textbuffer.c
  34. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/textbuffer.h
  35. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c
  36. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tok_parse.h
  37. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tok_support.c
  38. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tok_support.h
  39. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tokenizer.c
  40. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tokenizer.h
  41. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tokens.c
  42. +0
    -0
      src/mwparserfromhell/parser/ctokenizer/tokens.h
  43. +0
    -0
      src/mwparserfromhell/parser/errors.py
  44. +0
    -0
      src/mwparserfromhell/parser/tokenizer.py
  45. +0
    -0
      src/mwparserfromhell/parser/tokens.py
  46. +0
    -0
      src/mwparserfromhell/smart_list/__init__.py
  47. +0
    -0
      src/mwparserfromhell/smart_list/list_proxy.py
  48. +0
    -0
      src/mwparserfromhell/smart_list/smart_list.py
  49. +0
    -0
      src/mwparserfromhell/smart_list/utils.py
  50. +0
    -0
      src/mwparserfromhell/string_mixin.py
  51. +0
    -0
      src/mwparserfromhell/utils.py
  52. +0
    -0
      src/mwparserfromhell/wikicode.py
  53. +1
    -1
      tests/conftest.py

+ 3
- 2
CHANGELOG View File

@@ -1,7 +1,8 @@
v0.7 (unreleased):

- Port tests to pytest. (#237)
- Improve parsing of external links. (#232)
- Improved parsing of external links. (#232)
- Ported tests to pytest. (#237)
- Moved mwparserfromhell package to src/ dir.

v0.6 (released December 21, 2020):



+ 1
- 1
MANIFEST.in View File

@@ -1,3 +1,3 @@
include LICENSE CHANGELOG
recursive-include mwparserfromhell *.h
recursive-include src *.h
recursive-include tests *.py *.mwtest

+ 4
- 3
docs/changelog.rst View File

@@ -7,10 +7,11 @@ v0.7
Unreleased
(`changes <https://github.com/earwig/mwparserfromhell/compare/v0.6...develop>`__):

- Port tests to pytest.
(`#237 <https://github.com/earwig/mwparserfromhell/issues/237>`_)
- Improve parsing of external links.
- Improved parsing of external links.
(`#232 <https://github.com/earwig/mwparserfromhell/issues/232>`_)
- Ported tests to pytest.
(`#237 <https://github.com/earwig/mwparserfromhell/issues/237>`_)
- Moved mwparserfromhell package to src/ dir.

v0.6
----


+ 1
- 1
docs/conf.py View File

@@ -42,7 +42,7 @@ master_doc = 'index'

# General information about the project.
project = u'mwparserfromhell'
copyright = u'2012–2020 Ben Kurtovic'
copyright = u'2012–2021 Ben Kurtovic'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the


+ 12
- 10
setup.py View File

@@ -20,14 +20,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from distutils.errors import DistutilsError, CCompilerError
from glob import glob
from os import environ
import os
import sys

from setuptools import setup, find_packages, Extension
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))

from mwparserfromhell import __version__

with open("README.rst") as fp:
@@ -38,7 +39,7 @@ fallback = True

# Allow env var WITHOUT_EXTENSION and args --with[out]-extension:

env_var = environ.get("WITHOUT_EXTENSION")
env_var = os.environ.get("WITHOUT_EXTENSION")
if "--without-extension" in sys.argv:
use_extension = False
elif "--with-extension" in sys.argv:
@@ -52,12 +53,12 @@ elif env_var is not None:
# Remove the command line argument as it isn't understood by setuptools:

sys.argv = [arg for arg in sys.argv
if arg != "--without-extension" and arg != "--with-extension"]
if arg not in ("--without-extension", "--with-extension")]

def build_ext_patched(self):
try:
build_ext_original(self)
except (DistutilsError, CCompilerError) as exc:
except Exception as exc:
print("error: " + str(exc))
print("Falling back to pure Python mode.")
del self.extensions[:]
@@ -68,14 +69,15 @@ if fallback:
# Project-specific part begins here:

tokenizer = Extension("mwparserfromhell.parser._tokenizer",
sources=sorted(glob("mwparserfromhell/parser/ctokenizer/*.c")),
depends=sorted(glob("mwparserfromhell/parser/ctokenizer/*.h")))
sources=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.c")),
depends=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.h")))

setup(
name = "mwparserfromhell",
packages = find_packages(exclude=("tests",)),
packages = ["mwparserfromhell"],
package_dir = {"": "src"},
ext_modules = [tokenizer] if use_extension else [],
test_requires = ["pytest"],
tests_require = ["pytest"],
version = __version__,
python_requires = ">= 3.5",
author = "Ben Kurtovic",


mwparserfromhell/__init__.py → src/mwparserfromhell/__init__.py View File

@@ -1,4 +1,4 @@
# Copyright (C) 2012-2020 Ben Kurtovic <ben.kurtovic@gmail.com>
# Copyright (C) 2012-2021 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@ outrageously powerful parser for `MediaWiki <https://www.mediawiki.org>`_ wikico
"""

__author__ = "Ben Kurtovic"
__copyright__ = "Copyright (C) 2012-2020 Ben Kurtovic"
__copyright__ = "Copyright (C) 2012-2021 Ben Kurtovic"
__license__ = "MIT License"
__version__ = "0.7.dev0"
__email__ = "ben.kurtovic@gmail.com"

mwparserfromhell/definitions.py → src/mwparserfromhell/definitions.py View File


mwparserfromhell/nodes/__init__.py → src/mwparserfromhell/nodes/__init__.py View File


mwparserfromhell/nodes/_base.py → src/mwparserfromhell/nodes/_base.py View File


mwparserfromhell/nodes/argument.py → src/mwparserfromhell/nodes/argument.py View File


mwparserfromhell/nodes/comment.py → src/mwparserfromhell/nodes/comment.py View File


mwparserfromhell/nodes/external_link.py → src/mwparserfromhell/nodes/external_link.py View File


mwparserfromhell/nodes/extras/__init__.py → src/mwparserfromhell/nodes/extras/__init__.py View File


mwparserfromhell/nodes/extras/attribute.py → src/mwparserfromhell/nodes/extras/attribute.py View File


mwparserfromhell/nodes/extras/parameter.py → src/mwparserfromhell/nodes/extras/parameter.py View File


mwparserfromhell/nodes/heading.py → src/mwparserfromhell/nodes/heading.py View File


mwparserfromhell/nodes/html_entity.py → src/mwparserfromhell/nodes/html_entity.py View File


mwparserfromhell/nodes/tag.py → src/mwparserfromhell/nodes/tag.py View File


mwparserfromhell/nodes/template.py → src/mwparserfromhell/nodes/template.py View File


mwparserfromhell/nodes/text.py → src/mwparserfromhell/nodes/text.py View File


mwparserfromhell/nodes/wikilink.py → src/mwparserfromhell/nodes/wikilink.py View File


mwparserfromhell/parser/__init__.py → src/mwparserfromhell/parser/__init__.py View File


mwparserfromhell/parser/builder.py → src/mwparserfromhell/parser/builder.py View File


mwparserfromhell/parser/contexts.py → src/mwparserfromhell/parser/contexts.py View File


mwparserfromhell/parser/ctokenizer/avl_tree.c → src/mwparserfromhell/parser/ctokenizer/avl_tree.c View File


mwparserfromhell/parser/ctokenizer/avl_tree.h → src/mwparserfromhell/parser/ctokenizer/avl_tree.h View File


mwparserfromhell/parser/ctokenizer/common.h → src/mwparserfromhell/parser/ctokenizer/common.h View File


mwparserfromhell/parser/ctokenizer/contexts.h → src/mwparserfromhell/parser/ctokenizer/contexts.h View File


mwparserfromhell/parser/ctokenizer/definitions.c → src/mwparserfromhell/parser/ctokenizer/definitions.c View File


mwparserfromhell/parser/ctokenizer/definitions.h → src/mwparserfromhell/parser/ctokenizer/definitions.h View File


mwparserfromhell/parser/ctokenizer/tag_data.c → src/mwparserfromhell/parser/ctokenizer/tag_data.c View File


mwparserfromhell/parser/ctokenizer/tag_data.h → src/mwparserfromhell/parser/ctokenizer/tag_data.h View File


mwparserfromhell/parser/ctokenizer/textbuffer.c → src/mwparserfromhell/parser/ctokenizer/textbuffer.c View File


mwparserfromhell/parser/ctokenizer/textbuffer.h → src/mwparserfromhell/parser/ctokenizer/textbuffer.h View File


mwparserfromhell/parser/ctokenizer/tok_parse.c → src/mwparserfromhell/parser/ctokenizer/tok_parse.c View File


mwparserfromhell/parser/ctokenizer/tok_parse.h → src/mwparserfromhell/parser/ctokenizer/tok_parse.h View File


mwparserfromhell/parser/ctokenizer/tok_support.c → src/mwparserfromhell/parser/ctokenizer/tok_support.c View File


mwparserfromhell/parser/ctokenizer/tok_support.h → src/mwparserfromhell/parser/ctokenizer/tok_support.h View File


mwparserfromhell/parser/ctokenizer/tokenizer.c → src/mwparserfromhell/parser/ctokenizer/tokenizer.c View File


mwparserfromhell/parser/ctokenizer/tokenizer.h → src/mwparserfromhell/parser/ctokenizer/tokenizer.h View File


mwparserfromhell/parser/ctokenizer/tokens.c → src/mwparserfromhell/parser/ctokenizer/tokens.c View File


mwparserfromhell/parser/ctokenizer/tokens.h → src/mwparserfromhell/parser/ctokenizer/tokens.h View File


mwparserfromhell/parser/errors.py → src/mwparserfromhell/parser/errors.py View File


mwparserfromhell/parser/tokenizer.py → src/mwparserfromhell/parser/tokenizer.py View File


mwparserfromhell/parser/tokens.py → src/mwparserfromhell/parser/tokens.py View File


mwparserfromhell/smart_list/__init__.py → src/mwparserfromhell/smart_list/__init__.py View File


mwparserfromhell/smart_list/list_proxy.py → src/mwparserfromhell/smart_list/list_proxy.py View File


mwparserfromhell/smart_list/smart_list.py → src/mwparserfromhell/smart_list/smart_list.py View File


mwparserfromhell/smart_list/utils.py → src/mwparserfromhell/smart_list/utils.py View File


mwparserfromhell/string_mixin.py → src/mwparserfromhell/string_mixin.py View File


mwparserfromhell/utils.py → src/mwparserfromhell/utils.py View File


mwparserfromhell/wikicode.py → src/mwparserfromhell/wikicode.py View File


+ 1
- 1
tests/conftest.py View File

@@ -1,4 +1,4 @@
# Copyright (C) 2012-2020 Ben Kurtovic <ben.kurtovic@gmail.com>
# Copyright (C) 2012-2021 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal


Loading…
Cancel
Save