From 8ade7d22f23db3758f4a2eb11d73e1cb923fef00 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 30 Jun 2020 09:22:23 +0200 Subject: Use Pygments from virtualenv's path in asciidoc2html This allows running mkvenv.py without having Pygments installed system-wide. Prepending to the PATH (rather than appending) so that the virtualenv's one is always used, so the system-wide one can be older or broken. (cherry picked from commit 362d9d917ba0c796c2c8f9813e66634cae54b422) --- scripts/asciidoc2html.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 03ad8300c..e337c54db 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -251,9 +251,14 @@ class AsciiDoc: cmdline += ['--out-file', str(dst)] cmdline += args cmdline.append(str(src)) + + # So the virtualenv's Pygments is found + bin_path = pathlib.Path(sys.executable).parent + try: env = os.environ.copy() env['HOME'] = str(self._homedir) + env['PATH'] = str(bin_path) + os.pathsep + env['PATH'] subprocess.run(cmdline, check=True, env=env) except (subprocess.CalledProcessError, OSError) as e: self._failed = True -- cgit v1.2.3-54-g00ecf