File: generate-docs-without-virtualenv

package info (click to toggle)
python-pipx 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,216 kB
  • sloc: python: 7,204; makefile: 17; sh: 13
file content (35 lines) | stat: -rw-r--r-- 947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Stefano Rivera <stefanor@debian.org>
Date: Wed, 29 Sep 2021 20:42:49 -0700
Subject: docs: Allow generate_docs to run without an installed pipx

Forwarded: https://github.com/pypa/pipx/pull/745
---
 scripts/generate_docs.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py
index 26266c9..c1dcc10 100644
--- a/scripts/generate_docs.py
+++ b/scripts/generate_docs.py
@@ -3,6 +3,7 @@
 
 import os
 import subprocess
+import sys
 import textwrap
 from typing import Optional
 
@@ -12,10 +13,10 @@ from pipx.main import __version__
 
 
 def get_help(pipxcmd: Optional[str]) -> str:
+    cmd = [sys.executable, "-m", "pipx"]
     if pipxcmd:
-        cmd = ["pipx", pipxcmd, "--help"]
-    else:
-        cmd = ["pipx", "--help"]
+        cmd.append(pipxcmd)
+    cmd.append("--help")
 
     helptext = (
         subprocess.run(cmd, stdout=subprocess.PIPE, check=True)