Changelog¶
备注
正在查找结构1.x changelog?见 Changelog (1.x) .
警告
请记住,布料在很大程度上是一种包装 Paramiko 和 Invoke -Fabric的功能通常只需升级这些库的副本即可提高!在本段中单击他们的名字以访问他们的更改日志,并查看如果升级您的依赖项可能会得到什么。
3.2.2 2023-08-30
[Bug]:
fabric.runners.Remote
failed to properly deregister itsSIGWINCH
signal handler on shutdown; in rare situations this could cause tracebacks when the Python process receivesSIGWINCH
while no remote session is active. This has been fixed.[Bug] #2204: The signal handling functionality added in Fabric 2.6 caused unrecoverable tracebacks when invoked from inside a thread (such as the use of
fabric.group.ThreadingGroup
) under certain interpreter versions. This has been fixed by simply refusing to register signal handlers when not in the main thread. Thanks to Francesco Giordano and others for the reports.
3.2.1 2023-08-06
[Bug]: Neglected to actually add
deprecated
to our runtime dependency specification (it was still in our development dependencies). This has been fixed.
3.2.0 2023-08-06
[Feature]: Enhanced fabric.testing in ways large and small:
Backwards-compatibly merged the functionality of
MockSFTP
intoMockRemote
(may be opted-into by instantiating the latter withenable_sftp=True
) so you can mock out both SSH and SFTP functionality in the same test, which was previously impossible. It also means you can use this in a Pytest autouse fixture to prevent any tests from accidentally hitting the network!A new pytest fixture,
remote_with_sftp
, has been added which leverages the previous bullet point (an all-in-one fixture suitable for, eg, preventing any incidental ssh/sftp attempts during test execution).A pile of documentation and test enhancements (yes, testing our testing helpers is a thing).
[Support]: Added a new runtime dependency on the Deprecated library.
[Support]: Language update: applied
s/sanity/safety/g
to the codebase (with the few actual API members using the term now marked deprecated & new ones added in the meantime, mostly in fabric.testing).
3.1.0 2023-05-25
[Feature]: Add a new CLI flag to
fab
,fab --list-agent-keys
, which will attempt to connect to your local SSH agent and print a key list, similarly tossh-add -l
. This is mostly useful for expectations-checking Fabric and Paramiko's agent functionality, or for situations where you might not havessh-add
handy.警告
This feature requires Paramiko 3.2 or above.
[Feature]: Implement opt-in support for Paramiko 3.2's
AuthStrategy
machinery, as follows:Added a new module and class,
fabric.auth.OpenSSHAuthStrategy
, which leverages aforementioned new Paramiko functionality to marry loaded SSH config files with Fabric-level and runtime-level parameters, arriving at what should be OpenSSH-client-compatible authentication behavior. See its API docs for details.Added new configuration settings:
authentication.strategy_class
, which defaults toNone
, but can be set toOpenSSHAuthStrategy
to opt-in to the new behavior.authentication.identities
, which defaults to the empty list, and can be a list of private key paths for use by the new strategy class.
警告
This feature is EXPERIMENTAL, incomplete, and subject to change!
(For example, it lacks passphrase support, and doesn't implement 100% of all auth sources yet, focusing mostly on private keys and interactive-password.)
[Bug] #2263: Explicitly add our dependency on
decorator
tosetup.py
instead of using Invoke's old, now removed, vendored copy of same. This allows Fabric to happily use Invoke 2.1 and above. Thanks to Luke Robison, Nick Humrich, and others, for the reports.
3.0.1 2023-04-29
[Bug] #2241: A typo prevented Fabric's command runner from properly calling its superclass
stop()
method, which in tandem with a related Invoke bug meant messy or long shutdowns in many scenarios. Thanks to Orlando Rodríguez for report and initial patch.
3.0.0 2023-01-20
[Feature]: Change the default configuration value for
inline_ssh_env
fromFalse
toTrue
, to better align with the practicalities of common SSH server configurations.警告
This change is backwards incompatible if you were using environment-variable-setting kwargs or config settings, such as
Connection.run(command, env={'SOME': 'ENV VARS'})
, and were not already explicitly specifying the value ofinline_ssh_env
.[Bug] #1981: (fixed in #2195) Automatically close any open SFTP session during
fabric.connection.Connection.close
; this avoids issues encountered upon re-opening a previously-closed connection object. Thanks to Alexander Bodnya for the report and David JM Emmett for the patch.[Support]: Drop support for Python <3.6, including Python 2.
警告
This is a backwards incompatible change if you are not yet on Python 3.6 or above; however, pip shouldn't offer you this version of Fabric as long as your pip version understands
python_requires
metadata.
2.7.1 2022-07-14
[Bug] #1924: (also #2007) Overhaul behavior and testing re: merging together different sources for the
key_filename
parameter inConnection.connect_kwargs
. This fixes a number of type-related errors (string objects have noextend
attribute, cannot add lists to strings, etc). Thanks to Joey Dumont, Joseph Conti, and Jared Punzel for the reports; and to Kyle Meyer for submitting an early version of the patch.
2.7.0 2022-03-25
[Feature]: Forward local terminal resizes to the remote end, when applicable. (For the technical: this means we now turn
SIGWINCH
into SSHwindow-change
messages.)[Feature]: Add
shell
, a belated port of the v1open_shell()
feature.This wasn't needed initially, as the modern implementation of
run
is as good or better for full interaction thanopen_shell()
was, provided you're happy supplying a specific shell to execute.shell
serves the corner case where you aren't happy doing that, eg when you're speaking to network appliances or other targets which are not typical Unix server environments.Like
open_shell()
, this new method is primarily for interactive use, and has a slightly less useful return value. See its API docs for more details.
[Bug] #2142: Update
Connection
temporarily so that it doesn't incidentally applyreplace_env=True
to local shell commands, only remote ones. On Windows under Python 3.7+, this was causing local commands to fail due to lack of some environment variables. Future updates will cleanly separate the config tree for remote vs local methods.Thanks to Bartosz Lachowicz for the report and David JM Emmett for the patch.
[Support]: Overhaul administrative metadata and migrate to Circle-CI from Travis-CI.
2.6.0 2021-01-18
[Feature] #1999: Add
sudo
support toGroup
. Thanks to Bonnie Hardin for the report and to Winston Nolan for an early patchset.[Feature] #1810: Add
put
/get
support toGroup
.[Feature] #1868: Ported a feature from v1: interpolating the local path argument in
Transfer.get
with connection and remote filepath attributes.For example,
cxn.get(remote="/var/log/foo.log", local="{host}/")
is now feasible for storing a file in per-host-named directories or files, and in factGroup.get
does this by default.[Feature]: When the
local
path argument toTransfer.get
contains nonexistent directories, they are now created instead of raising an error.警告
This change introduces a new runtime dependency:
pathlib2
.[Bug]: Fix a handful of issues in the handling and mocking of SFTP local paths and
os.path
members within fabric.testing; this should remove some occasional "useless Mocks" as well as hewing closer to the real behavior of things likeos.path.abspath
re: path normalization.
2.5.0 2019-08-06
[Feature] #1989: Reinstate command timeouts, by supporting the implementation of that feature in Invoke (pyinvoke/invoke#539). Thanks to Israel Fruchter for report and early patchset.
[Feature]: Allow specifying connection timeouts (already available via
Connection
constructor argument and configuration option) on the command-line, via-t/--connect-timeout
.[Feature] #1985: Add support for explicitly closing remote subprocess' stdin when local stdin sees an EOF, by implementing a new command-runner method recently added to Invoke; this prevents remote programs that 'follow' stdin from blocking forever.
[Bug]: Anonymous/'remainder' subprocess execution (eg
fab -H host -- command
, as opposed to the use ofConnection.run
inside tasks) was explicitly specifyingin_stream=False
(i.e. "disconnect from stdin") under the hood; this was leftover from early development and prevented use of interactive (or other stdin-reading) programs via this avenue.It has been removed;
cat 'text' | fab -H somehost -- reads-from-stdin
(or similar use cases) should work again.[Support]: Removed unnecessary Cryptography version pin from packaging metadata; this was an artifact from early development. At this point in time, only Paramiko's own direct dependency specification should matter.
This is unlikely to affect anybody's install, since Paramiko has required newer Cryptography versions for a number of years now.
[Support]: Update minimum Invoke version requirement to
>=1.3
.
2.4.0 2018-09-13
[Feature] #1709: Add
Group.close
to allow closing an entire group's worth of connections at once. Patch via Johannes Löthberg.[Feature] #1780: Add context manager behavior to
Group
, to match the same feature inConnection
. Feature request by István Sárándi.[Feature] #1849: Add
Connection.from_v1
(andConfig.from_v1
) for easy creation of modernConnection
/Config
objects from the currently configured Fabric 1.x environment. Should make upgrading piecemeal much easier for many use cases.
2.3.2 2018-09-13
[Bug] #1852: Grant internal
Connection
objects created duringProxyJump
based gateways/proxies a copy of the outerConnection
's configuration object. This was not previously done, which among other things meant one could not fully disable SSH config file loading (as the internalConnection
objects would revert to the default behavior). Thanks to Chris Adams for the report.[Bug]: Some debug logging was reusing Invoke's logger object, generating log messages "named" after
invoke
instead offabric
. This has been fixed by using Fabric's own logger everywhere instead.[Bug] #1850: Skip over
ProxyJump
configuration directives in SSH config data when they would cause self-referentialRecursionError
(e.g. due to wildcard-usingHost
stanzas which include the jump server itself). Reported by Chris Adams.[Bug]: Fix a bug preventing tab completion (using the Invoke-level
--complete
flag) from completing task names correctly (behavior was to act as if there were never any tasks present, even if there was a valid fabfile nearby).
2.2.3 2018-09-13
[Bug] #1852: Grant internal
Connection
objects created duringProxyJump
based gateways/proxies a copy of the outerConnection
's configuration object. This was not previously done, which among other things meant one could not fully disable SSH config file loading (as the internalConnection
objects would revert to the default behavior). Thanks to Chris Adams for the report.[Bug]: Some debug logging was reusing Invoke's logger object, generating log messages "named" after
invoke
instead offabric
. This has been fixed by using Fabric's own logger everywhere instead.[Bug] #1850: Skip over
ProxyJump
configuration directives in SSH config data when they would cause self-referentialRecursionError
(e.g. due to wildcard-usingHost
stanzas which include the jump server itself). Reported by Chris Adams.[Bug]: Fix a bug preventing tab completion (using the Invoke-level
--complete
flag) from completing task names correctly (behavior was to act as if there were never any tasks present, even if there was a valid fabfile nearby).
2.1.6 2018-09-13
[Bug] #1852: Grant internal
Connection
objects created duringProxyJump
based gateways/proxies a copy of the outerConnection
's configuration object. This was not previously done, which among other things meant one could not fully disable SSH config file loading (as the internalConnection
objects would revert to the default behavior). Thanks to Chris Adams for the report.[Bug]: Some debug logging was reusing Invoke's logger object, generating log messages "named" after
invoke
instead offabric
. This has been fixed by using Fabric's own logger everywhere instead.[Bug] #1850: Skip over
ProxyJump
configuration directives in SSH config data when they would cause self-referentialRecursionError
(e.g. due to wildcard-usingHost
stanzas which include the jump server itself). Reported by Chris Adams.[Bug]: Fix a bug preventing tab completion (using the Invoke-level
--complete
flag) from completing task names correctly (behavior was to act as if there were never any tasks present, even if there was a valid fabfile nearby).
2.0.5 2018-09-13
[Bug] #1852: Grant internal
Connection
objects created duringProxyJump
based gateways/proxies a copy of the outerConnection
's configuration object. This was not previously done, which among other things meant one could not fully disable SSH config file loading (as the internalConnection
objects would revert to the default behavior). Thanks to Chris Adams for the report.[Bug]: Some debug logging was reusing Invoke's logger object, generating log messages "named" after
invoke
instead offabric
. This has been fixed by using Fabric's own logger everywhere instead.[Bug] #1850: Skip over
ProxyJump
configuration directives in SSH config data when they would cause self-referentialRecursionError
(e.g. due to wildcard-usingHost
stanzas which include the jump server itself). Reported by Chris Adams.[Bug]: Fix a bug preventing tab completion (using the Invoke-level
--complete
flag) from completing task names correctly (behavior was to act as if there were never any tasks present, even if there was a valid fabfile nearby).
2.3.1 2018-08-08
[Bug]: Update the new functionality added for #1826 so it uses
export
; without this, nontrivial shell invocations likecommand1 && command2
end up only applying the env vars to the first command.
2.3.0 2018-08-08
[Feature] #1831: Grant
Group
(and subclasses) the ability to take arbitrary keyword arguments and pass them onto the internalConnection
constructors. This allows code such as:mygroup = Group('host1', 'host2', 'host3', user='admin')
which was previously impossible without manually stuffing premade
Connection
objects intoGroup.from_connections
.[Feature] #1826: Add a new Boolean configuration and
Connection
parameter,inline_ssh_env
, which (when set toTrue
) changes how Fabric submits shell environment variables to remote servers; this feature helps work around commonly restrictiveAcceptEnv
settings on SSH servers. Thanks to Massimiliano Torromeo and Max Arnold for the reports.[Support] #1653: Clarify
Transfer
API docs surrounding remote file paths, such as the lack of tilde expansion (a buggy and ultimately unnecessary v1 feature). Thanks to@pint12
for bringing it up.[Support] #1819: Moved example code from the README into the Sphinx landing page so that we could apply doctests; includes a bunch of corrections to invalid example code! Thanks to Antonio Feitosa for the initial catch & patch.
2.2.2 2018-07-31
[Bug] #1762: Fix problem where lower configuration levels' setting of
connect_kwargs.key_filename
were being overwritten by the CLI--identity
flag's value...even when that value was the empty list. CLI-given values are supposed to win, but not quite that hard. Reported by@garu57
.[Bug] #1749: Improve
put
behavior when uploading to directory (vs file) paths, which was documented as working but had not been fully implemented. The local path's basename (or file-like objects'.name
attribute) is now appended to the remote path in this case. Thanks to Peter Uhnak for the report.[Bug]: Implement
__lt__
onConnection
so it can be sorted; this was overlooked when implementing things like__eq__
and__hash__
. (No, sorting doesn't usually matter much for this object type, but when you gotta, you gotta...)[Support] #1653: Clarify
Transfer
API docs surrounding remote file paths, such as the lack of tilde expansion (a buggy and ultimately unnecessary v1 feature). Thanks to@pint12
for bringing it up.[Support] #1819: Moved example code from the README into the Sphinx landing page so that we could apply doctests; includes a bunch of corrections to invalid example code! Thanks to Antonio Feitosa for the initial catch & patch.
2.1.5 2018-07-31
[Bug] #1824: The changes implementing #1772 failed to properly account for backwards compatibility with Invoke-level task objects. This has been fixed; thanks to
@ilovezfs
and others for the report.[Bug] #1762: Fix problem where lower configuration levels' setting of
connect_kwargs.key_filename
were being overwritten by the CLI--identity
flag's value...even when that value was the empty list. CLI-given values are supposed to win, but not quite that hard. Reported by@garu57
.[Bug] #1749: Improve
put
behavior when uploading to directory (vs file) paths, which was documented as working but had not been fully implemented. The local path's basename (or file-like objects'.name
attribute) is now appended to the remote path in this case. Thanks to Peter Uhnak for the report.[Bug]: Implement
__lt__
onConnection
so it can be sorted; this was overlooked when implementing things like__eq__
and__hash__
. (No, sorting doesn't usually matter much for this object type, but when you gotta, you gotta...)[Support] #1653: Clarify
Transfer
API docs surrounding remote file paths, such as the lack of tilde expansion (a buggy and ultimately unnecessary v1 feature). Thanks to@pint12
for bringing it up.[Support] #1819: Moved example code from the README into the Sphinx landing page so that we could apply doctests; includes a bunch of corrections to invalid example code! Thanks to Antonio Feitosa for the initial catch & patch.
2.0.4 2018-07-31
[Bug] #1824: The changes implementing #1772 failed to properly account for backwards compatibility with Invoke-level task objects. This has been fixed; thanks to
@ilovezfs
and others for the report.[Bug] #1762: Fix problem where lower configuration levels' setting of
connect_kwargs.key_filename
were being overwritten by the CLI--identity
flag's value...even when that value was the empty list. CLI-given values are supposed to win, but not quite that hard. Reported by@garu57
.[Bug] #1749: Improve
put
behavior when uploading to directory (vs file) paths, which was documented as working but had not been fully implemented. The local path's basename (or file-like objects'.name
attribute) is now appended to the remote path in this case. Thanks to Peter Uhnak for the report.[Bug]: Implement
__lt__
onConnection
so it can be sorted; this was overlooked when implementing things like__eq__
and__hash__
. (No, sorting doesn't usually matter much for this object type, but when you gotta, you gotta...)[Support] #1653: Clarify
Transfer
API docs surrounding remote file paths, such as the lack of tilde expansion (a buggy and ultimately unnecessary v1 feature). Thanks to@pint12
for bringing it up.[Support] #1819: Moved example code from the README into the Sphinx landing page so that we could apply doctests; includes a bunch of corrections to invalid example code! Thanks to Antonio Feitosa for the initial catch & patch.
2.2.1 2018-07-18
2.2.0 2018-07-13
[Feature] #1766: Reinstate support for use as
python -m fabric
, which (as in v1) now behaves identically to invokingfab
. Thanks to@RupeshPatro
for the original patchset.[Feature] #1772:
@hosts
is back -- as a@task
/Task
parameter of the same name. Acts much like a per-task--hosts
, but can optionally take dicts offabric.connection.Connection
kwargs as well as the typical shorthand host strings.备注
As of this change, we are now recommending the use of the new-in-this-release Fabric-level
@task
/Task
objects instead of their Invoke counterparts, even if you're not using thehosts
kwarg -- it will help future-proof your code for similar feature-adds later, and generally be less confusing than having mixed Invoke/Fabric imports for these object types.[Support]: Updated the minimum required Invoke version to
1.1
.
2.1.4 2018-07-13
[Bug] #1753: Set one of our test modules to skip user/system SSH config file loading by default, as it was too easy to forget to do so for tests aimed at related functionality. Reported by Chris Rose.
[Bug]: The
fabric.testing.fixtures.remote
pytest fixture was found to not be properly executing expectation/sanity tests on teardown; this was an oversight and has been fixed.
2.0.3 2018-07-13
[Bug]: Somehow neglected to actually add
extras_require
to oursetup.py
to enablepip install fabric[testing]
et al. This has been fixed. We hope.[Bug]: Minor fix to
extras_require
re: havingfabric[pytest]
encompass the contents offabric[testing]
.[Bug]: Our
packages=
argument tosetuptools.setup
was too specific and did not allow for subpackages...such as the newly addedfabric.testing
. Fixed now.[Bug]: Our packaging metadata lacked a proper
MANIFEST.in
and thus some distributions were not including ancillary directories like tests and documentation. This has been fixed.[Bug] #1753: Set one of our test modules to skip user/system SSH config file loading by default, as it was too easy to forget to do so for tests aimed at related functionality. Reported by Chris Rose.
[Bug]: The
fabric.testing.fixtures.remote
pytest fixture was found to not be properly executing expectation/sanity tests on teardown; this was an oversight and has been fixed.
2.1.3 2018-05-24
[Bug]: Our
packages=
argument tosetuptools.setup
was too specific and did not allow for subpackages...such as the newly addedfabric.testing
. Fixed now.[Bug]: Our packaging metadata lacked a proper
MANIFEST.in
and thus some distributions were not including ancillary directories like tests and documentation. This has been fixed.
2.1.2 2018-05-24
[Bug]: Minor fix to
extras_require
re: havingfabric[pytest]
encompass the contents offabric[testing]
.
2.1.1 2018-05-24
[Bug]: Somehow neglected to actually add
extras_require
to oursetup.py
to enablepip install fabric[testing]
et al. This has been fixed. We hope.
2.1.0 2018-05-24
[Feature]: Exposed our previously internal test helpers for use by downstream test suites, as the fabric.testing subpackage.
备注
As this code requires non-production dependencies, we've also updated our packaging metadata to publish some setuptools "extras",
fabric[testing]
(base) andfabric[pytest]
(for pytest users).[Support] #1745: Wrap any imports of
invoke.vendor.*
withtry
/except
such that downstream packages which have removedinvoke.vendor
are still able to function by using stand-alone dependencies. Patch courtesy of Othmane Madjoudj.[Support] #1759: Apply the
black
code formatter to the codebase and engage it on Travis-CI. Thanks to Chris Rose.[Support] #1761: Integration tests were never added to Travis or ported to pytest before 2.0's release; this has been addressed.
2.0.2 2018-05-24
[Support] #1745: Wrap any imports of
invoke.vendor.*
withtry
/except
such that downstream packages which have removedinvoke.vendor
are still able to function by using stand-alone dependencies. Patch courtesy of Othmane Madjoudj.[Support] #1759: Apply the
black
code formatter to the codebase and engage it on Travis-CI. Thanks to Chris Rose.[Support] #1761: Integration tests were never added to Travis or ported to pytest before 2.0's release; this has been addressed.
2.0.1 2018-05-14
[Bug] #1740: A Python 3 wheel was not uploaded during the previous release as expected; it turned out we were lacking the typical 'build universal wheels' setting in our
setup.cfg
(due to copying it from the one other project in our family of projects which explicitly cannot build universal wheels!) This has been fixed and a proper universal wheel is now built.
2.0.0 2018-05-08
[Feature]: Rewrite for 2.0! See 从1.x升级.