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

Pin ruff version to avoid spurious test failures #2053

Merged
merged 3 commits into from
Oct 22, 2024
Merged

Conversation

waxlamp
Copy link
Member

@waxlamp waxlamp commented Oct 18, 2024

Since ruff is fast moving and freely publishes new versions with breaking changes, it behooves us to pin a ruff version so that local dev and CI don't go out of sync with each other, complicating the review process for PRs.

This PR pins ruff to the 0.6.x minor series and adds a version report to each test (to make version numbers easier to determine in the future).

(See commit messages for details.)

waxlamp

This comment was marked as outdated.

This avoids breakeages that can slow things down when the version of
ruff advances and gets picked up by CI, but remains at a "stable"
version in local environments. In this case, local linting/formatting
results can diverge from what happens in CI, which then causes a
scramble to make the versions equal "between dev and prod" (so to
speak).

The version specifier is `~=0.6.2` to keep the version that gets
installed to any from the 0.6.x series that is at least 0.6.2. According
to the ruff docs, patch-level bumps represent bugfixes, when minor-level
bumps are breaking changes (hence the divergence we have observed).

We avoid setting the version in pyproject.toml (using [this
setting](https://docs.astral.sh/ruff/settings/#required-version)) so
that we can put in place a CI step that *does* install the latest
version and shows us any divergences.
Copy link
Member

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

Minor suggestion about invoking ruff, either way this looks good to me.

tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
Co-authored-by: Mike VanDenburgh <[email protected]>
@waxlamp waxlamp merged commit eacbd07 into master Oct 22, 2024
11 checks passed
@waxlamp waxlamp deleted the pin-ruff-version branch October 22, 2024 01:47
@dandibot
Copy link
Member

🚀 PR was released in v0.3.107 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants