python-bonobo / bonobo

Extract Transform Load for Python 3.5+
https://www.bonobo-project.org/
Apache License 2.0
1.58k stars 143 forks source link

incompatibility with pip==20.x #385

Open gkennos opened 3 years ago

gkennos commented 3 years ago

bonobo = 0.6.4 python = 3.8.5 pip = 20.2.2

Issue:

>> bonobo init --package pipelines

INFO:0000:root: name = pipelines
Description: test pipelines
License [Apache License, Version 2.0]:
INFO:0007:root: ∙ W! Projectfile (594 bytes)
INFO:0007:root: Updating pipelines with git, make, python features
INFO:0007:root: > dispatch ⚡ medikit.on_start (ProjectEvent)
INFO:0007:root:   ∙ git Creating git repository...
INFO:0007:root:   > dispatch ⚡ medikit.feature.python.on_generate (ProjectEvent)
INFO:0007:root:   < dispatched medikit.feature.python.on_generate
INFO:0007:root:   ∙ W? classifiers.txt (0 bytes)
INFO:0007:root:   ∙ W? README.rst (0 bytes)
INFO:0007:root:   ∙ W? MANIFEST.in (14 bytes)
INFO:0007:root:   ∙ W? pipelines/__init__.py (1 bytes)
INFO:0007:root:   ∙ W? pipelines/_version.py (22 bytes)
INFO:0007:root:   ∙ W! setup.py (1637 bytes)
INFO:0007:root:   > dispatch ⚡ medikit.feature.make.on_generate (MakefileEvent)
INFO:0007:root:   < dispatched medikit.feature.make.on_generate
INFO:0007:root:   ∙ W! Makefile (3289 bytes)
INFO:0007:root: < dispatched medikit.on_start
INFO:0007:root: > dispatch ⚡ medikit.on_end (ProjectEvent)
CRIT:0007:root: Uncaught exception (in thread 4470980032).
│ Traceback (most recent call last):
│   File "/Users/redacted/ETL/.env/bin/bonobo", line 8, in <module>
│     sys.exit(entrypoint())
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/bonobo/commands/__init__.py", line 63, in entrypoint
│     command(**parsed_args)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/bonobo/commands/init.py", line 72, in handle
│     self.create_package(filename=filename)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/bonobo/commands/init.py", line 48, in create_package
│     medikit.commands.handle_init(
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/medikit/commands/init.py", line 51, in handle
│     return UpdateCommand.handle(config_filename)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/medikit/commands/update.py", line 73, in handle
│     dispatcher.dispatch(medikit.on_end, event)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/medikit/events.py", line 47, in dispatch
│     event = super(LoggingDispatcher, self).dispatch(event_id, event)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/whistle/dispatcher.py", line 27, in dispatch
│     self.do_dispatch(self.get_listeners(event_id), event)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/whistle/dispatcher.py", line 99, in do_dispatch
│     listener(event)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/medikit/feature/python.py", line 482, in on_end
│     for req in resolver.resolve(max_rounds=10)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/resolver.py", line 164, in resolve
│     has_changed, best_matches = self._resolve_one_round()
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/resolver.py", line 243, in _resolve_one_round
│     constraints = sorted(self.constraints, key=key_from_ireq)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/resolver.py", line 117, in constraints
│     return set(
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/resolver.py", line 221, in _group_constraints
│     for _, ireqs in full_groupby(constraints, key=key_from_ireq):
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/utils.py", line 148, in full_groupby
│     return groupby(sorted(iterable, key=key), key=key)
│   File "/Users/redacted/ETL/.env/lib/python3.8/site-packages/piptools/utils.py", line 29, in key_from_ireq
│     if ireq.req is None and ireq.link is not None:
╰ AttributeError  'ParsedRequirement' object has no attribute 'req'

Workaround:

as per https://github.com/open-zaak/open-zaak/issues/585, update pip-tools

python -m pip install -U pip-tools

Fix:

Add correct version of pip-tools as a dependency