Skip to content

Commit

Permalink
lsp: Passthrough selected envvars to sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Jul 13, 2023
1 parent 656e84a commit 93f6cf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/esbonio/esbonio/server/features/sphinx_manager/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import asyncio
import json
import logging
import os
import sys
import typing
from typing import Any
from typing import Dict
from typing import Optional

import pygls.uris as Uri
from pygls import IS_WIN
from pygls.client import Client
from pygls.protocol import JsonRPCProtocol

Expand Down Expand Up @@ -112,7 +115,7 @@ async def start(self, config: SphinxConfig):
command.extend([sys.executable, "-m", "lsp_devtools", "agent", "--"])

command.extend([*config.python_command, "-m", "sphinx_agent"])
env = {"PYTHONPATH": ":".join([str(p) for p in config.python_path])}
env = get_sphinx_env(config)

self.logger.debug("Sphinx agent env: %s", json.dumps(env, indent=2))
self.logger.debug("Starting sphinx agent: %s", " ".join(command))
Expand Down
3 changes: 3 additions & 0 deletions lib/esbonio/esbonio/server/features/sphinx_manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class SphinxConfig:
build_command: List[str] = attrs.field(factory=list)
"""The sphinx-build command to use."""

env_passthrough: List[str] = attrs.field(factory=list)
"""List of environment variables to pass through to the Sphinx subprocess"""

cwd: str = attrs.field(default="")
"""The working directory to use."""

Expand Down

0 comments on commit 93f6cf8

Please sign in to comment.