chaoss / grimoirelab-elk

GNU General Public License v3.0
59 stars 120 forks source link

ELK (p2o.py) - broken dependencies - error #907

Closed lukaszgryglicki closed 11 months ago

lukaszgryglicki commented 4 years ago

Built grimoire docker image using this, this and that (even with that line commented out, so all repos use their base branches) and p2o.py command fails due to dependencies error:

root@d0b323e76d21:/# p2o.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (grimoire-elk 0.63.0 (/usr/local/lib/python3.5/dist-packages), Requirement.parse('grimoire-elk==0.75.0'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/p2o.py", line 4, in <module>
    __import__('pkg_resources').require('grimoire-elk==0.75.0')
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3260, in <module>
    @_call_aside
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3244, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3273, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'geopy>=2.0.0' distribution was not found and is required by grimoire-elk
root@d0b323e76d21:/# 
lukaszgryglicki commented 4 years ago

I remember that we talked about similar errors many times in the past. The agreed solution was to add test coverage that checks dependencies on some CI system when pushing/committing/merging - so such a situation would not happen anymore. I suspect that various parts of the system need a different version of geopy.

lukaszgryglicki commented 4 years ago

During the setup process we see:

Attempting uninstall: geopy
    Found existing installation: geopy 2.0.0
    Uninstalling geopy-2.0.0:
      Successfully uninstalled geopy-2.0.0
  Running setup.py develop for grimoireelk
Successfully installed GitPython-3.1.3 MarkupSafe-1.1.1 PyMySQL-0.9.3 astroid-2.4.2 bandit-1.6.2 cereslib-0.1.14 cheroot-8.3.0 cherrypy-18.6.0 click-7.1.2 decorator-4.4.2 elasticsearch-6.3.1 elasticsearch-dsl-6.3.1 flake8-3.8.3 geopy-1.23.0 gitdb-4.0.5 graal-0.2.9 grimoire-elk-0.63.0 grimoireelk idna-2.8 importlib-metadata-1.7.0 importlib-resources-3.0.0 isort-4.3.21 jaraco.classes-2.0 jaraco.collections-2.1 jaraco.functools-2.0 jaraco.text-3.2.0 jinja2-2.11.1 kingarthur-0.1.18 lazy-object-proxy-1.4.3 lizard-1.16.6 mccabe-0.6.1 more-itertools-8.4.0 networkx-2.4 numpy-1.18.5 pandas-0.25.3 patsy-0.5.1 pbr-5.4.5 perceval-finos-0.1.9 perceval-mozilla-0.2.12 perceval-opnfv-0.1.19 perceval-puppet-0.1.18 portend-2.6 pycodestyle-2.6.0 pydot-1.4.1 pyflakes-2.2.0 pylint-2.5.3 pyparsing-2.4.7 pytz-2020.1 pyyaml-5.3.1 redis-2.10.6 requests-2.21.0 rq-1.0 scipy-1.4.1 smmap-3.0.4 sortinghat-0.7.14 sqlalchemy-1.3.18 statsmodels-0.9.0 stevedore-1.32.0 tempora-1.14.1 toml-0.10.1 typed-ast-1.4.1 urllib3-1.24.3 wrapt-1.12.1 zc.lockfile-2.0 zipp-1.2.0

cc @obaroikoh @valeriocos

valeriocos commented 4 years ago

Hi @lukaszgryglicki , the change was needed since the tests in Travis were failing: https://travis-ci.org/github/chaoss/grimoirelab-elk/jobs/703100538 (see geopy version here)

The PR https://github.com/chaoss/grimoirelab-elk/pull/904 changed the geopy version to 2.0.0.

If this helps you, you can submit a PR to ELK to pin the geopy version to 1.20.0

lukaszgryglicki commented 4 years ago

We needed to fix locally, I may create a PR tomorrow or later. So the decision was to break a working command to fix tests right :p? Not quite get it.

obaroikoh commented 4 years ago

Hi @valeriocos, setting the version number to 2.0.0 in pyproject.toml fixed it for me locally. I can push a PR if you need me to.

valeriocos commented 4 years ago

Hi @obaroikoh , yes perfect, thanks

jjmerchante commented 11 months ago

Closing as fixed.