Skip to content

build(tox): give each linter its own envdir and bound the unpinned tools - #1326

Open
ryanhill1 wants to merge 1 commit into
mainfrom
fix/tox-linter-env-isolation
Open

build(tox): give each linter its own envdir and bound the unpinned tools#1326
ryanhill1 wants to merge 1 commit into
mainfrom
fix/tox-linter-env-isolation

Conversation

@ryanhill1

Copy link
Copy Markdown
Member

All six linter envs shared envdir = .tox/linters while declaring different deps. tox keys an envdir to the dep set that built it, so switching stages tears the directory down and rebuilds it.

Two consequences

Stages reinstall each other. Measured, running headers after pylint:

setup time
shared envdir (before) 4.28 s
own envdir (after) 0.05 s

Each tool's inputs depend on the entry point. tox -e pylint installs pylint alone, so pylint cannot import qbraid_core and never infers types from it. The pylint stage inside tox -e format-check runs with qbraid_core present, pulled in by the qbraid-cli that headers needs:

after tox -e pylint         ->  qbraid_core in env: absent
after tox -e format-check   ->  qbraid_core in env: present

Same pylint qbraid bin tests, two different dependency sets. A reused .tox/linters carries whichever set landed there last, which is enough for a local run to disagree with CI, since CI always builds the directory fresh. I hit exactly that: a local format-check reporting four E1101: ... has no 'status_code' member errors that do not reproduce on a clean env or in CI.

Also: bound the unpinned tools

pylint, isort and mypy were unpinned. black and ruff already carry upper bounds with comments naming the incidents that put them there, most recently ruff 0.16.0 changing default rules and surfacing ~742 pre-existing issues repo-wide (#1296). An unpinned linter changes what CI enforces without a commit, so all five are bounded now.

Resolved versions today are pylint 4.0.7, isort 8.0.1, mypy 2.3.0, all inside the new bounds, so this pins the status quo rather than moving anything.

Trade-off

Six small tool envs instead of one shared directory, so more disk locally. CI is unaffected on cold install since it starts empty either way, and warm local runs get faster because switching stages no longer reinstalls.

Verification

tox -e format-check from a cold .tox: 10.00/10, all five stages pass. The headers -> pylint -> headers sequence reuses both envs instead of rebuilding.

All six linter envs shared envdir = .tox/linters while declaring different deps.
tox keys an envdir to the dep set that built it, so every switch between stages
tore the directory down and rebuilt it: after running pylint, a re-run of headers
spends 4.28s reinstalling where an isolated env spends 0.05s.

The sharing also decides what each tool can see. `tox -e pylint` installs pylint
alone, so pylint cannot import qbraid_core and never infers types from it. The
pylint stage inside `tox -e format-check` runs with qbraid_core present, pulled in
by the qbraid-cli that headers needs. Same command, two different inputs depending
on which entry point you use, and a reused .tox/linters carries whichever set
happened to land there last. That is enough for a local run to disagree with CI,
which always builds the directory fresh.

pylint, isort and mypy were unpinned while black and ruff carry upper bounds with
comments explaining the incidents that put them there. An unpinned linter changes
what CI enforces without a commit, so all five are bounded now. Current resolved
versions are pylint 4.0.7, isort 8.0.1 and mypy 2.3.0, all inside the new bounds.

Cost is disk: six small tool envs instead of one shared. Cold install is unchanged
in CI, which starts empty either way, and warm local runs get faster because
switching stages no longer reinstalls.

format-check: 10.00/10 from a cold .tox.
@argus-eye

argus-eye Bot commented Aug 12, 2026

Copy link
Copy Markdown

Argus review

Auto-review is off for this repo. Tick the box below to run a review on this PR.

  • Trigger Argus review

Estimated cost

  • Files changed: 1
  • Diff lines (±): 20
  • Historical avg: ~350.2k tokens · ~$1.24 · across last 5 review(s)

Tip: you can also comment @argus-eye review at any time.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5519938b-c7fa-484e-a8b5-6f3d411a2be6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey there! It looks like the changelog might need an update.

Please take a moment to edit the CHANGELOG.md with:

  • A brief, one-to-two sentence summary of your changes.
  • A link back to this PR for reference.
  • (Optional) A small working example if you've added new features.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant