Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d5a5a33f
Commit
d5a5a33f
authored
Mar 27, 2019
by
Philipp A
Committed by
Cheryl Sabella
Mar 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
parent
a694f239
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
Lib/distutils/command/check.py
Lib/distutils/command/check.py
+2
-1
Lib/distutils/tests/includetest.rst
Lib/distutils/tests/includetest.rst
+1
-0
Lib/distutils/tests/test_check.py
Lib/distutils/tests/test_check.py
+15
-1
Misc/NEWS.d/next/Library/2017-08-30-20-27-00.bpo-31292.dKIaZb.rst
...S.d/next/Library/2017-08-30-20-27-00.bpo-31292.dKIaZb.rst
+2
-0
No files found.
Lib/distutils/command/check.py
View file @
d5a5a33f
...
...
@@ -120,7 +120,8 @@ class check(Command):
def
_check_rst_data
(
self
,
data
):
"""Returns warnings when the provided data doesn't compile."""
source_path
=
StringIO
()
# the include and csv_table directives need this to be a path
source_path
=
self
.
distribution
.
script_name
or
'setup.py'
parser
=
Parser
()
settings
=
frontend
.
OptionParser
(
components
=
(
Parser
,)).
get_default_values
()
settings
.
tab_width
=
4
...
...
Lib/distutils/tests/includetest.rst
0 → 100644
View file @
d5a5a33f
This should be included.
Lib/distutils/tests/test_check.py
View file @
d5a5a33f
"""Tests for distutils.command.check."""
import
os
import
textwrap
import
unittest
from
test.support
import
run_unittest
...
...
@@ -13,13 +14,19 @@ except ImportError:
pygments
=
None
HERE
=
os
.
path
.
dirname
(
__file__
)
class
CheckTestCase
(
support
.
LoggingSilencer
,
support
.
TempdirManager
,
unittest
.
TestCase
):
def
_run
(
self
,
metadata
=
None
,
**
options
):
def
_run
(
self
,
metadata
=
None
,
cwd
=
None
,
**
options
):
if
metadata
is
None
:
metadata
=
{}
if
cwd
is
not
None
:
old_dir
=
os
.
getcwd
()
os
.
chdir
(
cwd
)
pkg_info
,
dist
=
self
.
create_dist
(
**
metadata
)
cmd
=
check
(
dist
)
cmd
.
initialize_options
()
...
...
@@ -27,6 +34,8 @@ class CheckTestCase(support.LoggingSilencer,
setattr
(
cmd
,
name
,
value
)
cmd
.
ensure_finalized
()
cmd
.
run
()
if
cwd
is
not
None
:
os
.
chdir
(
old_dir
)
return
cmd
def
test_check_metadata
(
self
):
...
...
@@ -99,6 +108,11 @@ class CheckTestCase(support.LoggingSilencer,
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:: includetest.rst'
cmd
=
self
.
_run
(
metadata
,
cwd
=
HERE
,
strict
=
1
,
restructuredtext
=
1
)
self
.
assertEqual
(
cmd
.
_warnings
,
0
)
@
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
...
...
Misc/NEWS.d/next/Library/2017-08-30-20-27-00.bpo-31292.dKIaZb.rst
0 → 100644
View file @
d5a5a33f
Fix ``setup.py check --restructuredtext`` for
files containing ``include`` directives.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment