Skip to content

Add possibility to disable doc build for Fedora by external macro#170

Open
dsilakov wants to merge 4 commits into
fedora-python:mainfrom
dsilakov:master
Open

Add possibility to disable doc build for Fedora by external macro#170
dsilakov wants to merge 4 commits into
fedora-python:mainfrom
dsilakov:master

Conversation

@dsilakov

@dsilakov dsilakov commented Jun 5, 2018

Copy link
Copy Markdown

Sometimes it is convenient to disable generation of documentation for python modules. A common practice is to use "doc_guard" for this - enclose doc-related parts with %if 0%{?with_doc} condition (see e.g., redhat-openstack/easyfix#6).

Default value for with_doc macro is set to 1; this patch also takes into account global _without_doc macro, so one can turn documentation on/off by changing a single macro in a build environment.

@hroncok

hroncok commented Jun 5, 2018

Copy link
Copy Markdown
Member
  1. I think this creates unnecessary clutter in spec and should be optional
  2. Please use bcond based conditions

%if 0%{?_without_doc}
%bcond_with doc
%else
%bcond_without doc

@hroncok hroncok Jun 5, 2018

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.

just keep this line; the if/else part is not needed at all.

@hroncok

hroncok commented Jun 5, 2018

Copy link
Copy Markdown
Member

Now should it be doc or docs?

@dsilakov

dsilakov commented Jun 5, 2018

Copy link
Copy Markdown
Author

Not sure if Fedora has formalized policy on this. I kept in mind OpenStack specs from RDO, many of them use "doc" and none uses "docs"

@patsevanton

patsevanton commented Feb 27, 2020

Copy link
Copy Markdown

Hello!

Do you accept a pull request that adds a "- without_doc" file that disables the documentation build?

This is just an option. By default, pyp2rpm will also compile with documentation.

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.

3 participants