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

Linting update #1131

Merged
merged 9 commits into from
Mar 23, 2023
Merged

Linting update #1131

merged 9 commits into from
Mar 23, 2023

Conversation

ADBond
Copy link
Contributor

@ADBond ADBond commented Mar 20, 2023

Add explicit stacklevel kwarg for warnings.warn() as per latest ruff release (v0.0.257) - see notes and in particular this change.

As a slight side-point, I wonder if it is worth pinning a ruff version in our CI if there are going to be frequent breaking changes like this, and occasionally bumping version and doing a bigger linting update? or does anyone think it's preferable to just make frequent small updates like this (or adding exclusion rules if appropriate)?

edit:
from discussion I have now pinned versions of ruff and black in pyproject.toml, and workflows install from this, to synchronise versions between CI and local dev.

Additionally I have split dev dependencies into some meaningful groups - the only practical difference is now that the benchmarking dependencies are opt-in, and not installed by default. In CI I have separated virtual environments for linting, testing, and benchmarking - any updates to poetry.lock will update them all, regardless of whether the change is relevant, owing to limitations with how poetry handles dependency groups. I figure that this happens fairly rarely, and so will probably not have a large impact on speed in most cases.

@ADBond ADBond requested a review from RossKen March 20, 2023 16:29
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2023

Test: test_2_rounds_1k_duckdb

Percentage change: -12.1%

date time stats_mean stats_min commit_info_branch commit_info_id machine_info_cpu_brand_raw machine_info_cpu_hz_actual_friendly commit_hash
849 2022-07-12 18:40:05 1.89098 1.87463 splink3 c334bb9 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz 2.7934 GHz c334bb9
1491 2023-03-22 13:24:17 1.65128 1.64689 (detached head) a485e54 Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz 2.0952 GHz a485e54

Test: test_2_rounds_1k_sqlite

Percentage change: -3.4%

date time stats_mean stats_min commit_info_branch commit_info_id machine_info_cpu_brand_raw machine_info_cpu_hz_actual_friendly commit_hash
851 2022-07-12 18:40:05 4.32179 4.25898 splink3 c334bb9 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz 2.7934 GHz c334bb9
1493 2023-03-22 13:24:17 4.11517 4.11451 (detached head) a485e54 Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz 2.0952 GHz a485e54

Click here for vega lite time series charts

@NickCrews
Copy link
Contributor

My understanding is that it is considered best practice to pin versions for development and CI, and ideally these two versions are also the same.

You already use poetry, so I'd install from the lockfile in CI. IF installing all of the dev deps are too slow for the linting task (but I'd guess this would be fast), then you could split the dev deps into test, docs, lint, etc groups and then only install the lint group

Copy link
Contributor

@RossKen RossKen left a comment

Choose a reason for hiding this comment

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

@ADBond I'm approving this as is, but also happy if you think we should do something similar to @NickCrews's suggestion on this branch and re-review later.

@ADBond
Copy link
Contributor Author

ADBond commented Mar 21, 2023

@NickCrews thanks for suggestion - think timings should be reasonable as we can cache the dependencies, so should only be slow once. Had been wondering about sorting out some dev groups for a bit for e.g. building docs, so may see about adding that in.

@RossKen cheers for that - as this is pretty thin as-is and not super pressing I might implement the above and pin the linter version in this PR to avoid similar issues.

@ADBond ADBond requested a review from RossKen March 22, 2023 14:12
@ADBond
Copy link
Contributor Author

ADBond commented Mar 22, 2023

@RossKen I have updated this PR now - have outlined the additional changes as in edit to initial comment on this PR ☝️ for visibility. Let me know if you have any thoughts/suggestions

Copy link
Contributor

@RossKen RossKen left a comment

Choose a reason for hiding this comment

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

Looks sensible from my side, and tests run pretty quickly too so happy to merge 👍

@ADBond ADBond merged commit b68ffd3 into master Mar 23, 2023
@ADBond ADBond deleted the linting-fixes branch March 23, 2023 09:15
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.

3 participants