Skip to content

Test pint versions#76

Open
lewisjared wants to merge 15 commits intomainfrom
pint-versions
Open

Test pint versions#76
lewisjared wants to merge 15 commits intomainfrom
pint-versions

Conversation

@lewisjared
Copy link
Contributor

@lewisjared lewisjared commented Dec 18, 2025

Description

Checks supported pint versions.

Depends on #75, but can separate if desired.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

@lewisjared
Copy link
Contributor Author

Ok after a few CI attempts the matrix of results that pass looks like:

matrix:
  os: [ "ubuntu-latest" ]
  # Testing the highest and lowest supported Python versions
  python-version: [ "3.10", "3.13" ]
  # Test all of the supported pint versions (including the latest)
  pint-version: [
    # The double quotes are needed to avoid parsing issues with the >= and < characters
    "'pint>=0.22,<0.23' 'numpy<2'",
    "'pint>=0.23,<0.24' 'numpy<2'",
    "'pint>=0.24,<0.25'",
    "'pint>=0.25,<0.26'",
    "'pint>=0.25'"
  ]
  exclude:
    # Known incompatibilities
    # Python 3.10 with pint 0.25 and above
    - python-version: "3.10"
      pint-version: "'pint>=0.25,<0.26'"
    - python-version: "3.10"
      pint-version: "'pint>=0.25'"
    # Python 3.13 with pint <0.24
    # Python 3.11 is the lowest version that supports pint 0.22/0.23
    - python-version: "3.13"
      pint-version: "'pint>=0.23,<0.24' 'numpy<2'"
    - python-version: "3.13"
      pint-version: "'pint>=0.22,<0.23' 'numpy<2'"

Going back to v0.22 is probably overkill as it was released 2 1/2 years ago.
If we follow SPEC-0 (which is suggested in #75),
v0.24 would be our minimum supported version (released 2024-06-07).
That should simplify the tests as anything older also requires numpy<2 which is now EoL too.

It should also be noted that using pdm with requires-python = ">=3.10" will block pint 0.25 from being installed as it requires Python 3.11.

@mikapfl @znicholls Any qualms about only testing SPEC-0 compatible deps? This is pretty feature complete so there are old versions people can install and keep working with if they need.

@mikapfl
Copy link
Member

mikapfl commented Dec 18, 2025

No concerns at all about only testing SPEC-0 compatible deps. We might not like it, but SPEC-0 is an established standard, and within scientific python development ecosystem, nobody cares about things which are out of the SPEC-0 support window. People focus on future enhancements above stability. We shouldn't swim against the tide but go with the flow.

@znichollscr
Copy link
Contributor

No concerns at all about only testing SPEC-0 compatible deps for me too, Mika makes good points.

In the latest copier template, there is quite some work done to add better support for checking min and max supported versions of other things. What you've done here is more thorough for Pint though, so maybe a better solution for a package like this which is such a thin wrapper (effectively).

@znichollscr
Copy link
Contributor

Copier template dependency pinning and testing stuff: https://gcages.readthedocs.io/en/latest/further-background/dependency-pinning-and-testing/

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