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

[docs] Help text for pip install default python doesn't translate well to web #523

Closed
itsayellow opened this issue Oct 17, 2020 · 1 comment · Fixed by #539
Closed

[docs] Help text for pip install default python doesn't translate well to web #523

itsayellow opened this issue Oct 17, 2020 · 1 comment · Fixed by #539

Comments

@itsayellow
Copy link
Contributor

Describe the bug

The help for pipx install currently has a paragraph explaining PIPX_DEFAULT_PYTHON which helpfully tells you what pipx views as your current default python. The problem is when our web docs are generated, this part of the help code generates an unhelpful default python specific to the nox session:

The default python executable used to install a package is
~/work/pipx/pipx/.nox/docs/bin/python and can be overridden by setting the environment
variable `PIPX_DEFAULT_PYTHON`.

Also, another minor improvement would be to get this help text to properly wrap when being viewed from the command (It currently doesn't wrap on the console properly.)

How to reproduce

View our web docs that were generated from pipx code.

Expected behavior

I'm not exactly sure the best fix, but not putting ~/work/pipx/pipx/.nox/docs/bin/python as the default python executable for the web docs.

@uranusjr
Copy link
Member

One solution would be to detect an environment variable during documentation build, e.g. set PIPX__DOC_INSTALL_PYTHON in conf.py and display that if detected.

spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* Set PIPX__DOC_DEFAULT_PYTHON while building docs with nox
* Setting PIPX__DOC_DEFAULT_PYTHON overrides the display of
  DEFAULT_PYTHON in generated documentation. This is used
  to avoid showing the embedded nox python interpreter.

 Fixes pypa#523
spazm pushed a commit to spazm/pipx that referenced this issue Oct 31, 2020
* Set PIPX__DOC_DEFAULT_PYTHON while building docs with nox
* Setting PIPX__DOC_DEFAULT_PYTHON overrides the display of
  DEFAULT_PYTHON in generated documentation. This is used
  to avoid showing the embedded nox python interpreter.

 Fixes pypa#523
@itsayellow itsayellow linked a pull request Nov 1, 2020 that will close this issue
1 task
spazm pushed a commit to spazm/pipx that referenced this issue Nov 1, 2020
* changed case to match the output of argparse doc section headers.
* This is the same shutil command that argparse uses under the hood
  for determining the width for wrapping.
* indent long strings that are already processed by dedent.
* shutil is already installed as a requirement for argparse.
* The env lines end up long (longer than 88) to work correctly for
  wrapping and indenting.

Addresses wrapping issue mentioned in pypa#523:

| Also, another minor improvement would be to get this help text to
| properly wrap when being viewed from the command (It currently
| doesn't wrap on the console properly.)
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 a pull request may close this issue.

2 participants