-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
bpo-31292: Fix distutils check --restructuredtext for include directives #3248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
41beaf4
bpo-31292: Fixed distutils check --restructuredtext for include direc…
flying-sheep cb0c3e5
switched away from f-literal
flying-sheep 9de80f5
use source_path also for note_source()
flying-sheep 51e34b5
Use consensus format for source_desc
flying-sheep c011a69
added news blurb
flying-sheep 21a00df
it needs to be a path after all
flying-sheep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
| This should be included. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| """Tests for distutils.command.check.""" | ||
| import textwrap | ||
| import unittest | ||
| from pathlib import Path | ||
| from test.support import run_unittest | ||
|
|
||
| from distutils.command.check import check, HAS_DOCUTILS | ||
|
|
@@ -13,6 +14,10 @@ | |
| pygments = None | ||
|
|
||
|
|
||
| HERE = Path(__file__).parent | ||
| INCLUDE_TEST_PATH = (HERE / 'includetest.rst').relative_to(Path.cwd()) | ||
|
|
||
|
|
||
| class CheckTestCase(support.LoggingSilencer, | ||
| support.TempdirManager, | ||
| unittest.TestCase): | ||
|
|
@@ -99,6 +104,11 @@ def test_check_restructuredtext(self): | |
| cmd = self._run(metadata, strict=1, restructuredtext=1) | ||
| self.assertEqual(cmd._warnings, 0) | ||
|
|
||
| # check that includes work to test #31292 | ||
| metadata['long_description'] = 'title\n=====\n\n.. include:: {}'.format(INCLUDE_TEST_PATH) | ||
| cmd = self._run(metadata, strict=1, restructuredtext=1) | ||
| self.assertEqual(cmd._warnings, 0) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to test the value of the long description (to see the desired text included)? |
||
|
|
||
| @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") | ||
| def test_check_restructuredtext_with_syntax_highlight(self): | ||
| # Don't fail if there is a `code` or `code-block` directive | ||
|
|
||
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2017-08-30-20-27-00.bpo-31292.dKIaZb.rst
This file contains hidden or 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,2 @@ | ||
| Fix ``setup.py check --restructuredtext`` for | ||
| files containing ``.. include::`` directives. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind using os.path functions to make it easier to backport the patch?