Skip to content

Add extension to include generated config in the docs - #30

Merged
astrofrog merged 2 commits into
astropy:masterfrom
saimn:generate-config
Apr 25, 2020
Merged

astrofrog merged 2 commits into
astropy:masterfrom
saimn:generate-config

Conversation

@saimn

@saimn saimn commented Apr 24, 2020

Copy link
Copy Markdown
Contributor

Ref astropy/astropy#10148
Not sure how to test this, since this would require to install astropy here...

required_arguments = 1

def run(self):
from astropy.config import generate_config

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the idea to bring generate_config() over here, too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the config related stuff is in astropy, and this new function could be used there to generate the config file when needed, it is not only for the docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate_config should stay in core library, not here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fair enough, it was my misunderstanding. Having to require astropy as a dependency for this on the other hand seems a bit extreme when the extension has such a generic name (maybe rename sphinx_astropy.ext.generate_astropy_config?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would work for other packages, e.g. astroquery. And sphinx-astropy is an astropy thing anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the astropy in the name to mean the astropy type of config system, that astroquery also uses.
Either way, it's not a strong preference, but usually folks are arguing that both our sphinx and pytest stuff is widely generic and complained in the past on reliance on reliance on astropy (thus they got moved out from the helpers).

Anyway, it needs to be @astrofrog who reviews and merge this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think astropy is not needed in the extension name since the extension itself indeed already has 'astropy' in the name.

@bsipocz
bsipocz requested a review from astrofrog April 24, 2020 20:26

@astrofrog astrofrog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - ideally it should be tested but I think we have a circular issue here that ideally we need the astropy function to exist. So this looks good to me, but a test should be added once astropy 4.1 is out.

required_arguments = 1

def run(self):
from astropy.config import generate_config

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think astropy is not needed in the extension name since the extension itself indeed already has 'astropy' in the name.

@astrofrog
astrofrog merged commit 91bdd66 into astropy:master Apr 25, 2020
@saimn
saimn deleted the generate-config branch April 26, 2020 02:05
@saimn

saimn commented Apr 26, 2020

Copy link
Copy Markdown
Contributor Author

Thanks @astrofrog, and agreed for the test.
So now we will need a new release of sphinx-astropy ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants