Skip to content

Conversation

DCHartlen
Copy link
Contributor

This pull request bumps the version dependencies for Python and Numpy, as noted in issue #86. Numpy 1.26 is reaching its end of life in September 2025. Updating to a more recent version of Numpy 2.* requires bumping the minimum supported version of Python as well.

Changes in this PR specify a minimum NumPy version of 2.2, with 2.3 being the most recent stable version at the time of writing. To accompany this, the minimum Python version was bumped to 3.11.

Updating beyond Python 3.10 raised two new Ruff linting rules. A new method for typing unions was introduced in 3.10, with Ruff rule UP007 recommending nearly 100 changes to existing typing rules. I chose to ignore this rule, as the current method of typing, while perhaps a bit less elegant, is not being deprecated anytime soon. The other change was around 3.11, where a strict parameter was introduced for zip(). Following Ruff rule B905, I made a series of updates to the code to add strict=false to all zip() calls, which was the default behaviour. Not changes in functionality were observed.

DCHartlen and others added 5 commits August 26, 2025 20:36
Python 3.11 is the minimum version supported by NumPy 2.3. Additionally, removed .python-version, which pins the development version of Python to 3.9.
From personal experience, there was a not-insignificant depreciation between 2.1 and 2.2 that caught me out before related to indexing arrays. Skipping to 2.2 avoids this deprecation.
UP007 is related to a change in typing detailed in PEP604. Typing Unions can now be written as `X | Y` instead of `Union[int, str]`. There is no deprecation for this feature, and a significant amount of legacy code needs to be updated.
Adds `strict=False` to all `zip()` calls to fix Ruff linter Rule B905 (https://docs.astral.sh/ruff/rules/zip-without-explicit-strict/). `strict=False` maintains current behaviour while fixing the linter error. 

There is no impact on unit tests with this change.
Copy link
Contributor

@codie3611 codie3611 left a comment

Choose a reason for hiding this comment

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

Good job!

@codie3611 codie3611 merged commit 7aa82fd into open-lasso-python:develop Aug 30, 2025
5 checks passed
@DCHartlen DCHartlen deleted the refact/86-UpdateDepends branch August 31, 2025 18:13
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