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

Merge fabric3 into v1 mainline #2205

Merged
merged 176 commits into from Apr 7, 2022
Merged

Merge fabric3 into v1 mainline #2205

merged 176 commits into from Apr 7, 2022

Conversation

bitprophet
Copy link
Member

@bitprophet bitprophet commented Apr 4, 2022

Per discussion on the mailing list with @mathiasertl and others. See also my roadmap.

This is purely for the benefit of users still soldiering away on Python 2 + Fabric 1, who'd rather upgrade their dev/deploy systems to Python 3 first instead of jumping to the Fabric 2 API right away. Our primary focus remains on Fabric 2 (and its constituent libraries, Invoke and Paramiko).

This is expected to be the last set of commits to v1 unless severe bugs are discovered.

Davide Muzzarelli and others added 23 commits March 28, 2017 19:47
Fix TypeError: argument of type 'SSHException' is not iterable
Fix DeprecationWarning on import for Python 3.6 (#34)
Could also have twiddled the python cmd itself but this is faster, heh
Without this, Py3 gets pissy about objects not inheriting from BaseException,
as the objects are instead fudge fakes
Basically steals invoke/fabric modern one but trimmed down to basics
Mostly adding Python 3.6-3.8 to classifiers.

(We don't even test on 3.4/3.5 but whatever, probably still works there...)
@arnimarj
Copy link

arnimarj commented Apr 4, 2022

I'm one of those still toiling away with a mix of fabric3 and fabric2, and I'm aware of one issue with fabric3:

$ fab
Traceback (most recent call last):
  File "/home/arni/.config/dohop/tools_venv3/bin/fab", line 5, in <module>
    from fabric.main import main
  File "/home/arni/.config/dohop/tools_venv3/lib/python3.10/site-packages/fabric/main.py", line 12, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/home/arni/.pyenv/versions/3.10.3/lib/python3.10/collections/__init__.py)

Changing the import line to from collections.abc import Mapping fixes it

EDIT:

Looking at the documentation from https://docs.python.org/3.5/library/collections.abc.html through to https://docs.python.org/3.9/library/collections.abc.html collections.abc.Mapping seems to exist in all Python versions 3.5+.

@bitprophet
Copy link
Member Author

bitprophet commented Apr 5, 2022

Nice, thanks @arnimarj ! Guess that's because it was officially removed in 3.10 and a test dependency of ours dies at/after 3.9 so I wasn't able to add 3.9/3.10 to the test matrix. I'll make that fix now...ok, needs a somewhat newer six, unlikely to be an issue. Pushing that fix now.

EDIT: right, so I can't prove everything is great on 3.10 because - no tests - but I was able to do a basic fab -H user@remotehost -- whoami in a vanilla Python 3.10 container, and that worked fine, so the critical path at least has no import errors.

@arnimarj
Copy link

arnimarj commented Apr 5, 2022

Just tried the same my scripts and indeed it works! Thank you for this effort

@bitprophet bitprophet merged commit 1f52202 into v1 Apr 7, 2022
@bitprophet bitprophet deleted the fabric3-merge branch April 7, 2022 17:04
@un33k
Copy link

un33k commented Dec 22, 2022

How to get this change in from pypi?

Use newer six for collections_abc so Python 3.10 might work

It seems after 8 months, the change is still missing from Fabric3==1.14.post1

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 this pull request may close these issues.

None yet