Skip to content

Numpy 2.0 support #58

Closed
Closed

Description

@CoolCat467

Trying to use this project as a dependency, having numpy as a dependency myself I get an error that this project does not support numpy 2.0.0.
I would be happy to help with that, but thought I'd make an issue first.

Activity

  1. fillipe-gsm commented on Jul 12, 2024

    @fillipe-gsm
    Owner

    Hey, @CoolCat467, sorry for the late reply, but thanks for the effort on updating Numpy!

    Despite all tests passing and the project not relying too heavily on Numpy, it is still a major change on a dependency. So, for safety, I would like to publish this to a semi-major 0.5.0.

    This means that if you have python-tsp as dependency you would probably need to manually update it to 0.5.0 in your requirements.txt or pyproject.toml files (at least poetry I believe would not update it automatically with a poetry update).

    If you're okay with this, I'll publish the new version.

  2. CoolCat467 commented on Jul 12, 2024

    @CoolCat467
    ContributorAuthor

    Yea sure thing, 0.5.0 makes sense, numpy major release is definitely a higher version bump.

  3. fillipe-gsm commented on Jul 13, 2024

    @fillipe-gsm
    Owner

    Great, I uploaded the library to version 0.5.0 and updated the README accordingly.

    Thank you for the contribution!

  4. AlexDuchnowski commented on Nov 12, 2024

    @AlexDuchnowski

    It seems that the package now not only supports numpy>=2.0.0 but in fact requires that the numpy version be at least 2.0.0. The following line is part of the output I get after running pip install python-tsp and then pip install numpy==1.26.4:

    python-tsp 0.5.0 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.4 which is incompatible.

    I'd love to use this library, but I have dependencies that require numpy<2. @fillipe-gsm, is python-tsp now incompatible with earlier versions of numpy?

  5. fillipe-gsm commented on Nov 12, 2024

    @fillipe-gsm
    Owner

    Hey, @AlexDuchnowski, I'll take a look if it is possible to allow numpy < 2.0.0 and >= 2.0.0 to co-exist.
    In the meanwhile, you most likely can install version 0.4.2 instead:

    pip install python-tsp==0.4.2

    The only difference is the numpy version, so you would get the same features but this version is compatible with numpy <= 2.0.0.

  6. CoolCat467 commented on Nov 12, 2024

    @CoolCat467
    ContributorAuthor

    It seems that the package now not only supports numpy>=2.0.0 but in fact requires that the numpy version be at least 2.0.0. The following line is part of the output I get after running pip install python-tsp and then pip install numpy==1.26.4:

    python-tsp 0.5.0 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.4 which is incompatible.

    I'd love to use this library, but I have dependencies that require numpy<2. @fillipe-gsm, is python-tsp now incompatible with earlier versions of numpy?

    What packages require numpy<2? Might be worth trying to go to those projects to add support for numpy 2.0.0 as well.

  7. AlexDuchnowski commented on Nov 18, 2024

    @AlexDuchnowski

    @fillipe-gsm Sweet, thanks! (Also, thanks for the super quick response! I feel guilty for taking this long to respond after you answered my question almost instantly.)
    @CoolCat467 Good point. I looked into it, and it seems I just had a few packages I hadn't updated in a little while, and so I can actually upgrade to numpy 2. Even so, I think it would be good to allow for backward compatibility if this package can still be used with earlier numpy versions. Anyway, thanks for encouraging me to check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions