Open BlueDrink9 opened 1 month ago
Hi, numpy dependency is tricky, if you can figure out configuration of numpy versions for PyGerber in a way that keeps it running both on 3.8 and 3.12, I'll be happy to accept it. In PyGerber numpy usage is very limited and unless there were changes in core functionality like ndarray mul/add etc. it should be fine. Also, likely Pillow has it's own expectations to numpy version, so it may also be neccessary to apply come constraints on its version.
Right now we have this:
numpy = [
{ version = "^1.24.4", markers = "python_version >= '3.8' and python_version <= '3.11'" },
{ version = "^1.26.1", markers = "python_version >= '3.12' and python_version < '3.13'" },
]
Because you can't use numpy>=1.24
on Python 3.8. I don't know what is a minimal required Python version for numpy 2.x, but we could basically change the ranges to be something like:
numpy = [
{ version = "^1.24", markers = "python_version >= '3.8' and python_version <= '<numpy-2-min-py>'" },
{ version = "<3", markers = "python_version >= '<numpy-2-min-py> and python_version < '3.13'" },
]
So we don't break environments of people running on 1.26
You can still force version of numpy during installation tho, if you just need it once, and see if it works.
Actually, it is possible that changing ^1.26.1
to >=1.26,<3
would do the trick. You could check that :)))
Looking into this, it's not clear that you even need to specify a numpy version. As far as I can tell, all you use it for is creating a basic ndarray for shapely's transform. (That's so basic and common an operation that a numpy change that broke it would probably break almost every numpy project ever written!) I can only see these two uses.
In light off that, I set numpy version specification to just numpy = ">=1.24.4,<3"
and pygerber installed with dependencies without issue. Are you happy to make that change?
Thanks for looking into this. What you found seems reasonable. Could you please open a pull request for that?
Hi,
I have relaxed version requirements for development version of PyGerber 3.0.0a4, right now on main
.
I will be back porting what is possbile for 2.4.x
and 2.3.x
.
Thank you! Sorry for not opening the PR earlier
Hi @BlueDrink9, could you please check if PyGerber 2.4.2 works for you?
PyGerber Bug Report
I need both pygerber and numpy >2 for a project. Is there anything holding pygerber back from numpy v2?
Mandatory checks
Before opening this issue:
To Reproduce
Create a
requirements.txt
containing:pip install -r requirements.txt
This will fail to resolve dependencies because pygerber requires numpy < 2, but build123d has just updated to using numpy >2.
Expected behavior
Successful installation
Additional context
Environment:
Please complete the following information: