Skip to content
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

Excluding directories #312

Open
evildmp opened this issue Nov 11, 2021 · 4 comments
Open

Excluding directories #312

evildmp opened this issue Nov 11, 2021 · 4 comments
Labels
Enhancement Good First Issue Good issue for first time contributors

Comments

@evildmp
Copy link

evildmp commented Nov 11, 2021

AutoAPI makes the reasonable assumption that one's directory structure will look like:

    mypackage/
    ├── docs directory
    │   ├── ...
    │   └── ...
    ├── code directory
    │   ├── ...
    │   └── ...
    └── ...

I have at least one structure however that looks like:

    mypackage/
    ├── docs directory
    │   ├── ...
    │   └── ...
    ├── simple code file
    ├── another simple code file
    └── ...

Using autoapi_dirs = ['..'] means that it descends back into docs where it also finds an env and gobbles up everything it finds in there. Then I get a Relative import with too many levels (and it spends a long time processing the contents of the env too).

Unfortunately autoapi_ignore only appears to work on filenames, not directories.

I'd like a way to be able to exclude all of some arbitrary directory, in my case, /docs

@rexwangcc
Copy link

rexwangcc commented Dec 16, 2021

Ran into a similar issue and I tried something like *vendor* which did the trick (ignoring files under vendor/) for me, just FYI 😄

@AWhetter AWhetter added Enhancement Good First Issue Good issue for first time contributors labels Dec 23, 2021
@AWhetter
Copy link
Collaborator

To any first time contributors looking to resolve this issue, we can filter the list of directories here:

for root, _, filenames in os.walk(_dir):

@rajkaramchedu
Copy link

This is a little beyond my coding skills, but I could really use a better way to exclude files and directories. The trouble with *somekeyword* is it will exclude all the files that match it, including the ones in the directory that I am including.
Use case: If I am editing docstrings in a large Python library, I prefer the local builds go faster, and for that I need to exclude a lot of stuff.

bgmeulem pushed a commit to bgmeulem/sphinx-autoapi that referenced this issue Dec 2, 2024
@bgmeulem
Copy link

First time contributor here! The PR that i linked should resolve this. Could anyone review or approve the test runs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Good First Issue Good issue for first time contributors
Projects
None yet
Development

No branches or pull requests

5 participants