Skip to content

Describe the output of help in readme #1634

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

Closed

Conversation

29rou
Copy link
Member

@29rou 29rou commented May 30, 2022

Fixes

  • Add pip-compile help in README.
  • Add pip-sync help in README.

#1633

Contributor checklist
  • Provided the tests for the changes.

  • Assure PR title is short, clear, and good to be included in the user-oriented changelog

Maintainer checklist
  • Assure one of these labels is present: backwards incompatible, feature, enhancement, deprecation, bug, dependency, docs or skip-changelog as they determine changelog listing.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@29rou 29rou requested a review from jdufresne May 30, 2022 06:59
@29rou 29rou self-assigned this May 30, 2022
@29rou 29rou added the docs Documentation related label May 30, 2022
@29rou 29rou linked an issue May 30, 2022 that may be closed by this pull request
@29rou 29rou requested review from 0417taehyun, jdufresne and ssbarnea and removed request for jdufresne and 0417taehyun May 30, 2022 08:07
@29rou 29rou requested a review from atugushev June 1, 2022 01:27
Copy link
Member

@duoi duoi left a comment

Choose a reason for hiding this comment

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

I'm not against this at all, more documentation is good and good documentation is great. I'd like to see the opinions of others on this though as there may be conflicting views to this.

Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

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

I'm not sure this is a good idea. At least this should be generated automatically somehow. Otherwise, the text would be outdated soon.

@29rou
Copy link
Member Author

29rou commented Jun 16, 2022

I agree, it would be better to be able to automatically put the output of help in the README.

@ssbarnea ssbarnea changed the title Describe the output of help in reademe. Describe the output of help in readme Jun 16, 2022
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

I do also agree that this dump is too-likely to get out-of-sync in time.

On the other hand, I do find the need/desire for listing it as valid, so I oppose only the current manual-implementation.

You should write a custom pre-commit hook that regenerates the readme (basically doing a section replace) with the output of the tool. This would prevent making changes that alter the output of the tool without updating the readme. In addition the readme will be updated automatically to match.

@29rou
Copy link
Member Author

29rou commented Jun 16, 2022

I agree with using pre-commit-hooks. Therefore, I will try to set up pre-commit-hooks.

@merwok
Copy link

merwok commented Jun 16, 2022

What about including only the usage lines in README? Full help output would make a long README even longer + description on PyPI.

(If you do decide to go for full help output, then cog may help)

@AndydeCleyre
Copy link
Contributor

Another option for generating the full output is using wheezy.template:

  1. Move the current readme to a template file, like README.rst.wz, maybe in a new templates folder
  2. Add a section like this to the template:
Usage
=====

``pip-compile``
---------------

::
@(
    from subprocess import run
    from textwrap import indent
    pip_compile_usage = run(['pip-compile', '--help'], capture_output=True).stdout.decode()
    pip_compile_usage = indent(pip_compile_usage, '   ')
)
@pip_compile_usage

``pip-sync``
------------

::
@(
    from subprocess import run
    from textwrap import indent
    pip_sync_usage = run(['pip-sync', '--help'], capture_output=True).stdout.decode()
    pip_sync_usage = indent(pip_sync_usage, '   ')
)
@pip_sync_usage
  1. From an environment with wheezy.template and the local pip-tools installed, run wheezy.template templates/README.rst.wz '{}' >README.rst

@jdufresne jdufresne removed their request for review September 27, 2022 12:43
@ssbarnea
Copy link
Member

ssbarnea commented Oct 5, 2022

I am going to close this for the stated reasons. I am not against including output of --help into docs but not on readme, unless the implementation (lint?) will update the readme automatically. I do not want anyone to have to remember that this output needs to updated on each merge.

@ssbarnea ssbarnea closed this Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I would like the output of help to be written in READEME.
6 participants