mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Ignore filenames without file extension given to `Builder.build_specific()
`
So far, ``Builder.build_specific()`` accpets filnames without file extension. On the other hand, ``sphinx-build`` command does not accept such files. So the special handling code is only working for 3rd party applications. The behavior is not consistent. In addition, that is not helpful for users. This removes such behavior from builders. This does not change Sphinx application itself. It only effects to the applications which uses the API directly.
This commit is contained in:
parent
ac4ec47378
commit
d9d5594c6f
3
CHANGES
3
CHANGES
@ -7,6 +7,9 @@ Dependencies
|
||||
Incompatible changes
|
||||
--------------------
|
||||
|
||||
* Ignore filenames without file extension given to ``Builder.build_specific()``
|
||||
API directly
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
|
@ -298,8 +298,7 @@ class Builder:
|
||||
logger.warning(__('file %r given on command line is not under the '
|
||||
'source directory, ignoring'), filename)
|
||||
continue
|
||||
if not (path.isfile(filename) or
|
||||
any(path.isfile(filename + suffix) for suffix in suffixes)):
|
||||
if not path.isfile(filename):
|
||||
logger.warning(__('file %r given on command line does not exist, '
|
||||
'ignoring'), filename)
|
||||
continue
|
||||
|
@ -131,7 +131,7 @@ def test_build_specific(app):
|
||||
app.srcdir / 'subdir/../subdir/excluded.txt'] # not normalized
|
||||
app.build(False, filenames)
|
||||
|
||||
expected = ['index', 'images', 'img.png', 'subdir/includes', 'subdir/excluded']
|
||||
expected = ['index', 'img.png', 'subdir/includes', 'subdir/excluded']
|
||||
app.builder.build.assert_called_with(expected,
|
||||
method='specific',
|
||||
summary='5 source files given on command line')
|
||||
summary='4 source files given on command line')
|
||||
|
Loading…
Reference in New Issue
Block a user