Skip to content

Upgrade python version to 3.12 and fix linting errors#166

Merged
DrPaulSharp merged 4 commits intomasterfrom
upgrade_python
Oct 23, 2025
Merged

Upgrade python version to 3.12 and fix linting errors#166
DrPaulSharp merged 4 commits intomasterfrom
upgrade_python

Conversation

@DrPaulSharp
Copy link
Contributor

This PR upgrades the minimum version of python to 3.12 to prepare for merging in features of the refactoring project.

It also introduces the full ruff ruleset to the main branch, and fixes the linting errors in the code. These errors were fixed on the refactor_24 branch in PRs: #140, #144, #146, #147, and the pre-commit hook was introduced in #164.

@DrPaulSharp DrPaulSharp requested a review from rprospero October 23, 2025 12:02
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link

@rprospero rprospero left a comment

Choose a reason for hiding this comment

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

Looks good. There was one thing that surprised me, but I'm marking this as approved because I don't know uv well enough to know if it's wrong. Mostly, I'm used to other systems where the lock file is kept under version control so that all devs are sure to be on the exact same version.

Also interesting to see how many strings were still explicitly marked as unicode from the old Python 2 days.

.gitignore Outdated
# INSTALL.md recommends a venv that should not be committed
venv
.venv
uv.lock

Choose a reason for hiding this comment

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

Are we supposed to commit the lock file to keep versions the same for all developers? I'm not that familiar with uv, so this is a genuine question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In general, the uv.lock file should be added to version control. Now that we have the same requirements for the master and refactor_24 branches, and it would likely be useful for developers using uv (who may be at the contributor camp), I think we should go ahead and add it here. Thanks for the prompt!

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@DrPaulSharp DrPaulSharp merged commit d707485 into master Oct 23, 2025
11 checks passed
@DrPaulSharp DrPaulSharp deleted the upgrade_python branch October 23, 2025 14:01
@llimeht
Copy link
Contributor

llimeht commented Oct 24, 2025

There's a flow-on effect to sasview with increasing the minimum version. There should be no issue doing so, but probably makes sense to also raise it in SasView. (Tests already all pass with 3.12 and 3.13 so no issues there; checking that Qt is happy on random platforms is also needed.)

Landing SasView/sasview#3642 first makes sense for sequencing - it's easy to update python versions following that.

@DrPaulSharp
Copy link
Contributor Author

DrPaulSharp commented Oct 24, 2025

I've merged SasView/sasview#3642, and updated to python 3.12 in SasView/sasview#3649

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