Numpy version dependency
Hi,
would it be possible to adjust the poetry dependency jsonschema = "<2.0.0" in pyproject.toml to support Numpy v2 and achieve better compatibility with other packages?
Thanks!
@farioas I would also like to see numpy 2 support for an improved integration with Voxel51 and other tools in the same project.
Any progress on this? This package is getting rather useless if it does not support numpy 2. Are you guys focusing more on paid services?
We going to support numpy 2 in the next releases. The recommended way for LS runs is to use docker and python environments, therefore old numpy versions shouldn't be a problem.
@makseq Thanks for pointing that out, had forgotten, apologies.
Would also love to see that numpy>=2.0.0 is supported!
We are also integrating the sdk in one of our tools, and it would be nice to support >=2.0.0. Thanks!
Any updates when / in which release we can expect this @makseq?
Same here. Would be great to have support for numpy>2
+1 on this please
@makseq I am not sure exactly what you mean by using Label Studio runs via Docker or Python environments - we use Docker in our product and we use Python environments (using pixi which wraps conda and uv) - but this doesn't solve the problem for us, which is that our dependency on the Label Studio SDK to work with our Label Studio server means that our whole app now has to use NumPy 1.x. We could use a separate process and a separate container for our communication with Label Studio and Inter-Process Communication (IPC), but this would significantly over-complicate things for us.
I have opened a Pull Request #436 to upgrade NumPy to 2.0, so unless you have some reason that you know that the Label Studio SDK cannot support NumPy 2.0, (in which case I would be glad to know what and see if I can contribute a fix), I would be happy if you can merge it 🙏
I just changed depency in line 45 pyproject.toml to numpy = ">=2.0.0,<3.0.0"
7 tests failed, but not sure does that have to do with numpy 2
=========================== short test summary info ============================ ERROR tests/test_refresh_token.py::test_refresh_token_auth ERROR tests/test_refresh_token.py::test_initial_request_triggers_token_refresh ERROR tests/test_refresh_token.py::test_expired_token_triggers_refresh ERROR tests/test_refresh_token.py::test_valid_token_skips_refresh ERROR tests/test_refresh_token.py::test_legacy_token_detection ERROR tests/test_refresh_token.py::test_async_legacy_token_detection ERROR tests/test_refresh_token.py::test_async_jwt_refresh_token ========== 166 passed, 201 skipped, 329 warnings, 7 errors in 18.33s ===========
Thank you for the contribution @benglewis ! I'm not sure what's going on with CI on your branch, but it seems to be failing. I made #439 with the intention of debugging, but it seems to work there. I'll see if we can get this working on your branch tomorrow so we can give you credit for your contribution. I also added numpy 2.0 to the test matrix, and it seems to be passing, so I'd expect that there shouldn't be any issues with running the sdk in a numpy 2.0 environment 👍
Would you mind me committing the CI changes to your branch, as well as relaxing the version pin?
@paapu88 I haven't been able to reproduce the test failures you're seeing though, from what I can tell tests are passing with numpy 2.0. I'm curious: how are you running the tests? Those tests were added a month ago, so my suspicion is that your env is slightly out-of date
@pakelley I'd be happy to to apply any required changes to my branch 🙌
From what I can see the tests are failing in CI due to POETRY_VERSION not being defined since the value is defined as a repository variable since GitHub Actions doesn't allow external contributors code changes to access internal variables in workflows from what I understand (I know that it blocks secret access so this isn't surprising). Hopefully if you add changes to my PR, it should it allow access to the variable, but I'm not 100% sure
@pakelley I probably did this (yesterday):
-
cd ~/gitlab/OtherPeople; git clone https://github.com/HumanSignal/label-studio-sdk.git - made one line numpy version change to pyproject.toml
- did set a virtual env by
python -m venv ~/venvs/labelsandsource ~/venvs/labels/bin/activate -
cd ~/gitlab/OtherPeople/label-studio-sdk; pip install -e ".[dev]"; pip install pytest - pytest
@pakelley It looks like the issue was probably that I didn't have the POETRY_VERSION defined in my fork's GitHub Actions variables. I have added that with the same version as here and it now looks like it will work AFAIK (I just opened a PR to main on my fork and it looks like it worked fine). I think that given the large number of comments here and other also affected, it would be nice if we can merge this :)
Hey there, sorry for dropping the ball here, would you mind changing your pin so that we don't exclude numpy 1 users? I'd like to support both and avoid breaking anyone's existing envs.
I figure making the pin something like ">=1.26.4,<3.0.0" should work.
Once that's done I'm happy to approve! Thank you for the contribution and your persistence here 🙂
This is merged, the SDK now (finally) supports numpy 2 🎊
Hi @nic-elia! Could you please email me regarding this issue? [email protected] . Thanks!