Skip to content

Commit

Permalink
Merge pull request #501 from doorstop-dev/hotfix/v2.1.3
Browse files Browse the repository at this point in the history
Remove mdx_outline due to Python 3.9 incompatibility
  • Loading branch information
jacebrowning authored Jan 14, 2021
2 parents 687acb8 + 6ca8673 commit 409e683
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 273 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.3 (2021-01-14)

- Removed `mdx_outline` Markdown extension, which is incompatible with Python 3.9.

# 2.1.2 (2020-07-06)

- Fixed tree builder to skip virtual environments.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $(DEPENDENCIES): poetry.lock

ifndef CI
poetry.lock: pyproject.toml
poetry lock
poetry lock --no-update
@ touch $@
endif

Expand Down
2 changes: 0 additions & 2 deletions doorstop/core/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
EXTENSIONS = (
'markdown.extensions.extra',
'markdown.extensions.sane_lists',
'mdx_outline',
'mdx_math',
PlantUMLMarkdownExtension(
server='http://www.plantuml.com/plantuml',
cachedir=tempfile.gettempdir(),
Expand Down
23 changes: 10 additions & 13 deletions doorstop/core/tests/files/published.html

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions doorstop/core/tests/files/published2.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions doorstop/core/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ def test_lines_markdown_document_without_child_links(self):
common.write_text(text, path)

@unittest.skipIf(
sys.version_info >= (3, 8),
reason="output format differs with newer versions of Python",
sys.version_info < (3, 8),
reason="Output format differs with older versions of Python",
)
def test_lines_html_document_linkify(self):
"""Verify HTML can be published from a document."""
Expand All @@ -628,8 +628,8 @@ def test_lines_html_document_linkify(self):
common.write_text(text, path)

@unittest.skipIf(
sys.version_info >= (3, 8),
reason="output format differs with newer versions of Python",
sys.version_info < (3, 8),
reason="Output format differs with older versions of Python",
)
@patch('doorstop.settings.PUBLISH_CHILD_LINKS', False)
def test_lines_html_document_without_child_links(self):
Expand Down
12 changes: 4 additions & 8 deletions doorstop/core/tests/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,7 @@ def test_lines_markdown_item_no_references_check(self):

def test_lines_html_item(self):
"""Verify HTML can be published from an item."""
expected = (
'<section class="section2" id="req3"><h2>1.1 Heading</h2>\n</section>\n'
)
expected = '<h2 id="req3">1.1 Heading</h2>\n'
# Act
lines = publisher.publish_lines(self.item, '.html')
text = ''.join(line + '\n' for line in lines)
Expand All @@ -441,8 +439,8 @@ def test_lines_html_item(self):

@patch('doorstop.settings.PUBLISH_HEADING_LEVELS', False)
def test_lines_html_item_no_heading_levels(self):
"""Verify an item heading level can be ommitted."""
expected = '<section class="section2" id="req3"><h2>Heading</h2>\n</section>\n'
"""Verify an item heading level can be omitted."""
expected = '<h2 id="req3">Heading</h2>\n'
# Act
lines = publisher.publish_lines(self.item, '.html')
text = ''.join(line + '\n' for line in lines)
Expand All @@ -451,9 +449,7 @@ def test_lines_html_item_no_heading_levels(self):

def test_lines_html_item_linkify(self):
"""Verify HTML (hyper) can be published from an item."""
expected = (
'<section class="section2" id="req3"><h2>1.1 Heading</h2>\n</section>\n'
)
expected = '<h2 id="req3">1.1 Heading</h2>\n'
# Act
lines = publisher.publish_lines(self.item, '.html', linkify=True)
text = ''.join(line + '\n' for line in lines)
Expand Down
14 changes: 8 additions & 6 deletions doorstop/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
log = common.logger(__name__)

app = utilities.StripPathMiddleware(bottle.app())
tree: Tree = None # type: ignore, set in `run`, read in the route functions
tree: Tree = None # type: ignore
numbers: Dict[str, int] = defaultdict(int) # cache of next document numbers


Expand All @@ -32,14 +32,16 @@ def main(args=None):
# Shared options
debug = argparse.ArgumentParser(add_help=False)
debug.add_argument('-V', '--version', action='version', version=VERSION)
debug.add_argument('--debug', action='store_true', help=argparse.SUPPRESS)
debug.add_argument('--launch', action='store_true', help=argparse.SUPPRESS)
debug.add_argument(
'--debug', action='store_true', help="run the server in debug mode"
)
debug.add_argument(
'--launch', action='store_true', help="open the server UI in a browser"
)
shared = {'formatter_class': HelpFormatter, 'parents': [debug]}

# Build main parser
parser = argparse.ArgumentParser( # type: ignore
prog=SERVER, description=__doc__, **shared
)
parser = argparse.ArgumentParser(prog=SERVER, description=__doc__, **shared) # type: ignore
cwd = os.getcwd()

parser.add_argument(
Expand Down
Loading

0 comments on commit 409e683

Please sign in to comment.