-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoformat: black + clang-format + clang-tidy
- Loading branch information
Showing
68 changed files
with
4,288 additions
and
2,698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BasedOnStyle: LLVM | ||
AlignConsecutiveMacros: AcrossEmptyLines | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AlwaysBreakAfterReturnType: TopLevelDefinitions | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakBeforeBraces: Linux | ||
ColumnLimit: 88 | ||
IndentPPDirectives: AfterHash | ||
IndentWidth: 4 | ||
SpaceAfterCStyleCast: true | ||
StatementMacros: | ||
- PyObject_HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ dist | |
docs/_build | ||
scripts/*.log | ||
htmlcov/ | ||
compile_commands.json | ||
.idea/ | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,10 @@ | |
|
||
# Remove the command line argument as it isn't understood by setuptools: | ||
|
||
sys.argv = [arg for arg in sys.argv | ||
if arg not in ("--without-extension", "--with-extension")] | ||
sys.argv = [ | ||
arg for arg in sys.argv if arg not in ("--without-extension", "--with-extension") | ||
] | ||
|
||
|
||
def build_ext_patched(self): | ||
try: | ||
|
@@ -63,33 +65,40 @@ def build_ext_patched(self): | |
print("Falling back to pure Python mode.") | ||
del self.extensions[:] | ||
|
||
|
||
if fallback: | ||
build_ext.run, build_ext_original = build_ext_patched, build_ext.run | ||
|
||
# Project-specific part begins here: | ||
|
||
tokenizer = Extension("mwparserfromhell.parser._tokenizer", | ||
sources=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.c")), | ||
depends=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.h"))) | ||
tokenizer = Extension( | ||
"mwparserfromhell.parser._tokenizer", | ||
sources=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.c")), | ||
depends=sorted(glob("src/mwparserfromhell/parser/ctokenizer/*.h")), | ||
) | ||
|
||
setup( | ||
name = "mwparserfromhell", | ||
packages = find_packages("src"), | ||
package_dir = {"": "src"}, | ||
ext_modules = [tokenizer] if use_extension else [], | ||
setup_requires = ["pytest-runner"] if "test" in sys.argv or "pytest" in sys.argv else [], | ||
tests_require = ["pytest"], | ||
version = __version__, | ||
python_requires = ">= 3.5", | ||
author = "Ben Kurtovic", | ||
author_email = "[email protected]", | ||
url = "https://github.com/earwig/mwparserfromhell", | ||
description = "MWParserFromHell is a parser for MediaWiki wikicode.", | ||
long_description = long_docs, | ||
download_url = "https://github.com/earwig/mwparserfromhell/tarball/v{}".format(__version__), | ||
keywords = "earwig mwparserfromhell wikipedia wiki mediawiki wikicode template parsing", | ||
license = "MIT License", | ||
classifiers = [ | ||
name="mwparserfromhell", | ||
packages=find_packages("src"), | ||
package_dir={"": "src"}, | ||
ext_modules=[tokenizer] if use_extension else [], | ||
setup_requires=["pytest-runner"] | ||
if "test" in sys.argv or "pytest" in sys.argv | ||
else [], | ||
tests_require=["pytest"], | ||
version=__version__, | ||
python_requires=">= 3.5", | ||
author="Ben Kurtovic", | ||
author_email="[email protected]", | ||
url="https://github.com/earwig/mwparserfromhell", | ||
description="MWParserFromHell is a parser for MediaWiki wikicode.", | ||
long_description=long_docs, | ||
download_url="https://github.com/earwig/mwparserfromhell/tarball/v{}".format( | ||
__version__ | ||
), | ||
keywords="earwig mwparserfromhell wikipedia wiki mediawiki wikicode template parsing", | ||
license="MIT License", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
|
@@ -101,6 +110,6 @@ def build_ext_patched(self): | |
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Text Processing :: Markup" | ||
"Topic :: Text Processing :: Markup", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,6 @@ | |
__version__ = "0.7.dev0" | ||
__email__ = "[email protected]" | ||
|
||
from . import (definitions, nodes, parser, smart_list, string_mixin, | ||
utils, wikicode) | ||
from . import definitions, nodes, parser, smart_list, string_mixin, utils, wikicode | ||
|
||
parse = utils.parse_anything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.