Skip to content

Print nice error message if sphinx_changelog is not installed - #11797

Merged
pllim merged 1 commit into
astropy:mainfrom
larrybradley:sphinx_changelog
Jun 3, 2021
Merged

pllim merged 1 commit into
astropy:mainfrom
larrybradley:sphinx_changelog

Conversation

@larrybradley

Copy link
Copy Markdown
Member

Building docs locally requires thesphinx_changelog package.

Comment thread docs/conf.py Resolved
@Cadair

Cadair commented May 28, 2021

Copy link
Copy Markdown
Member

Maybe a more general solution might be nice? 👼

@pllim

pllim commented May 28, 2021

Copy link
Copy Markdown
Member

Perhaps... but I'll leave it to Larry whether generalization is out of scope or not.

@saimn

saimn commented May 28, 2021

Copy link
Copy Markdown
Contributor

Should sphinx-changelog be added as a dependency for sphinx-astropy ?

@larrybradley

Copy link
Copy Markdown
Member Author

@Cadair Thanks, I implemented a more general solution.

@saimn That seems reasonable to me.

Comment thread docs/conf.py Outdated
except ImportError:
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
# -- Check for missing dependencies -------------------------------------------
doc_requires = get_distribution("astropy").requires(extras=("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.

Wait a min... I thought we are using importlib now.

for line in importlib_metadata.requires('astropy'):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah indeed, we should use importlib.metadata instead (#11091).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@larrybradley
larrybradley requested review from pllim and saimn June 3, 2021 03:38

@saimn saimn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good!

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

LGTM. Thanks!

@pllim

pllim commented Jun 3, 2021

Copy link
Copy Markdown
Member

Does this really need backport? I don't think so... I am changing the milestone.

@pllim pllim modified the milestones: v4.0.6, v5.0 Jun 3, 2021
@pllim
pllim merged commit b4fa7d3 into astropy:main Jun 3, 2021
@larrybradley
larrybradley deleted the sphinx_changelog branch June 3, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants