sphinx-automodapi icon indicating copy to clipboard operation
sphinx-automodapi copied to clipboard

Add option to set :noindex:

Open saimn opened this issue 3 years ago • 9 comments

Fix #130.

TODO: see if I can add a test for this.

saimn avatar Apr 20 '22 20:04 saimn

Codecov Report

Merging #150 (c029e0e) into main (c4aa837) will increase coverage by 0.59%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   89.31%   89.90%   +0.59%     
==========================================
  Files          24       27       +3     
  Lines        1104     1139      +35     
==========================================
+ Hits          986     1024      +38     
+ Misses        118      115       -3     
Impacted Files Coverage Δ
sphinx_automodapi/automodapi.py 93.93% <100.00%> (+0.18%) :arrow_up:
sphinx_automodapi/automodsumm.py 85.71% <100.00%> (+0.08%) :arrow_up:
...pi/tests/duplicated_warning/duplicated/__init__.py 100.00% <100.00%> (ø)
...ests/duplicated_warning/duplicated/foo/__init__.py 100.00% <100.00%> (ø)
...api/tests/duplicated_warning/duplicated/foo/foo.py 100.00% <100.00%> (ø)
...utomodapi/tests/example_module/abstract_classes.py 64.28% <100.00%> (+5.46%) :arrow_up:
sphinx_automodapi/tests/test_cases.py 100.00% <100.00%> (ø)
sphinx_automodapi/utils.py 91.30% <100.00%> (+0.47%) :arrow_up:
sphinx_automodapi/autodoc_enhancements.py 100.00% <0.00%> (+4.76%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Apr 20 '22 20:04 codecov[bot]

Wasn't easy but I managed to add a test :) Who wants to review ?

saimn avatar May 06 '22 20:05 saimn

Oh, of course tests fail... maybe for old sphinx versions though

saimn avatar May 06 '22 20:05 saimn

All green now :)

saimn avatar May 06 '22 20:05 saimn

Ooooo... how do we use this in astropy? Does it just magically work?

pllim avatar May 06 '22 21:05 pllim

No magic :D, we must add :noindex: to the duplicated directives, and this PR just propagates :noindex: to autodoc.

saimn avatar May 06 '22 21:05 saimn

@saimn , is there an astropy PR that uses this feature? Would be nice to see if it really works before we merge.

pllim avatar May 09 '22 16:05 pllim

is there an astropy PR that uses this feature? Would be nice to see if it really works before we merge.

@pllim - no, I could do that indeed :+1:

saimn avatar May 19 '22 14:05 saimn

@saimn , any chance we can push this forward? Did you say there is something that not quite working still using this with astropy?

@WilliamJamieson is unable to build astropy docs on Python 3.10 because of the Sphinx maxversion pin.

pllim avatar Aug 11 '22 17:08 pllim

Within another round of testing/debugging on Astropy I'm pretty convinced that the changes here are correct and are doing what is supposed. Adding :noindex: should help fixing duplicate warning for simple cases such as https://github.com/maxnoe/sphinx-automodapi-duplicated-warning, and probably photutils. But for astropy it's not enough because of the complicated structure of the docs and code, using :noindex: there then creates some other warnings about missing references.

saimn avatar Dec 02 '22 18:12 saimn

Is it time to make astropy less complicated?! We cannot pin Sphinx forever.

pllim avatar Dec 02 '22 18:12 pllim

Is it time to make astropy less complicated?!

I have been working on this for years :stuck_out_tongue:

Cadair avatar Dec 07 '22 10:12 Cadair

Even though astropy core doesn't need this, we might as well merge it?

Cadair avatar Dec 09 '22 17:12 Cadair

WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English). -- Huh?

pllim avatar Dec 09 '22 17:12 pllim

Gah, CI got disabled. I have to close/reopen.

pllim avatar Dec 09 '22 17:12 pllim

Merged! I'll let someone else do the release. Thanks, all!

pllim avatar Dec 09 '22 17:12 pllim