Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dsilakov
Copy link

@dsilakov dsilakov commented Jun 5, 2018

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
Copy link
Member

hroncok commented Jun 5, 2018

  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
Copy link
Member

@hroncok hroncok Jun 5, 2018

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
Copy link
Member

hroncok commented Jun 5, 2018

Now should it be doc or docs?

@dsilakov
Copy link
Author

dsilakov commented Jun 5, 2018

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
Copy link

patsevanton commented Feb 27, 2020

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