Skip to content

Python interpreter still queried even with --skip-interpreter-query #3708

Closed

Description

@dillydill123

Describe the Bug

$ pip show pyrefly
Name: pyrefly
Version: 1.0.0

Simple project with an empty pyrefly.toml config.

$ tree .
.
├── example.py
├── pyrefly.toml

example.py, file contents does not matter.

x: int = "5"

Running the following, I can still see my python3 being queried for version:

strace -s 100 -f -e execve -o trace_skip_query.log pyrefly check --skip-interpreter-query --python-platform linux --python-version 3.14.2 .
...
6873  execve("/home/dillon/.pyenv/versions/pyrefly/bin/pyrefly", ["/home/dillon/.pyenv/versions/pyrefly/bin/pyrefly", "check", "--skip-interpreter-query", "--python-platform", "linux", "--python-version", "3.14.2", "."], 0x5ea69def9cc0 /* 49 vars */) = 0
6934  execve("/home/dillon/.pyenv/versions/pyrefly/bin/python3", ["/home/dillon/.pyenv/versions/pyrefly/bin/python3", "--version"], 0x7ffc8019e0c0 /* 49 vars */) = 0
6934  +++ exited with 0 +++
6873  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6934, si_uid=1001, si_status=0, si_utime=0, si_stime=0} ---
6935  execve("/home/dillon/.pyenv/versions/pyrefly/bin/python3", ["/home/dillon/.pyenv/versions/pyrefly/bin/python3", "-c", "import json, sys, sysconfig\nplatform = sys.platform\nv = sys.version_info\nversion = '{}.{}.{}'.format"...], 0x7ffc8019e0c0 /* 49 vars */) = 0
6935  +++ exited with 0 +++

I would not expect python3 to be invoked when providing --skip-interpreter-query --python-platform linux --python-version 3.14.2. I tried with the config pyrefly.toml: as well

skip-interpreter-query = true
python-platform = "linux"
python-version = "3.14.2"

strace -s 100 -f -e execve -o trace_skip_config_dump.log pyrefly dump-config to dump the config looks correct and did not query my python3 interpreter:

$ strace -s 100 -f -e execve -o trace_skip_config_dump.log pyrefly dump-config 
 INFO Checking project configured at `/home/dillon/sbx/demos/pyrefly/pyrefly.toml`
Configuration at `/home/dillon/sbx/demos/pyrefly/pyrefly.toml`
  Using interpreter: <interpreter query skipped>
  Covered files:
    /home/dillon/sbx/demos/pyrefly/example.py
  Resolving imports from:
    Import root (inferred from project layout): "/home/dillon/sbx/demos/pyrefly"

No python3 call from what I could find from strace.

The documentation says this parameter will skip querying the python interpreter. So it looks like a bug.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions