Skip to content

Use mypy and ruff from pixi environment#3124

Open
bouweandela wants to merge 13 commits into
mainfrom
use-mypy-from-pixi
Open

Use mypy and ruff from pixi environment#3124
bouweandela wants to merge 13 commits into
mainfrom
use-mypy-from-pixi

Conversation

@bouweandela

@bouweandela bouweandela commented Jun 22, 2026

Copy link
Copy Markdown
Member

Description

Use mypy and ruff from the pixi environment instead of installing them with pre-commit.

Pros

  • More accurate mypy checks because all dependencies are installed
  • Manage only one environment (pixi) instead of two (pixi and pre-commit)
  • No unexpected test breaking because pre-commit does not use lock files for its environments as in Tests failing - github actions pre-commit, mypy - error: "TypeAliasType" not callable #3117
  • mypy and ruff can be used without pre-commit. Useful if you want to run these tools with additional options, e.g. ruff check --fix --unsafe-fixes

Cons

  • Does not work with pre-commit.ci

We could decide to move away from pre-commit.ci and instead just run the pre-commit hooks on CircleCI as part of the test suite. That would also have the advantage that it has one less CI service, so easier to understand for new contributors.

Link to documentation: https://esmvaltool--3124.org.readthedocs.build/projects/ESMValCore/en/3124/contributing.html#code-quality


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.27%. Comparing base (9957f44) to head (919689f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3124   +/-   ##
=======================================
  Coverage   96.26%   96.27%           
=======================================
  Files         280      280           
  Lines       16258    16258           
=======================================
+ Hits        15651    15652    +1     
+ Misses        607      606    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@valeriupredoi valeriupredoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks bud - a very welcome approach indeed! Approving preemptively (don't pull a Klaus on me since I approve drafts 😆 ) since I'll be away most next week

@bouweandela bouweandela changed the title Use mypy from pixi environment Use mypy and ruff from pixi environment Jul 16, 2026
@bouweandela
bouweandela marked this pull request as ready for review July 16, 2026 14:48
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.

2 participants