Skip to content

style: argparse inheritance, hide some options from --help - #3272

Closed
pajod wants to merge 3 commits into
benoitc:masterfrom
pajod:split-pr-config-cleanup-only
Closed

style: argparse inheritance, hide some options from --help#3272
pajod wants to merge 3 commits into
benoitc:masterfrom
pajod:split-pr-config-cleanup-only

Conversation

@pajod

@pajod pajod commented Aug 13, 2024

Copy link
Copy Markdown
Contributor

We have way too much options (#3266)

Idea: We could hide deprecated ones from --help, and possibly move both unstable and deprecated ones to their own, bottom-most section in the documentation.

Attached patch hacks (style improvements welcome) the config.py-class-to-argparse code so we can subclass while keeping metaclass intact. Then it adds a Deprecated class that hides certain settings from --help. I tried to avoid additional functional changes.

If this PR moves forward with minor changes, then the following changes are the next steps:

  1. change some options default value to None and have not specifying them mean "feature not used"
  2. permit and document some options with existing default to be overridden to some None-like value
  3. options that do not take effect based on environment / other options should be warned about
    • behavior of --bind fd://3 when LISTEN_FDS=1 set can be erratic & surprising
  4. boolean options should use argparse.BooleanOptionalAction (Python 3.9+)
    • paves the way to switch settings default-off to default-on without forcing admins to update their config

@benoitc

benoitc commented Jan 22, 2026

Copy link
Copy Markdown
Owner

Closing this PR as it's primarily a style change that has been open for over a year. Thank you for the contribution.

@benoitc benoitc closed this Jan 22, 2026
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.

Does the tmp_upload_dir setting actually do anything?

2 participants