Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken action for main with last numpy version #30

Closed
CarlottaSartore opened this issue Dec 23, 2022 · 3 comments · Fixed by #33
Closed

Broken action for main with last numpy version #30

CarlottaSartore opened this issue Dec 23, 2022 · 3 comments · Fixed by #33

Comments

@CarlottaSartore
Copy link
Contributor

CarlottaSartore commented Dec 23, 2022

Numpy has been recently updated to 1.24 (see https://pypi.org/project/numpy/#history) and this causes the action not to run successfully for the main branch (see https://github.com/CarlottaSartore/urdf-modifiers/actions/runs/3764865764/jobs/6399746107).

This is something analogous to ami-iit/adam#32

C.C. @Nicogene @mfussi66

@Nicogene
Copy link
Member

Nicogene commented Dec 23, 2022

It seems that one dependency is not compatible with the latest numpy, I am afraid we cannot fix it on our code side, but require a specific version of numpy like you did here ami-iit/adam#33

cc @traversaro

@traversaro
Copy link
Member

traversaro commented Dec 23, 2022

On conda I am able to run the tests without problem with NumPy 1.24:

mamba create -n urdfmodifiers numpy=1.24 urdfpy idyntree pip wheel
mamba activate urdfmodifiers
git clone https://github.com/icub-tech-iit/urdf-modifiers
cd urdf-modifiers
pip install --no-deps .
(urdfmodifiers) traversaro@IITICUBLAP257:~/urdf-modifiers$ python tests/tests.py
..............................................
----------------------------------------------------------------------
Ran 46 tests in 0.072s

OK

Apparently, the only thing that is creating problem is the pin of the urdfpy dependency on specific version of networkx and pycollada. This pin apparently is not useful, and that is the reason why on conda-forge we removed it, see conda-forge/urdfpy-feedstock#3 .

A similar PR was proposed upstream, but apparently no one is replying to the proposed PRs:

This is one of the main reason I am not a fan of PyPI in general, if a project is not mantained anymore it is not simple to get control of it to fix symple this. In the short term, I would just document the numpy<1.24 constraint in the pip install . documentation, to avoid that it creates problem in distributions where urdfpy does not have the networkx constraints.

Instead, in the long term if we want to continue support the pip install . workflow with recent numpy versions, I see two main options:

  • A: Migrate from urdfpy to some other mantained library, such as yourdfpy, hoping that the API is similar enough
  • B: Friendly-fork urdfpy, change its name, push this new library fork-of-urdfpy (tentative name) to PyPI and switch this library to use fork-of-urdfpy (tentative name) instead of urdfpy. In this case, probably we can also ask if other people that are submitting PRs to urdfpy are interested in co-mantaining fork-of-urdfpy, to reduce the mantainance burden.

@traversaro
Copy link
Member

For reference, the error to which @CarlottaSartore was referring is:

Traceback (most recent call last):
  File "tests/tests.py", line 3, in <module>
    from urdfModifiers.core.modification import Modification
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/urdfModifiers/__init__.py", line 5, in <module>
    from . import core
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/urdfModifiers/core/__init__.py", line 7, in <module>
    from . import linkModifier
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/urdfModifiers/core/linkModifier.py", line 2, in <module>
    from urdfpy import xyz_rpy_to_matrix, matrix_to_xyz_rpy
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/urdfpy/__init__.py", line 1, in <module>
    from .urdf import (URDFType,
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/urdfpy/urdf.py", line 7, in <module>
    import networkx as nx
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/networkx/__init__.py", line 117, in <module>
    import networkx.readwrite
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/networkx/readwrite/__init__.py", line 15, in <module>
    from networkx.readwrite.graphml import *
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/networkx/readwrite/graphml.py", line 314, in <module>
    class GraphML(object):
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/networkx/readwrite/graphml.py", line 346, in GraphML
    (np.int, "int"), (np.int8, "int"),
  File "/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'int'

(it is always good to copy the error in the issue, as GitHub Actions logs disappear after some time, and putting the error in the issue make it more simple for people find this error to find related issues)

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 a pull request may close this issue.

3 participants