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

Always pass config.option to workers #799

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/xdist/remote.py
Expand Up @@ -249,15 +249,15 @@ def remote_initconfig(option_dict, args):
return Config.fromdictargs(option_dict, args)


def setup_config(config, basetemp):
def setup_config(config):
config.option.loadgroup = config.getvalue("dist") == "loadgroup"
config.option.looponfail = False
config.option.usepdb = False
config.option.dist = "no"
config.option.distload = False
config.option.numprocesses = None
config.option.maxprocesses = None
config.option.basetemp = basetemp



if __name__ == "__channelexec__":
Expand All @@ -279,11 +279,12 @@ def setup_config(config, basetemp):

if hasattr(Config, "InvocationParams"):
config = _prepareconfig(args, None)
config.option.__dict__.update(option_dict)
else:
config = remote_initconfig(option_dict, args)
config.args = args

setup_config(config, option_dict.get("basetemp"))
setup_config(config)
config._parser.prog = os.path.basename(workerinput["mainargv"][0])
config.workerinput = workerinput # type: ignore[attr-defined]
config.workeroutput = {} # type: ignore[attr-defined]
Expand Down
3 changes: 1 addition & 2 deletions src/xdist/workermanage.py
Expand Up @@ -246,12 +246,11 @@ def setup(self):
spec = self.gateway.spec
if hasattr(self.config, "invocation_params"):
args = [str(x) for x in self.config.invocation_params.args or ()]
option_dict = {}
else:
args = self.config.args
option_dict = vars(self.config.option)
if not spec.popen or spec.chdir:
args = make_reltoroot(self.nodemanager.roots, args)
option_dict = vars(self.config.option)
if spec.popen:
name = "popen-%s" % self.gateway.id
if hasattr(self.config, "_tmp_path_factory"):
Expand Down