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

Fixed inconsistent usage of keep_local and local_only kwarg in Help() function, its implementation and docs #4606

Closed
wants to merge 1 commit into from

Conversation

hedger
Copy link

@hedger hedger commented Sep 29, 2024

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation

@bdbaddog
Copy link
Contributor

bdbaddog commented Sep 29, 2024

Not sure why you believe this change is needed?
local_only, means only the local addoptions args are in the help.. what's the concern here?

@hedger
Copy link
Author

hedger commented Sep 30, 2024

@bdbaddog the concern is that documentation is inconsistent with actual behavior.

Currently, the docs mention the following prototype for the Help() function:

env.Help(text, append=False, local_only=False)

While actual implementation in

def HelpFunction(text, append: bool = False, keep_local: bool = False) -> None:
uses the keep_local kwarg name.

I made the documentation consistent with the actual implementation - in order to not break any third-party code that relies on existing behavior. I also renamed the kwarg inside the implementation to avoid confusion.

@mwichmann mwichmann added the args_and_options options processing, arguments, get/setoption and their relationshiop label Oct 27, 2024
@bdbaddog
Copy link
Contributor

Seems like it would be simpler to just make everything local_only and not keep_local

also calling Help() in your SConscript calls SCons.SConscript.Help(), and not PrintHelp() (not directly).
Help() calls HelpFunction() which calls PrintHelp()

So the public interface is SCons.SConscript.Help(), and that's what's misdocumented.
(and mis doc-string'ed too I think)

Thoughts @mwichmann ?

@@ -49,6 +49,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
cl.exe-compatible command line switches.
- Some manpage cleanup for the gettext and pdf/ps builders.
- Some clarifications in the User Guide "Environments" chapter.
- Fixed wrong naming in the documentation of "keep_local" parameter for
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be changed to be attributed to you and not to mwichmann.
Please add a section with your name here ( it should be alphabetical by last name)

@bdbaddog
Copy link
Contributor

Replacing this with #4670

@bdbaddog bdbaddog closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
args_and_options options processing, arguments, get/setoption and their relationshiop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants