astropy / sphinx-automodapi

Sphinx extension for generating API documentation
https://sphinx-automodapi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

Add option to set :noindex: #150

Closed saimn closed 1 year ago

saimn commented 2 years ago

Fix #130.

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

codecov[bot] commented 2 years ago

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

saimn commented 2 years ago

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

saimn commented 2 years ago

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

saimn commented 2 years ago

All green now :)

pllim commented 2 years ago

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

saimn commented 2 years ago

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

pllim commented 2 years ago

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

saimn commented 2 years ago

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:

pllim commented 2 years ago

@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.

saimn commented 1 year ago

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.

pllim commented 1 year ago

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

Cadair commented 1 year ago

Is it time to make astropy less complicated?!

I have been working on this for years :stuck_out_tongue:

Cadair commented 1 year ago

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

pllim commented 1 year ago

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

pllim commented 1 year ago

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

pllim commented 1 year ago

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