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

tests: enable cache for pytest-ruff >= 0.3.0 #482

Merged
merged 4 commits into from Mar 12, 2024
Merged

Conversation

davvid
Copy link
Member

@davvid davvid commented Mar 12, 2024

Newer versions of pytest-ruff require a cache provider.
Remove the no:cacheprovider flags to get pytest-ruff working again.

ruff had a change in behavior that is not currently playing nice
with pytest-ruff. Pin down to 0.2.x for now.
@davvid
Copy link
Member Author

davvid commented Mar 12, 2024

I'm going to take another look. I think the real error is that we're disabling pytest's cache provider, and that's causing pytest-ruff to fail because the newer versions rely on being able to store and retrieve items from the cache.

I'll update this PR shortly after I make the same change over in https://github.com/git-cola/git-cola/

@davvid davvid changed the title setup.cfg: pin down pytest-ruff to avoid test failures tests: enable cache for pytest-ruff >= 0.3.0 Mar 12, 2024
Copy link
Contributor

@Theelx Theelx left a comment

Choose a reason for hiding this comment

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

The only thing that really should be fixed is the lack of a PR link in CHANGES.rst, but otherwise looks basically good to merge!

setup.cfg Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
tox.ini Show resolved Hide resolved
Newer versions of pytest-ruff require a cache provider.
Remove the no:cacheprovider flags to get pytest-ruff working again.
Narrow the pytest discovery to just the jsonpickle and tests directories.
This speeds up pytest because it spends less time walking the directory
structure looking for non-existent tests.
@davvid davvid requested a review from Theelx March 12, 2024 19:14
Copy link
Contributor

@Theelx Theelx left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for the detailed answer about not using a cache provider!

@Theelx Theelx merged commit df33469 into jsonpickle:main Mar 12, 2024
5 checks passed
@davvid davvid deleted the ruff branch March 14, 2024 02:28
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.

None yet

2 participants