Trying to exclude files not working

96 views
Skip to first unread message

Joshua J. Kugler

unread,
Aug 17, 2020, 8:41:47 PM8/17/20
to sphinx...@googlegroups.com
sphinx-apidoc says:

"""
sphinx-apidoc [OPTIONS] -o <OUTPUT_PATH> <MODULE_PATH> [EXCLUDE_PATTERN …]

Any EXCLUDE_PATTERNs given are fnmatch-style file and/or directory patterns
that will be excluded from generation.
"""

My tree looks like this:

devkit/tests/test_files/<files used for tests>

My command for apidoc looks like this:

sphinx-apidoc -f -e -M --implicit-namespaces -o ./modules ../devkit/
'test_files/*'

That doesn't exclude things in test_files/. I tried '*/test_files/*' as well as
*test_files* as well as 'devkit/tests/test_files/*' but an rst file is still be
creating for python files in the test_files tree.

What am I doing wrong?

Thanks!

j

--
Joshua J. Kugler - Fairbanks, Alaska - jos...@azariah.com
Azariah Enterprises - Programming and Website Design
PGP Key: http://pgp.mit.edu/ ID 0x68108cbb73b13b6a


Matt from Documatt

unread,
Aug 21, 2020, 8:13:03 AM8/21/20
to sphinx...@googlegroups.com
This is pretty strange. Did you solve it already? Your patterns are correct. For example:

>>> from fnmatch import fnmatch
>>> fnmatch("devkit/tests/test_files/foo_test.py", "*test_files*")
True

Matt


--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/3490677.efuseTzYfb%40hosanna.

Joshua J. Kugler

unread,
Aug 24, 2020, 6:50:18 PM8/24/20
to sphinx...@googlegroups.com
Nope, still haven't fixed it. On the back burner for now, but would be nice to
figure out why.

j

Joshua J. Kugler

unread,
Aug 31, 2020, 7:28:09 PM8/31/20
to sphinx...@googlegroups.com
Any solution for this? Shall I open a bug?

j
Joshua J. Kugler -- Fairbanks, AK
Blogs: http://jjncj.com/blog/ (Family) -- http://joshuakugler.com (Geek)
Philippians 2:9-11


Joshua J. Kugler

unread,
Aug 31, 2020, 7:29:09 PM8/31/20
to sphinx...@googlegroups.com
Any solution for this? Shall I open a bug?

j

On Monday, August 24, 2020 2:50:10 PM AKDT Joshua J. Kugler wrote:

Komiya Takeshi

unread,
Sep 4, 2020, 11:37:52 PM9/4/20
to sphinx...@googlegroups.com
Hi,

It seems your MODULE_PATH starts with "..". How about prepending ".."
to the exclude paths?

sphinx-apidoc -f -e -M --implicit-namespaces -o ./modules ../devkit/
'../test_files/*'

Thanks,
Takeshi KOMIYA

2020年8月18日(火) 9:41 Joshua J. Kugler <jos...@azariah.com>:

Joshua J. Kugler

unread,
Sep 11, 2020, 6:17:29 PM9/11/20
to sphinx...@googlegroups.com
I could try that, but the directory isn't at ../test_files. sphinx uses
fnmatch, so should match *any*path that matches that pattern, not just a
relative reference, no?

j

Matt from Documatt

unread,
Sep 12, 2020, 4:02:39 AM9/12/20
to sphinx...@googlegroups.com
I think we can safely consider it a bug. Thank you for filing an issue, Joshua.

Matt

Komiya Takeshi

unread,
Sep 12, 2020, 7:24:18 AM9/12/20
to sphinx...@googlegroups.com
Now the patterns are considered as relative paths from the current
directory and converted to absolute paths before matching.

2020年9月12日(土) 7:17 Joshua J. Kugler <jos...@azariah.com>:
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/3566575.aeNJFYEL58%40hosanna.

Joshua J. Kugler

unread,
Oct 16, 2020, 6:05:36 PM10/16/20
to sphinx...@googlegroups.com, Matt from Documatt
You're welcome.

I finally got it work by using

../devkit/tests

as the exclude pattern. I assumed the exclude used pattern matching on the
files in the tree...not an actual path to a directory.

j

Daniel Scott

unread,
Nov 25, 2020, 10:28:47 PM11/25/20
to sphinx...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages