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

Dependency on "decorator" package not captured in v3.0.x #2263

Closed
lrbison opened this issue May 1, 2023 · 6 comments
Closed

Dependency on "decorator" package not captured in v3.0.x #2263

lrbison opened this issue May 1, 2023 · 6 comments

Comments

@lrbison
Copy link

lrbison commented May 1, 2023

When installing fabric in a fresh venv, Connection cannot be imported:

pip install 'fabric<3.0.0'
python -c 'from fabric import Connection'

The above works. But starting with 3.0.0, (including the recent 3.0.1):

pip install 'fabric>=3.0.0'
python -c 'from fabric import Connection'
Traceback (most recent call last):
  File "/home/lrbison/venvC/lib64/python3.7/site-packages/fabric/connection.py", line 7, in <module>
    from invoke.vendor.decorator import decorator
ModuleNotFoundError: No module named 'invoke.vendor.decorator'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/lrbison/venvC/lib64/python3.7/site-packages/fabric/__init__.py", line 3, in <module>
    from .connection import Config, Connection
  File "/home/lrbison/venvC/lib64/python3.7/site-packages/fabric/connection.py", line 9, in <module>
    from decorator import decorator
ModuleNotFoundError: No module named 'decorator'
@lrbison lrbison changed the title Dependency on "decorator" package not captured Dependency on "decorator" package not captured in 3x May 1, 2023
@lrbison lrbison changed the title Dependency on "decorator" package not captured in 3x Dependency on "decorator" package not captured in v3.0.x May 1, 2023
@nelsonq
Copy link

nelsonq commented May 1, 2023

@lrbison Yep, I am getting this error as well.

Looks like It is due to the invoke dependency getting upgraded to 2.1.0 on April 28 which breaks the compatibility.

On version v2.1.0, It removed the https://github.com/pyinvoke/invoke/blob/2.0/invoke/vendor/decorator.py from v2.0.0

To workaround it, I have to downgrade the invoke to 2.0.0.

RUN pip install fabric invoke==2.0.0

I would assume it is a dependency compatibility issue of Fabric. Looking forward to an official fix.

@bitprophet
Copy link
Member

Yup this is technically an Invoke level breakage, see pyinvoke/invoke#935 - however I think the correct fix is to make Fabric grow the dependency officially as it was sloppy hygiene to import it via Invoke's vendored copy. I'll commit the fix to master now and it will be out in 3.1 (since it's "sort of" adding a "new" dependency) which is in the works now. Thanks!

@exhuma
Copy link

exhuma commented May 2, 2023

Thank you @bitprophet for the quick response

edit: Do you have an expected release date for this? We have around 300 projects with daily builds and all of those using fabric exploded over the weekend because of this. Just to know whether we should start nudging in a fix or not to get our pipelines working again.

@bitprophet
Copy link
Member

bitprophet commented May 2, 2023

@exhuma There's nothing in Invoke 2.1 that you would be likely to care a lot about, so in your shoes I would definitely update whatever does your pip installing, to explicitly specify invoke<2.1 for the time being. I would expect Fabric 3.1 to be out within the next few weeks or so, at which point you could safely remove the invoke pin again.

@bitprophet
Copy link
Member

bitprophet commented May 2, 2023

Invocations 3.1 (no relation to Fabric 3.1...I just happened to get new major revs everywhere recently when dropping Python 2 😅) now out, and Fabric main branch now using it to prove this type of issue will be caught by our CI in the future: https://app.circleci.com/pipelines/github/fabric/fabric/191/workflows/8e7ddf2d-8d19-4579-a361-9c2a00e9f9c4/jobs/775

EDIT: and with the fix in place in Fabric's main branch (see autoclose link below), it passes again: https://app.circleci.com/pipelines/github/fabric/fabric/192/workflows/eb1bd2af-4478-4874-935a-dca384bc5258/jobs/793?invite=true#step-106-633

Look on PyPI for Fabric 3.1 to come out sometime hopefully later this month!

@Wedge009
Copy link

I confirm installing Fabric 3.1 picks up decorator as part of its dependency chain. Thanks.

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

No branches or pull requests

5 participants