Debian Codegraph @

sites/www/changelog.rst

raw
1 =========
2 Changelog
3 =========
4
5 - :release:`3.0.3 <2026-04-07>`
6 - :support:`- backported` Reverted the `@task
7 <invoke.tasks.task>` return value type hint change; it actually just makes
8 things worse. Taking this one back to the drawing table for later.
9 - :release:`3.0.2 <2026-04-06>`
10 - :support:`- backported` Make the return value type hint for `@task
11 <invoke.tasks.task>` more specific; as-is it would trigger typecheck errors
12 when handing regular, decorated task functions as inputs to
13 `~invoke.collection.Collection.add_task` and similar methods.
14 - :bug:`742` Define a custom ``__repr__`` for `~invoke.runners.Promise` so it
15 can be displayed in interactive sessions or other debug contexts, without
16 running afoul of ``AttributeError``. Thanks to Leonid Shvechikov for the
17 original bug report.
18 - :release:`3.0.1 <2026-04-06>`
19 - :support:`- backported` Minor tweaks to documentation and type
20 hints/inheritance (mostly around `~invoke.runners.Promise`).
21 - :release:`3.0.0 <2026-04-05>`
22 - :support:`-` Dropped support for Python versions <3.9. That's right, we've
23 caught up to Python's own EOL regime...as of late 2024! As part of this
24 change, we also switched over to using ``pyproject.toml`` for packaging
25 metadata.
26 - :support:`-` Expanded mypy type hint checking to more of the codebase &
27 generally touched up some type hints here and there. More of this is planned
28 to occur as we go.
29 - :feature:`779` `~invoke.runners.Runner.run` now includes local subprocess
30 PIDs in `~invoke.runners.Result` objects (as ``.pid``), via the new
31 `Runner.get_pid <invoke.runners.Runner.get_pid>` method. This may be
32 generally useful for auditing or similar tasks, but is primarily intended for
33 users of ``disown=True`` who want to perform their own subprocess management.
34 Thanks to Matt J Williams for the feature request.
35 - :feature:`947` Update the return value, and type hint, of `~invoke.run` and
36 friends to be `~invoke.runners.Result` instead of ``Optional[Result]``.
37 Specifically:
38
39 - The only scenario where the return value was `None` was when
40 ``disown=True``, but with hindsight (and a few years of working with
41 typed Python) it's clear we should have done what we did for
42 ``asynchronous=True`` and still returned *some* Result-y object, even if
43 it wouldn't have all the normal fields populated.
44 - We determined that the behavior of ``disowned`` is such that it can live
45 within regular `~invoke.runners.Result` without too many headaches (i.e.
46 no need for a subclass like `~invoke.runners.Promise`) and have gone that
47 route, with option to expand the class tree in a future
48 backwards-incompatible release.
49 `~invoke.runners.Runner.run`'s docstring has been updated to reflect what
50 this variant of `~invoke.runners.Result` looks like.
51 - While this change is technically **backwards incompatible**, ``disown``
52 is a very niche use case, and this type of change (going from a largely
53 unusable value to a usable one) seems worth the turbulence, especially
54 since...
55 - The main driver for this change (besides :issue:`779` elsewhere in this
56 release) was that the previous return value of ``Optional[Result]``
57 causes frustrating static analysis 'bug' (analyzers can't assume you have
58 a `~invoke.runners.Result` in hand even though it's the vastly more
59 common case).
60
61 .. warning::
62 As noted above, this change is backwards incompatible **if** you were
63 relying on this method's return value to be ``None`` when ``disown=True``.
64 It is backwards compatible in all other situations.
65
66 - :feature:`250` Add access to the core CLI parser's :ref:`remainder
67 <remainder>` value, via `Context.remainder
68 <invoke.context.Context.remainder>` - this allows for more elegant
69 :ref:`wrapper tasks <wrapper-tasks>`.
70
71 .. warning::
72 This change is technically backwards incompatible, but only if you were
73 overriding the `tasks.Call.make_context <invoke.tasks.Call.make_context>`
74 method. Updating such code to work with this version of Invoke is
75 straightforward; see `this Fabric commit
76 <https://github.com/fabric/fabric/commit/7fa309db9dd5dac69079c1fb83b6f579555f7d53>`_
77 for an example.
78
79 - :support:`-` Fix a grab bag's worth of Sphinx doc render problems, among
80 which were some class attributes (eg `Context.command_cwds
81 <invoke.context.Context.command_cwds>`) that had silently disappeared from
82 the class' autodoc output after our 2.0 release.
83 - :release:`2.2.1 <2025-10-10>`
84 - :release:`2.1.4 <2025-10-10>`
85 - :bug:`1038` (fixed in :issue:`1040`) Python 3.14 tweaked the behavior of
86 `fcntl` to raise `SystemError` on buffer overflows, which our interpretation
87 of `termios.TIOCGWINSZ <termios>` technically was (we care only about the
88 first two fields in what is technically a four-field struct with half the
89 fields unused). This has been fixed by unpacking all 4 fields and then
90 discarding the unused fields during processing.
91
92 Thanks to ``@kasium`` for the original bug report and to ``@rathann`` and
93 ``@BradleyKirton`` for workshopping the patch into its final shape.
94 - :bug:`1011 major`: `~invoke.runners.Runner.run`'s ``shell`` argument/config
95 option originally defaulted to ``/bin/bash``, which unsurprisingly causes a
96 hard fail on systems where this path is not present (eg, NixOS, embedded
97 systems, etc).
98
99 As of this release, we now use ``execvpe`` to leverage ``$PATH`` binary
100 search, and changed the ``run.shell`` config option's value to just
101 ``bash``. This should be backwards compatible in nearly all cases, and
102 provides a much more robust default.
103
104 Props to Lou Lecrivain for the patch, and to Jorge Araya Navarro for the
105 original report,
106 - :release:`2.2.0 <2023-07-12>`
107 - :feature:`-` Remove the somewhat inaccurate subclass requirement around
108 `~invoke.config.Config`'s ``.clone(into=...)`` constructor call. It was
109 broken for certain use cases (such as trying to clone one subclass into a
110 sibling subclass, which would yield a ``TypeError``) and is irrelevant if one
111 is using the new type annotations.
112 - :release:`2.1.3 <2023-06-14>`
113 - :bug:`944` After the release of 2.1, package-style task modules started
114 looking in the wrong place for project-level config files (inside one's eg
115 ``tasks/`` dir, instead of *next to* that dir) due to a subtlety in the new
116 import/discovery mechanism used. This has been fixed. Thanks to Arnaud V. and
117 Hunter Kelly for the reports and to Jesse P. Johnson for initial
118 debugging/diagnosis.
119 - :release:`2.1.2 <2023-05-15>`
120 - :support:`936 backported` Make sure ``py.typed`` is in our packaging
121 manifest; without it, users working from a regular installation
122 can't perform type checks. Thanks to Nikita Sobolev for catch & patch.
123 - :release:`2.1.1 <2023-05-01>`
124 - :bug:`934` The `importlib` upgrade in 2.1 had a corner case bug (regarding
125 ``from . import <submodule>`` functionality within package-like task trees)
126 which in turn exposed a false-pass in our test suite. Both have now been
127 fixed. Thanks to Greg Meyer and Robert J. Berger for the bug reports.
128 - :release:`2.0.1 <2023-04-29>`
129 - :bug:`910` Add more rigor around subprocess/runner shutdown to avoid spurious
130 exceptions & also fix downstream issues in libraries like Fabric. Reported by
131 Orlando Rodríguez.
132 - :release:`2.1.0 <2023-04-28>`
133 - :support:`675` Implement `importlib` and deprecate `imp` module. Patches
134 provided by Jesse P. Johnson
135 - :bug:`376 major` Resolve equality comparison bug for non-collections. Patch
136 via Jesse P. Johnson
137 - :support:`906` Implement type hints and type checking tests with mypy to
138 reduce errors and impove code documentation. Patches by Jesse P. Johnson and
139 review by Sam Bull.
140 - :support:`901 backported` (via :issue:`903`) Tweak test suite ``setup``
141 methods to be named ``setup_method`` so pytest stops whining about it. Patch
142 via Jesse P. Johnson.
143 - :release:`2.0.0 <2023-01-16>`
144 - :support:`-` Remove support for, and imports related to, all Python versions
145 less than 3.6 - including Python 2. This also includes updates to vendored
146 packages, such as removing ``six`` and upgrading ``lexicon`` to the latest
147 version; and also treatment of things like ``Mock`` use within
148 `invoke.context.MockContext` (which now expects stdlib's ``unittest.mock``
149 instead of hunting for the old standalone ``mock`` library).
150
151 Thanks to various folks for patches related to some of this work, including
152 Jesse P. Johnson who supplied multiple PRs whose commits made it in.
153
154 .. warning::
155 This change is backwards incompatible in the following scenarios:
156
157 - You use Python <3.6. Shouldn't be an issue as we now specify
158 ``python_requires`` in packaging metadata.
159 - You call ``invoke.util.encode_output`` manually for some reason. (This
160 became a noop under Python 3, so just...remove it!)
161 - You use `invoke.context.MockContext`; its ``repeat`` init kwarg changed
162 its default value from ``False`` to ``True``. This probably won't bite
163 you, but we mention it just in case you somehow relied upon the legacy
164 behavior.
165 - You subclass `invoke.runners.Runner` and/or have had to interact with its
166 ``stop`` or ``stop_timer`` methods. The latter has been merged into the
167 former, and if you are overriding ``stop``, you'll want to make sure you
168 now call ``super()`` somewhere if you were not already.
169
170 - :support:`-` `Task.argspec <invoke.tasks.Task.argspec>` has changed its
171 return value; it now returns an `inspect.Signature` derived from that of the
172 task's body callable.
173
174 .. warning::
175 This change is backwards incompatible if you were using this method
176 directly.
177
178 - :release:`1.7.3 <2022-09-30>`
179 - :support:`- backported` Fix a non-fatal bug in our setup.py
180 ``long_description`` generation causing 1.7.0-1.7.2 to have malformed
181 description text on PyPI.
182 - :release:`1.7.2 <2022-09-30>`
183 - :bug:`876` Refactor CLI parser instantiation such that the
184 ``tasks.ignore_unknown_help`` feature (added in 1.7) works when Invoke is run
185 in ``--complete`` mode, i.e. in tab-completion scripts.
186 - :bug:`-` Fix errors thrown when comparing `~invoke.tasks.Task` objects to
187 non-Task objects; such comparisons are now always false.
188 - :release:`1.7.1 <2022-05-11>`
189 - :bug:`659` Improve behavior under ``nohup``, which causes stdin to become an
190 undetectably-unreadable (but otherwise legit) file descriptor. Previously
191 this led to `OSError` even if you weren't expecting anything on stdin; we now
192 trap this specific case and silently ignore it, allowing execution to
193 continue. Thanks to ``@kingkisskill`` for initial report and to Ryan Stoner
194 for followup and workshopping.
195 - :release:`1.7.0 <2022-03-18>`
196 - :feature:`793` Add a new ``tasks.ignore_unknown_help`` config option for
197 users who hand their tasks centrally-defined argument help dictionaries; it
198 defaults to ``False`` but such users may set it to ``True`` to avoid
199 exceptions. Thanks to ``@Allu2`` for the report.
200 - :support:`-` Switch to using ``yaml.safe_load`` for loading config files.
201 This avoids some warnings under newer PyYAML versions and is also, in a
202 shocking twist, more secure.
203 - :support:`803` Upgrade our vendored PyYAML from 3.11 to 5.4.1; this should
204 both supply a number of security fixes, and address problems loading
205 project-level YAML config files under Python 3.10. Fix via Andreas Rammhold.
206 - :feature:`845` Env vars explicitly supplied to `~invoke.context.Context.sudo`
207 (via its ``env`` kwarg) are now explicitly preserved via ``sudo``'s
208 ``--preserve-env`` argument. Patch courtesy of Benno Rice.
209 - :support:`-` Switch our continuous integration service from Travis-CI to
210 Circle-CI, plus related and necessary updates to various administrative
211 config files, management tasks and metadata. Including but not limited to:
212
213 - Enhanced PyPI-level metadata/links
214 - Split out tool config data from ``setup.cfg``
215 - Enhance execution & coverage of unit vs integration tests under CI
216
217 .. warning::
218 Due to various factors, this release will **not** include a Python
219 2-compatible wheel archive. Users of Python 2 can still install from the
220 sdist, and are strongly encouraged to check `the roadmap
221 <https://bitprophet.org/projects/#roadmap>`_ as the next release will
222 likely be the one that removes Python 2 entirely!
223
224 - :release:`1.6.0 <2021-07-09>`
225 - :release:`1.5.1 <2021-07-09>`
226 - :support:`- backported` (Mostly) alphabetize the list of ``run()`` params in
227 the runners API docs. Previously they were an unordered mess.
228 - :support:`- backported` Document the ``dry`` keyword argument to ``run``,
229 which had been added in version 1.3 but only documented as a CLI flag; it
230 does also work as a kwarg (and as a config option).
231 - :bug:`751` Don't explode on empty-but-for-whitespace task docstrings. Thanks
232 to Matt Hayden for the report & initial patches.
233 - :feature:`791` Add a new ``run.echo_format`` configuration option allowing
234 control over the format of echoed commands. It defaults to the previously
235 hardcoded value (wrap in ANSI bold) and is thus backwards compatible. Thanks
236 to David JM Emmett for the patch.
237 - :release:`1.5.0 <2020-12-30>`
238 - :feature:`454` (also :issue:`577`/:issue:`658`, via
239 :issue:`583`/:issue:`681`/:issue:`607`) Allow any string-compatible object to
240 be passed to `Context.cd <invoke.context.Context.cd>`, enabling use of eg
241 ``pathlib.Path`` instances. Thanks to Jimm Domingo for the original report
242 and Ludovico Bianchi, Mario César, and Floris Lambrechts for patches.
243 - :bug:`409 major` (via :issue:`611`/:issue:`580`) Don't silently discard help
244 text for task arguments whose names happen to contain underscores. Reported
245 by ``@iago1460``, original patches by Hayden Flinner and Floris Lambrechts.
246 - :bug:`398 major` (via :issue:`611`/:issue:`580`) Don't silently ignore task
247 help specifiers which don't actually map to the decorated task's arguments
248 (eg ``@task(help={"foo": "help for foo"})`` wrapping a task without a ``foo``
249 argument). Reported by Sohaib Farooqi, with original patches by Hayden
250 Flinner and Floris Lambrechts.
251 - :feature:`197` Allow subcollections to act as the default 'tasks' of their
252 parent collections (via the new ``default`` kwarg to
253 `~invoke.collection.Collection.add_collection`). This means that nontrivial
254 task trees can specify eg "use my test subcollection's default task as the
255 global default task" and similar. Thanks to Tye Wang for the request and
256 initial patch.
257 - :support:`-` Enhanced test coverage in a handful of modules whose coverage
258 was under 90%.
259 - :feature:`-` `~invoke.context.MockContext` now populates its
260 ``NotImplementedError`` exception instances (typically raised when a command
261 is executed which had no pre-prepared result) with the command string that
262 triggered them; this makes it much easier to tell what exactly in a test
263 caused the error.
264 - :feature:`-` `~invoke.context.MockContext` now accepts a few quality-of-life
265 shortcuts as keys and values in its ``run``/``sudo`` arguments:
266
267 - Keys may be compiled regular expression objects, as well as strings, and
268 will match any calls whose commands match the regex.
269 - Values may be ``True`` or ``False`` as shorthand for otherwise empty
270 `~invoke.runners.Result` objects with exit codes of ``0`` or ``1``
271 respectively.
272 - Values may also be strings, as shorthand for otherwise empty
273 `~invoke.runners.Result` objects with those strings given as the
274 ``stdout`` argument.
275
276 - :feature:`441` Add a new ``repeat`` kwarg to `~invoke.context.MockContext`
277 which, when True (default: False) causes stored results for its methods to be
278 yielded repeatedly instead of consumed. Feature request courtesy of
279 ``@SwampFalc``.
280 - :bug:`- major` Immutable iterable result values handed to
281 `~invoke.context.MockContext` would yield errors (due to the use of
282 ``pop()``). The offending logic has been retooled to be more iterator-focused
283 and now works for tuples and etc.
284 - :support:`-` Update the :ref:`testing documentation <testing-user-code>` a
285 bit: cleaned up existing examples and added new sections for the other
286 updates in the 1.5 release.
287 - :feature:`700` Automatically populate the ``command`` attribute of
288 `~invoke.runners.Result` objects returned by `~invoke.context.MockContext`
289 methods, with the command string triggering that result. Previously users had
290 to do this by hand or otherwise suffered inaccurate result objects. Thanks to
291 ``@SwampFalc`` for the report & initial patch.
292 - :feature:`-` Upgrade `~invoke.context.MockContext` to wrap its methods in
293 ``Mock`` objects if the ``(unittest.)mock`` library is importable. This makes
294 testing Invoke-using codebases even easier.
295 - :release:`1.4.1 <2020-01-29>`
296 - :release:`1.3.1 <2020-01-29>`
297 - :support:`586 backported` Explicitly strip out ``__pycache__`` (and for good
298 measure, ``.py[co]``, which previously we only stripped from the ``tests/``
299 folder) in our ``MANIFEST.in``, since at least some earlier releases
300 erroneously included such. Credit to Martijn Pieters for the report and
301 Floris Lambrechts for the patch.
302 - :bug:`660` Fix an issue with `~invoke.run` & friends having intermittent
303 problems at exit time (symptom was typically about the exit code value being
304 ``None`` instead of an integer; often with an exception trace). Thanks to
305 Frank Lazzarini for the report and to the numerous others who provided
306 reproduction cases.
307 - :bug:`518` Close pseudoterminals opened by the `~invoke.runners.Local` class
308 during ``run(..., pty=True)``. Previously, these were only closed
309 incidentally at process shutdown, causing file descriptor leakage in
310 long-running processes. Thanks to Jonathan Paulson for the report.
311 - :release:`1.4.0 <2020-01-03>`
312 - :bug:`637 major` A corner case in `~invoke.context.Context.run` caused
313 overridden streams to be unused if those streams were also set to be hidden
314 (eg ``run(command, hide=True, out_stream=StringIO())`` would result in no
315 writes to the ``StringIO`` object).
316
317 This has been fixed - hiding for a given stream is now ignored if that stream
318 has been set to some non-``None`` (and in the case of ``in_stream``,
319 non-``False``) value.
320 - :bug:`- major` As part of feature work on :issue:`682`, we noticed that the
321 `~invoke.runners.Result` return value from `~invoke.context.Context.run` was
322 inconsistent between dry-run and regular modes; for example, the dry-run
323 version of the object lacked updated values for ``hide``, ``encoding`` and
324 ``env``. This has been fixed.
325 - :feature:`682` (originally reported as :issue:`194`) Add asynchronous
326 behavior to `~invoke.runners.Runner.run`:
327
328 - Basic asynchronicity, where the method returns as soon as the subprocess
329 has started running, and that return value is an object with methods
330 allowing access to the final result.
331 - "Disowning" subprocesses entirely, which not only returns immediately but
332 also omits background threading, allowing the subprocesses to outlive
333 Invoke's own process.
334
335 See the updated API docs for the `~invoke.runners.Runner` for details on the
336 new ``asynchronous`` and ``disown`` kwargs enabling this behavior. Thanks to
337 ``@MinchinWeb`` for the original report.
338 - :feature:`-` Never accompanied the top-level singleton `~invoke.run` (which
339 simply wraps an anonymous `~invoke.context.Context`'s ``run`` method) with
340 its logical sibling, `~invoke.sudo` - this has been remedied.
341 - :release:`1.3.0 <2019-08-06>`
342 - :feature:`324` Add basic dry-run support, in the form of a new
343 :option:`--dry` CLI option and matching ``run.dry`` config setting, which
344 causes command runners (eg `~invoke.run`, `Context.run
345 <invoke.context.Context.run>`) to:
346
347 - Act as if the ``echo`` option has been turned on, printing the
348 command-to-be-run to stdout;
349 - Skip actual subprocess invocation (returning before any of that machinery
350 starts running);
351 - Return a dummy `~invoke.runners.Result` object with 'blank' values (empty
352 stdout/err strings, ``0`` exit code, etc).
353
354 This allows quickly seeing what a given task or series of tasks might do,
355 without actually running any shell commands (though naturally, any
356 state-modifying Python code will still run).
357
358 Thanks to Monty Hindman for the feature request and ``@thebjorn`` for the
359 initial patch.
360
361 - :bug:`384 major` (via :issue:`653`) Modify config file loading so it detects
362 missing-file IOErrors via their ``errno`` attribute instead of their string
363 rendering (eg ``"No such file"``). This should improve compatibility for
364 non-English locales. Thanks to Patrick Massot for the report and Github user
365 ``@cybiere`` for the patch.
366 - :feature:`539` (via :issue:`645`) Add support for command timeouts, i.e. the
367 ability to add an upper bound on how long a call to
368 `~invoke.context.Context.run` may take to execute. Specifically:
369
370 - A ``timeout`` argument to `~invoke.context.Context.run`.
371 - The ``timeouts.command`` config setting mapping to that argument.
372 - The :option:`-T/--command-timeout <-T>` CLI flag.
373
374 Thanks to Israel Fruchter for the request & an early version of the patchset.
375 - :bug:`552 major` (also :issue:`553`) Add a new `~invoke.runners.Runner`
376 method, `~invoke.runners.Runner.close_proc_stdin`, and call it when standard
377 input processing detects an EOF. Without this, subprocesses that read their
378 stdin until EOF would block forever, hanging the program. Thanks to
379 ``@plockc`` for the report & initial patch.
380
381 .. note::
382 This fix only applies when ``pty=False`` (the default); PTYs complicate the
383 situation greatly (but also mean the issue is less likely to occur).
384
385 - :bug:`557 major` (with assist from :issue:`640`) Fix the
386 `~invoke.context.Context.cd` and `~invoke.context.Context.prefix` context
387 managers so that ``with cd`` and ``with prefix`` correctly revert their state
388 manipulations after they exit, when exceptions occur. Thanks to Jon Walsh and
389 Artur Puzio for their respective patches.
390 - :bug:`466 major` Update the parsing and CLI-program mechanisms so that all
391 core arguments may be given within task CLI contexts; previously this
392 functionality only worked for the ``--help`` flag, and other core arguments
393 given after task names (such as ``--echo``) were silently ignored.
394 - :feature:`-` Allow the configuration system to override which
395 `~invoke.executor.Executor` subclass to use when executing tasks (via an
396 import-oriented string).
397
398 Specifically, it's now possible to alter execution by distributing such a
399 subclass alongside, for example, a repository-local config file which sets
400 ``tasks.executor_class``; previously, this sort of thing required use of
401 :ref:`custom binaries <reusing-as-a-binary>`.
402 - :release:`1.2.0 <2018-09-13>`
403 - :feature:`301` (via :issue:`414`) Overhaul tab completion mechanisms so users
404 can :ref:`print a completion script <print-completion-script>` which
405 automatically matches the emitting binary's configured names (compared to the
406 previous hardcoded scripts, which only worked for ``inv``/``invoke`` by
407 default). Thanks to Nicolas Höning for the foundational patchset.
408 - :release:`1.1.1 <2018-07-31>`
409 - :release:`1.0.2 <2018-07-31>`
410 - :bug:`556` (also `fabric/fabric#1823
411 <https://github.com/fabric/fabric/issues/1823>`_) Pre-emptively check for an
412 error condition involving an unpicklable config file value (Python config
413 files and imported module objects) and raise a useful exception instead of
414 allowing a confusing ``TypeError`` to bubble up later. Reported by Pham Cong
415 Dinh.
416 - :bug:`559` (also `fabric/fabric#1812
417 <https://github.com/fabric/fabric/issues/1812>`_) Modify how
418 `~invoke.runners.Runner` performs stdin terminal mode changes, to avoid
419 incorrect terminal state restoration when run concurrently (which could lead
420 to things like terminal echo becoming disabled after the Python process
421 exits).
422
423 Thanks to Adam Jensen and Nick Timkovich for the detailed bug reports &
424 reproduction assistance.
425 - :release:`1.1.0 <2018-07-12>`
426 - :release:`1.0.1 <2018-07-12>`
427 - :feature:`-` Enhance `~invoke.tasks.Call` with a new method
428 (``clone_data``) and new kwarg to an existing method (``clone`` grew
429 ``with_``) to assist subclassers when extending.
430 - :bug:`270` (also :issue:`551`) ``None`` values in config levels (most
431 commonly caused by empty configuration files) would raise ``AttributeError``
432 when `~invoke.config.merge_dicts` was used to merge config levels together.
433 This has been fixed. Thanks to Tyler Hoffman and Vlad Frolov for the reports.
434 - :feature:`-` Refactor `~invoke.tasks.Call` internals slightly, exposing some
435 previously internal logic as the ``clone_data`` method; this is useful for
436 client codebases when extending `~invoke.tasks.Call` and friends.
437 - :feature:`-` Remove overzealous argument checking in `@task
438 <invoke.tasks.task>`, instead just handing any extra kwargs into the task
439 class constructor. The high level behavior for truly invalid kwargs is the
440 same (``TypeError``) but now extending codebases can add kwargs to their
441 versions of ``@task`` without issue.
442 - :feature:`-` Add a ``klass`` kwarg to `@task <invoke.tasks.task>` to allow
443 extending codebases the ability to create their own variants on
444 ``@task``/``Task``.
445 - :bug:`-` Fix up the ``__repr__`` of `~invoke.tasks.Call` to reference dynamic
446 class name instead of hardcoding ``"Call"``; this allows subclasses'
447 ``__repr__`` output to be correct instead of confusing.
448 - :support:`- backported` Fixed some inaccuracies in the API docs around
449 `~invoke.executor.Executor` and its ``core`` kwarg (was erroneously referring
450 to `~invoke.parser.context.ParserContext` instead of
451 `~invoke.parser.parser.ParseResult`). Includes related cleaning-up of
452 docstrings and tests.
453 - :support:`- backported` Apply the `black <https://black.readthedocs.io/>`_
454 code formatter to our codebase and our CI configuration.
455 - :support:`- backported` Fix some test-suite-only failures preventing
456 successful testing on Python 3.7 and PyPy3, and move them out of the 'allowed
457 failures' test matrix quarantine now that they pass.
458 - :support:`- backported` Implemented some minor missing tests, such as testing
459 the ``INVOKE_DEBUG`` low-level env var.
460 - :feature:`543` Implemented support for using ``INVOKE_RUNTIME_CONFIG`` env
461 var as an alternate method of supplying a runtime configuration file path
462 (effectively, an env var based version of using the ``-f``/``--config``
463 option). Feature request via Kevin J. Qiu.
464 - :bug:`528` Around Invoke 0.23 we broke the ability to weave in subcollections
465 via keyword arguments to `~invoke.collection.Collection`, though it primarily
466 manifests as ``NoneType`` related errors during ``inv --list``. This was
467 unintentional and has been fixed. Report submitted by Tuukka Mustonen.
468 - :bug:`-` As part of solving :issue:`528` we found a related bug, where
469 unnamed subcollections also caused issues with ``inv --list
470 --list-format=json``. Specifically, `Collection.serialized
471 <invoke.collection.Collection.serialized>` sorts subcollections by name,
472 which is problematic when that name is ``None``. This is now fixed.
473 - :release:`1.0.0 <2018-05-09>`
474 - :feature:`-` Added the :ref:`--prompt-for-sudo-password
475 <prompt-for-sudo-password>` CLI option for getpass-based up-front prompting
476 of a sensitive configuration value.
477 - :feature:`-` Updated `~invoke.tasks.Task` to mimic the wrapped function's
478 ``__module__`` attribute, allowing for better interaction with things like
479 Sphinx autodoc that attempt to filter out imported objects from a module.
480 - :bug:`- major` Removed an old, unused and untested (but, regrettably,
481 documented and public) method that doesn't seem to be much use:
482 ``invoke.config.Config.paths``. Please reach out if you were actually using
483 it and we may consider adding some form of it back.
484
485 .. warning::
486 This is a backwards incompatible change if you were using ``Config.paths``.
487
488 - :bug:`- major` Tweaked the innards of
489 `~invoke.config.Config`/`~invoke.config.DataProxy` to prevent accessing
490 properties & other attributes' values during ``__setattr__`` (the code in
491 question only needed the names). This should have no noticeable effect on
492 user code (besides a marginal speed increase) but fixed some minor test
493 coverage issues.
494 - :release:`0.23.0 <2018-04-29>`
495 - :bug:`- major` Previously, some error conditions (such as invalid task or
496 collection names being supplied by the user) printed to standard output,
497 instead of standard error. Standard error seems more appropriate here, so
498 this has been fixed.
499
500 .. warning::
501 This is backwards incompatible if you were explicitly checking the standard
502 output of the ``inv[oke]`` program for some of these error messages.
503
504 .. warning::
505 If your code is manually raising or introspecting instances of
506 `~invoke.exceptions.Exit`, note that its signature has changed from
507 ``Exit(code=0)`` to ``Exit(message=None, code=None)``. (Thus, this will
508 only impact you if you were calling its constructor instead of raising the
509 class object itself.)
510
511 - :bug:`- major` `~invoke.collection.Collection` had some minor bugs or
512 oversights in how it responds to things like ``repr()``, ``==``; boolean
513 behavior; how docstrings appear when created from a Python module; etc. All
514 are now fixed. If you're not sure whether this affects you, it does not :)
515 - :bug:`- major` Integer-type CLI arguments were not displaying placeholder
516 text in ``--help`` output (i.e. they appeared as ``--myint`` instead of
517 ``--myint=INT``.) This has been fixed.
518 - :feature:`33` Overhaul task listing (formerly just a simple, boolean
519 ``--list``) to make life easier for users with nontrivial task trees:
520
521 - Limit display to a specific namespace by giving an optional argument to
522 ``--list``, e.g. ``--list build``;
523 - Additional output formats besides the default (now known as ``flat``) such
524 as a nested view with ``--list-format nested`` or script-friendly output
525 with ``--list-format json``.
526 - The default ``flat`` format now sorts a bit differently - the previous
527 algorithm would break up trees of tasks.
528 - Limit listing depth, so it's easier to view only the first level or two
529 (i.e. the overall namespaces) of a large tree, e.g. ``--list --list-depth
530 1``;
531
532 Thanks to the many users who submitted various requests under this ticket's
533 umbrella, and to Dave Burkholder in particular for detailed use case analysis
534 & feedback.
535
536 - :support:`-` (partially re: :issue:`33`) Renamed the ``--root`` CLI flag to
537 ``--search-root``, partly for clarity (:issue:`33` will be adding namespace
538 display-root related flags, which would make ``--root`` ambiguous) and partly
539 for consistency with the config option, which was already named
540 ``search_root``. (The short version of the flag, ``-r``, is unchanged.)
541
542 .. warning::
543 This is a backwards incompatible change. To fix, simply use
544 ``--search-root`` anywhere you were previously using ``--root``.
545 - :bug:`516 major` Remove the CLI parser ambiguity rule regarding flag-like
546 tokens which are seen after an optional-value flag (e.g. ``inv task
547 --optionally-takes-a-value --some-other-flag``.) Previously, any flag-like
548 value in such a spot was considered ambiguous and raised a
549 `~invoke.exceptions.ParseError`. Now, the surrounding parse context is used
550 to resolve the ambiguity, and no error is raised.
551
552 .. warning::
553 This behavior is backwards incompatible, but only if you had the minority
554 case where users frequently *and erroneously* give otherwise-legitimate
555 flag-like values to optional-value arguments, and you rely on the parse
556 errors to notify them of their mistake. (If you don't understand what this
557 means, don't worry, you almost certainly don't need to care!)
558
559 - :support:`515` Ported the test suite from `spec
560 <https://github.com/bitprophet/spec>`_ (`nose
561 <https://nose.readthedocs.io>`_) to `pytest-relaxed
562 <https://github.com/bitprophet/pytest-relaxed>`_ (`pytest
563 <https://pytest.org>`_) as pytest basically won the test-runner war against
564 nose & has greater mindshare, more shiny toys, etc.
565 - :support:`-` Rename ``invoke.platform`` to ``invoke.terminals``; it was
566 inadvertently shadowing the ``platform`` standard library builtin module.
567 This was not causing any bugs we are aware of, but it is still poor hygiene.
568
569 .. warning::
570 This change is technically backwards incompatible. We don't expect many
571 users import ``invoke.platform`` directly, but if you are, take note.
572
573 - :bug:`- major` (partially re: :issue:`449`) Update error message around
574 missing positional arguments so it actually lists them. Includes a minor
575 tweak to the API of `~invoke.parser.context.ParserContext`, namely changing
576 ``needs_positional_arguments`` (bool) to ``missing_positional_arguments``
577 (list).
578 - :release:`0.22.1 <2018-01-29>`
579 - :bug:`342` Accidentally hardcoded ``Collection`` instead of ``cls`` in
580 `Collection.from_module <invoke.collection.Collection.from_module>` (an
581 alternate constructor and therefore a classmethod.) This made it rather hard
582 to properly subclass `~invoke.collection.Collection`. Report and initial
583 patch courtesy of Luc Saffre.
584 - :support:`433 backported` Add -dev and -nightly style Python versions to our
585 Travis builds. Thanks to ``@SylvainDe`` for the contribution.
586 - :bug:`437` When merging configuration levels together (which uses
587 `copy.copy` by default), pass file objects by reference so they don't get
588 closed. Catch & patch by Paul Healy.
589 - :support:`469 backported` Fix up the :ref:`doc/example
590 <customizing-config-defaults>` re: subclassing `~invoke.config.Config`.
591 Credit: ``@Aiky30``.
592 - :bug:`488` Account for additional I/O related ``OSError`` error strings
593 when attempting to capture only this specific subtype of error. This should
594 fix some issues with less common libc implementations such as ``musl`` (as
595 found on e.g. Alpine Linux.) Thanks to Rajitha Perera for the report.
596 - :release:`0.22.0 <2017-11-29>`
597 - :bug:`407 major` (also :issue:`494`, :issue:`67`) Update the default value of
598 the ``run.shell`` config value so that it reflects a Windows-appropriate
599 value (specifically, the ``COMSPEC`` env var or a fallback of ``cmd.exe``) on
600 Windows platforms. This prevents Windows users from being forced to always
601 ship around configuration-level overrides.
602
603 Thanks to Maciej 'maQ' Kusz for the original patchset, and to ``@thebjorn``
604 and Garrett Jenkins for providing lots of feedback.
605 - :bug:`- major` Iterable-type CLI args were actually still somewhat broken &
606 were 'eating' values after themselves in the parser stream (thus e.g.
607 preventing parsing of subsequent tasks or flags.) This has been fixed.
608 - :support:`364` Drop Python 2.6 and Python 3.3 support, as these versions now
609 account for only very low percentages of the userbase and are unsupported (or
610 about to be unsupported) by the rest of the ecosystem, including ``pip``.
611
612 This includes updating documentation & packaging metadata as well as taking
613 advantage of basic syntax additions like set literals/comprehensions (``{1,
614 2, 3}`` instead of ``set([1, 2, 3])``) and removing positional string
615 argument specifiers (``"{}".format(val)`` instead of ``"{0}".format(val)``).
616
617 - :release:`0.21.0 <2017-09-18>`
618 - :feature:`132` Implement 'iterable' and 'incrementable' CLI flags, allowing
619 for invocations like ``inv mytask --listy foo --listy bar`` (resulting in a
620 call like ``mytask(listy=['foo', 'bar'])``) or ``inv mytask -vvv`` (resulting
621 in e.g. ``mytask(verbose=3)``. Specifically, these require use of the new
622 :ref:`iterable <iterable-flag-values>` and :ref:`incrementable
623 <incrementable-flag-values>` arguments to `@task <invoke.tasks.task>` - see
624 those links to the conceptual docs for details.
625 - :release:`0.20.4 <2017-08-14>`
626 - :bug:`-` The behavior of `Config <invoke.config.Config>` when ``lazy=True``
627 didn't match that described in the API docs, after the recent updates to its
628 lifecycle. (Specifically, any config data given to the constructor was not
629 visible in the resulting instance until ``merge()`` was explicitly called.)
630 This has been fixed, along with other related minor issues.
631 - :release:`0.20.3 <2017-08-04>`
632 - :bug:`467` (Arguably also a feature, but since it enables behavior users
633 clearly found intuitive, we're considering it a bug.) Split up the parsing
634 machinery of `Program <invoke.program.Program>` and pushed the `Collection
635 <invoke.collection.Collection>`-making out of `Loader
636 <invoke.loader.Loader>`. Combined, this allows us to honor the project-level
637 config file *before* the second (task-oriented) CLI parsing step, instead of
638 after.
639
640 For example, this means you can turn off ``auto_dash_names`` in your
641 per-project configs and not only in your system or user configs.
642
643 Report again courtesy of Luke Orland.
644
645 .. warning::
646 This is a backwards incompatible change *if* you were subclassing and
647 overriding any of the affected methods in the ``Program`` or ``Loader``
648 classes.
649
650 - :release:`0.20.2 <2017-08-02>`
651 - :bug:`465` The ``tasks.auto_dash_names`` config option added in ``0.20.0``
652 wasn't being fully honored when set to ``False``; this has been fixed. Thanks
653 to Luke Orland for the report.
654 - :release:`0.20.1 <2017-07-27>`
655 - :bug:`-` Fix a broken ``six.moves`` import within ``invoke.util``; was
656 causing ``ImportError`` in environments without an external copy of ``six``
657 installed.
658
659 The dangers of one's local and CI environments all pulling down packages that
660 use ``six``! It's everywhere!
661 - :release:`0.20.0 <2017-07-27>`
662 - :feature:`-` (required to support :issue:`310` and :issue:`329`) Break up the
663 `~invoke.config.Config` lifecycle some more, allowing it to gradually load
664 configuration vectors; this allows the CLI machinery
665 (`~invoke.executor.Executor`) to honor configuration settings from config
666 files which impact how CLI parsing and task loading behaves.
667
668 Specifically, this adds more public ``Config.load_*`` methods, which in
669 tandem with the ``lazy`` kwarg to ``__init__`` (formerly ``defer_post_init``,
670 see below) allow full control over exactly when each config level is loaded.
671
672 .. warning::
673 This change may be backwards incompatible if you were using or subclassing
674 the `~invoke.config.Config` class in any of the following ways:
675
676 - If you were passing ``__init__`` kwargs such as ``project_home`` or
677 ``runtime_path`` and expecting those files to auto-load, they no longer
678 do; you must explicitly call `~invoke.config.Config.load_project` and/or
679 `~invoke.config.Config.load_runtime` explicitly.
680 - The ``defer_post_init`` keyword argument to ``Config.__init__`` has been
681 renamed to ``lazy``, and controls whether system/user config files are
682 auto-loaded.
683 - ``Config.post_init`` has been removed, in favor of explicit/granular use
684 of the ``load_*`` family of methods.
685 - All ``load_*`` methods now call ``Config.merge`` automatically by default
686 (previously, merging was deferred to the end of most config related
687 workflows.)
688
689 This should only be a problem if your config contents are extremely large
690 (it's an entirely in-memory dict-traversal operation) and can be avoided
691 by specifying ``merge=False`` to any such method. (Note that you must, at
692 some point, call `~invoke.config.Config.merge` in order for the config
693 object to work normally!)
694
695 - :feature:`310` (also :issue:`455`, :issue:`291`) Allow configuring collection
696 root directory & module name via configuration files (previously, they were
697 only configurable via CLI flags or generating a custom
698 `~invoke.program.Program`.)
699 - :feature:`329` All task and collection names now have underscores turned into
700 dashes automatically, as task parameters have been for some time. This
701 impacts ``--list``, ``--help``, and of course the parser. For details, see
702 :ref:`dashes-vs-underscores`.
703
704 This behavior is controlled by a new config setting,
705 ``tasks.auto_dash_names``, which can be set to ``False`` to go back to the
706 classic behavior.
707
708 Thanks to Alexander Artemenko for the initial feature request.
709 - :bug:`396 major` ``Collection.add_task(task, aliases=('other', 'names')`` was
710 listed in the conceptual documentation, but not implemented (technically, it
711 was removed at some point and never reinstated.) It has been (re-)added and
712 now exists. Thanks to ``@jenisys`` for the report.
713
714 .. warning::
715 This technically changes argument order for `Collection.add_task
716 <invoke.collection.Collection.add_task>`, so be aware if you were using
717 positional arguments!
718
719 - :bug:`- major` Display of hidden subprocess output when a command
720 execution failed (end-of-session output starting with ``Encountered a bad
721 command exit code!``) was liable to display encoding errors (e.g. ``'ascii'
722 codec can't encode character ...``) when that output was not
723 ASCII-compatible.
724
725 This problem was previously solved for *non-hidden* (mirrored) subprocess
726 output, but the fix (encode the data with the local encoding) had not been
727 applied to exception display. Now it's applied in both cases.
728 - :feature:`322` Allow users to completely disable mirroring of stdin to
729 subprocesses, by specifying ``False`` for the ``run.in_stream`` config
730 setting and/or keyword argument.
731
732 This can help prevent problems when running Invoke under systems that have no
733 useful standard input and which otherwise defeat our pty/fileno related
734 detection.
735 - :release:`0.19.0 <2017-06-19>`
736 - :feature:`-` Add `MockContext.set_result_for
737 <invoke.context.MockContext.set_result_for>` to allow massaging a mock
738 Context's configured results after instantiation.
739 - :release:`0.18.1 <2017-06-07>`
740 - :bug:`-` Update Context internals re: command execution & configuration of
741 runner subclasses, to work better in client libraries such as Fabric 2.
742
743 .. note::
744 If you were using the undocumented ``runner`` configuration value added
745 in :issue:`446`, it is now ``runners.local``.
746
747 .. warning::
748 This change modifies the internals of methods like
749 `~invoke.context.Context.run` and `~invoke.context.Context.sudo`; users
750 maintaining their own subclasses should be aware of possible breakage.
751
752 - :release:`0.18.0 <2017-06-02>`
753 - :feature:`446` Implement `~invoke.context.Context.cd` and
754 `~invoke.context.Context.prefix` context managers (as methods on the
755 not-that-one-the-other-one `~invoke.context.Context` class.) These are based
756 on similar functionality in Fabric 1.x. Credit: Ryan P Kilby.
757 - :support:`448` Fix up some config-related tests that have been failing on
758 Windows for some time. Thanks to Ryan P Kilby.
759 - :feature:`205` Allow giving core flags like ``--help`` after tasks to trigger
760 per-task help. Previously, only ``inv --help taskname`` worked.
761
762 .. note::
763 Tasks with their own ``--help`` flags won't be able to leverage this
764 feature - the parser will still interpret the flag as being per-task and
765 not global. This may change in the future to simply throw an exception
766 complaining about the ambiguity. (Feedback welcome.)
767
768 - :feature:`444` Add support for being used as ``python -m invoke <args>`` on
769 Python 2.7 and up. Thanks to Pekka Klärck for the feature request.
770 - :release:`0.17.0 <2017-05-05>`
771 - :bug:`439 major` Avoid placing stdin into bytewise read mode when it looks
772 like Invoke has been placed in the background by a shell's job control
773 system; doing so was causing the shell to pause the Invoke process (e.g. with
774 a message like ``suspended (tty output)``.) Reported by Tuukka Mustonen.
775 - :bug:`425 major` Fix ``Inappropriate ioctl for device`` errors (usually
776 ``OSError``) when running Invoke without a tty-attached stdin (i.e. when run
777 under 'headless' continuous integration systems or simply as e.g. ``inv
778 sometask < /dev/null`` (redirected stdin.) Thanks to Javier Domingo Cansino
779 for the report & Tuukka Mustonen for troubleshooting assistance.
780 - :feature:`-` Add a ``user`` kwarg & config parameter to
781 `Context.sudo <invoke.context.Context.sudo>`, which corresponds roughly to
782 ``sudo -u <user> <command>``.
783 - :bug:`440 major` Make sure to skip a call to ``struct``/``ioctl`` on Windows
784 platforms; otherwise certain situations inside ``run`` calls would trigger
785 import errors. Thanks to ``@chrisc11`` for the report.
786 - :release:`0.16.3 <2017-04-18>`
787 - :bug:`-` Even more setup.py related tomfoolery.
788 - :release:`0.16.2 <2017-04-18>`
789 - :bug:`-` Deal with the fact that PyPI's rendering of Restructured Text has no
790 idea about our fancy new use of Sphinx's doctest module. Sob.
791 - :release:`0.16.1 <2017-04-18>`
792 - :bug:`-` Fix a silly typo preventing proper rendering of the packaging
793 ``long_description`` (causing an effectively blank PyPI description.)
794 - :release:`0.16.0 <2017-04-18>`
795 - :feature:`232` Add support for ``.yml``-suffixed config files (in addition to
796 ``.yaml``, ``.json`` and ``.py``.) Thanks to Matthias Lehmann for the
797 original request & Greg Back for an early patch.
798 - :feature:`418` Enhance ability of client libraries to override config
799 filename prefixes. This includes modifications to related functionality, such
800 as how env var prefixes are configured.
801
802 .. warning::
803 **This is a backwards incompatible change** if:
804
805 - you were relying on the ``env_prefix`` keyword argument to
806 `Config.__init__ <invoke.config.Config.__init__>`; it is now the
807 ``prefix`` or ``env_prefix`` class attribute, depending.
808 - or the kwarg/attribute of the same name in `Program.__init__
809 <invoke.program.Program.__init__>`; you should now be subclassing
810 ``Config`` and using its ``env_prefix`` attribute;
811 - or if you were relying on how standalone ``Config`` objects defaulted to
812 having a ``None`` value for ``env_prefix``, and thus loaded env vars
813 without an ``INVOKE_`` style prefix.
814
815 See new documentation for this functionality at
816 :ref:`customizing-config-defaults` for details.
817
818 - :feature:`309` Overhaul how task execution contexts/configs are handled, such
819 that all contexts in a session now share the same config object, and thus
820 user modifications are preserved between tasks. This has been done in a
821 manner that should not break things like collection-based config (which may
822 still differ from task to task.)
823
824 .. warning::
825 **This is a backwards incompatible change** if you were relying on the
826 post-0.12 behavior of cloning config objects between each task execution.
827 Make sure to investigate if you find tasks affecting one another in
828 unexpected ways!
829
830 - :support:`-` Fixed some Python 2.6 incompatible string formatting that snuck
831 in recently.
832 - :feature:`-` Switched the order of the first two arguments of
833 `Config.__init__ <invoke.config.Config.__init__>`, so that the ``overrides``
834 kwarg becomes the first positional argument.
835
836 This supports the common use case of making a `Config <invoke.config.Config>`
837 object that honors the system's core/global defaults; previously, because
838 ``defaults`` was the first argument, you'd end up replacing those core
839 defaults instead of merging with them.
840
841 .. warning::
842 **This is a backwards incompatible change** if you were creating custom
843 ``Config`` objects via positional, instead of keyword, arguments. It should
844 have no effect otherwise.
845
846 - :feature:`-` `Context.sudo <invoke.context.Context.sudo>` no longer prompts
847 the user when the configured sudo password is empty; thus, an empty sudo
848 password and a ``sudo`` program configured to require one will result in an
849 exception.
850
851 The runtime prompting for a missing password was a temporary holdover from
852 Fabric v1, and in retrospect is undesirable. We may add it back in as an
853 opt-in behavior (probably via subclassing) in the future if anybody misses
854 it.
855
856 .. warning::
857 **This is a backwards incompatible change**, if you were relying on
858 ``sudo()`` prompting you for your password (vs configuring it). If you
859 *were* doing that, you can simply switch to ``run("sudo <command>")`` and
860 respond to the subprocess' sudo prompt by hand instead.
861
862 - :feature:`-` `Result <invoke.runners.Result>` and `UnexpectedExit
863 <invoke.exceptions.UnexpectedExit>` objects now have a more useful ``repr()``
864 (and in the case of ``UnexpectedExit``, a distinct ``repr()`` from their
865 preexisting ``str()``.)
866 - :bug:`432 major` Tighten application of IO thread ``join`` timeouts (in `run
867 <invoke.runners.Runner.run>`) to only happen when :issue:`351` appears
868 actually present. Otherwise, slow/overworked IO threads had a chance of being
869 joined before truly reading all data from the subprocess' pipe.
870 - :bug:`430 major` Fallback importing of PyYAML when Invoke has been installed
871 without its vendor directory, was still trying to import the vendorized
872 module names (e.g. ``yaml2`` or ``yaml3`` instead of simply ``yaml``). This
873 has been fixed, thanks to Athmane Madjoudj.
874 - :release:`0.15.0 <2017-02-14>`
875 - :bug:`426 major` `DataProxy <invoke.config.DataProxy>` based classes like
876 `Config <invoke.config.Config>` and `Context <invoke.context.Context>` didn't
877 like being `pickled <pickle>` or `copied <copy.copy>` and threw
878 ``RecursionError``. This has been fixed.
879 - :feature:`-` `Config <invoke.config.Config>`'s internals got cleaned up
880 somewhat; end users should not see much of a difference, but advanced
881 users or authors of extension code may notice the following:
882
883 - Direct modification of config data (e.g. ``myconfig.section.subsection.key
884 = 'value'`` in user/task code) is now stored in its own config 'level'/data
885 structure; previously such modifications simply mutated the central,
886 'merged' config cache. This makes it much easier to determine where a final
887 observed value came from, and prevents accidental data loss.
888 - Ditto for deleted values.
889 - Merging/reconciliation of the config levels now happens automatically when
890 data is loaded or modified, which not only simplifies the object's
891 lifecycle a bit but allows the previous change to function without
892 requiring users to call ``.merge()`` after every modification.
893
894 - :bug:`- major` Python 3's hashing rules differ from Python 2, specifically:
895
896 A class that overrides ``__eq__()`` and does not define ``__hash__()`` will
897 have its ``__hash__()`` implicitly set to None.
898
899 `Config <invoke.config.Config>` (specifically, its foundational class
900 `DataProxy <invoke.config.DataProxy>`) only defined ``__eq__`` which,
901 combined with the above behavior, meant that ``Config`` objects appeared to
902 hash successfully on Python 2 but yielded ``TypeErrors`` on Python 3.
903
904 This has been fixed by explicitly setting ``__hash__ = None`` so that the
905 objects do not hash on either interpreter (there are no good immutable
906 attributes by which to define hashability).
907 - :bug:`- major` Configuration keys named ``config`` were inadvertently
908 exposing the internal dict representation of the containing config object,
909 instead of displaying the actual value stored in that key. (Thus, a set
910 config of ``mycontext.foo.bar.config`` would act as if it was the key/value
911 contents of the ``mycontext.foo.bar`` subtree.) This has been fixed.
912 - :feature:`421` Updated `Config.clone <invoke.config.Config.clone>` (and a few
913 other related areas) to replace use of `copy.deepcopy` with a less-rigorous
914 but also less-likely-to-explode recursive dict copier. This prevents
915 frustrating ``TypeErrors`` while still preserving barriers between different
916 tasks' configuration values.
917 - :feature:`-` `Config.clone <invoke.config.Config.clone>` grew a new ``into``
918 kwarg allowing client libraries with their own `~invoke.config.Config`
919 subclasses to easily "upgrade" vanilla Invoke config objects into their local
920 variety.
921 - :bug:`419 major` Optional parser arguments had a few issues:
922
923 - The :ref:`conceptual docs about CLI parsing <optional-values>` mentioned
924 them, but didn't actually show via example how to enable the feature,
925 implying (incorrectly) that they were active always by default. An example
926 has been added.
927 - Even when enabled, they did not function correctly when their default
928 values were of type ``bool``; in this situation, trying to give a value (vs
929 just giving the flag name by itself) caused a parser error. This has been
930 fixed.
931
932 Thanks to ``@ouroboroscoding`` for the report.
933 - :support:`204` (via :issue:`412`) Fall back to globally-installed copies of
934 our vendored dependencies, if the import from the ``vendor`` tree fails. In
935 normal situations this won't happen, but it allows advanced users or
936 downstream maintainers to nuke ``vendor/`` and prefer explicitly installed
937 packages of e.g. ``six``, ``pyyaml`` or ``fluidity``. Thanks to Athmane
938 Madjoudj for the patch.
939 - :bug:`- major` Fix configuration framework such that nested or dict-like
940 config values may be compared with regular dicts. Previously, doing so caused
941 an ``AttributeError`` (as regular dicts lack a ``.config``).
942 - :bug:`413 major` Update behavior of ``DataProxy`` (used within
943 `~invoke.context.Context` and `~invoke.config.Config`) again, fixing two
944 related issues:
945
946 - Creating new configuration keys via attribute access wasn't possible: one
947 had to do ``config['foo'] = 'bar'`` because ``config.foo = 'bar'`` would
948 set a real attribute instead of touching configuration.
949 - Supertypes' attributes weren't being considered during the "is this a real
950 attribute on ``self``?" test, leading to different behavior between a
951 nested config-value-as-attribute and a top-level Context/Config one.
952
953 - :release:`0.14.0 <2016-12-05>`
954 - :bug:`349 major` Display the string representation of
955 `~invoke.exceptions.UnexpectedExit` when handling it inside of
956 `~invoke.program.Program` (including regular ``inv``), if any output was
957 hidden during the ``run`` that generated it.
958
959 Previously, we only exited with the exception's stored exit code, meaning
960 failures of ``run(..., hide=True)`` commands were unexpectedly silent.
961 (Library-style use of the codebase didn't have this problem, since tracebacks
962 aren't muted.)
963
964 While implementing this change, we also tweaked the overall display of
965 ``UnexpectedExit`` so it's a bit more consistent & useful:
966
967 - noting "hey, you ran with ``pty=True``, so there's no stderr";
968 - showing only the last 10 lines of captured output in the error message
969 (users can, of course, always manually handle the error & access the full
970 thing if desired);
971 - only showing a given stream when it was not already printed to the user's
972 terminal (i.e. if ``hide=False``, no captured output is shown in the error
973 text; if ``hide='stdout'``, only stdout is shown in the error text; etc.)
974
975 Thanks to Patrick Massot for the original bug report.
976
977 - :feature:`-` Expose the (normalized) value of `~invoke.runners.Runner.run`'s
978 ``hide`` parameter in its return-value `~invoke.runners.Result` objects.
979 - :bug:`288 major` Address a bug preventing reuse of Invoke as a custom
980 binstub, by moving ``--list`` into the "core args" set of flags present on
981 all Invoke-derived binstubs. Thanks to Jordon Mears for catch & patch.
982 - :bug:`283 major` Fix the concepts/library docs so the example of an explicit
983 ``namespace=`` argument correctly shows wrapping an imported task module in a
984 `~invoke.collection.Collection`. Thanks to ``@zaiste`` for the report.
985 - :bug:`- major` Fix ``DataProxy`` (used within `~invoke.context.Context` and
986 `~invoke.config.Config`) so that real attributes and methods which are
987 shadowed by configuration keys, aren't proxied to the config during regular
988 attribute get/set. (Such config keys are thus required to be accessed via
989 dict-style only, or (on `~invoke.context.Context`) via the explicit
990 ``.config`` attribute.)
991 - :bug:`58 major` Work around bugs in ``select()`` when handling subprocess
992 stream reads, which was causing poor behavior in many nontrivial interactive
993 programs (such as ``vim`` and other fullscreen editors, ``python`` and other
994 REPLs/shells, etc). Such programs should now be largely indistinguishable
995 from their behavior when run directly from a user's shell.
996 - :feature:`406` Update handling of Ctrl-C/``KeyboardInterrupt``, and
997 subprocess exit status pass-through, to be more correct than before:
998
999 - Submit the interrupt byte sequence ``\x03`` to stdin of all subprocesses,
1000 instead of sending ``SIGINT``.
1001
1002 - This results in behavior closer to that of truly pressing Ctrl-C when
1003 running subprocesses directly; for example, interactive programs like
1004 ``vim`` or ``python`` now behave normally instead of prematurely
1005 exiting.
1006 - Of course, programs that would normally exit on Ctrl-C will still do
1007 so!
1008
1009 - The exit statuses of subprocesses run with ``pty=True`` are more rigorously
1010 checked (using `os.WIFEXITED` and friends), allowing us to surface the real
1011 exit values of interrupted programs instead of manually assuming exit code
1012 ``130``.
1013
1014 - Typically, this will be exit code ``-2``, but it is system dependent.
1015 - Other, non-Ctrl-C-driven signal-related exits under PTYs should behave
1016 better now as well - previously they could appear to exit ``0``!
1017
1018 - Non-subprocess-related ``KeyboardInterrupt`` (i.e. those generated when
1019 running top level Python code outside of any ``run`` function calls)
1020 will now trigger exit code ``1``, as that is how the Python interpreter
1021 typically behaves if you ``KeyboardInterrupt`` it outside of a live
1022 REPL.
1023
1024 .. warning::
1025 These changes are **backwards incompatible** if you were relying on the
1026 "exits ``130``" behavior added in version 0.13, or on the (incorrect)
1027 ``SIGINT`` method of killing pty-driven subprocesses on Ctrl-C.
1028
1029 - :bug:`- major` Correctly raise ``TypeError`` when unexpected keyword
1030 arguments are given to `~invoke.runners.Runner.run`.
1031 - :feature:`-` Add a `~invoke.context.MockContext` class for easier testing of
1032 user-written tasks and related client code. Includes adding a
1033 :ref:`conceptual document on how to test Invoke-using code
1034 <testing-user-code>`.
1035 - :feature:`-` Update implementation of `~invoke.runners.Result` so it has
1036 default values for all parameters/attributes. This allows it to be more
1037 easily used when mocking ``run`` calls in client libraries' tests.
1038
1039 .. warning::
1040 This is a backwards incompatible change if you are manually instantiating
1041 `~invoke.runners.Result` objects with positional arguments: positional
1042 argument order has changed. (Compare the API docs between versions to see
1043 exactly how.)
1044
1045 - :feature:`294` Implement `Context.sudo <invoke.context.Context.sudo>`, which
1046 wraps `~invoke.context.Context.run` inside a ``sudo`` command. It is capable
1047 of auto-responding to ``sudo``'s password prompt with a configured password,
1048 and raises a specific exception (`~invoke.exceptions.AuthFailure`) if that
1049 password is rejected.
1050 - :feature:`369` Overhaul the autoresponse functionality for `~invoke.run` so
1051 it's significantly more extensible, both for its own sake and as part of
1052 implementing :issue:`294` (see its own changelog entry for details).
1053
1054 .. warning::
1055 This is a backwards incompatible change: the ``responses`` kwarg to
1056 ``run()`` is now ``watchers``, and accepts a list of
1057 `~invoke.watchers.StreamWatcher` objects (such as
1058 `~invoke.watchers.Responder`) instead of a dict.
1059
1060 If you were using ``run(..., responses={'pattern': 'response'}``
1061 previously, just update to instead use ``run(...,
1062 watchers=[Responder('pattern', 'response')])``.
1063
1064 - :bug:`- major` Fix a bug in `Config.clone <invoke.config.Config.clone>` where
1065 it was instantiating a new ``Config`` instead of a member of the subclass.
1066 - :release:`0.13.0 <2016-06-09>`
1067 - :feature:`114` Ripped off the band-aid and removed non-contextualized tasks
1068 as an option; all tasks must now be contextualized (defined as ``def
1069 mytask(context, ...)`` - see :ref:`defining-and-running-task-functions`) even
1070 if not using the context. This simplifies the implementation as well as
1071 users' conceptual models. Thanks to Bay Grabowski for the patch.
1072
1073 .. warning:: This is a backwards incompatible change!
1074
1075 - :bug:`350 major` (also :issue:`274`, :issue:`241`, :issue:`262`,
1076 :issue:`242`, :issue:`321`, :issue:`338`) Clean up and reorganize
1077 encoding-related parts of the code to avoid some of the more common or
1078 egregious encode/decode errors surrounding clearly non-ASCII-compatible text.
1079 Bug reports, assistance, feedback and code examples courtesy of Paul Moore,
1080 Vlad Frolov, Christian Aichinger, Fotis Gimian, Daniel Nunes, and others.
1081 - :bug:`351 major` Protect against ``run`` deadlocks involving exceptions in
1082 I/O threads & nontrivial amounts of unread data in the corresponding
1083 subprocess pipe(s). This situation should now always result in exceptions
1084 instead of hangs.
1085 - :feature:`259` (also :issue:`280`) Allow updating (or replacing) subprocess
1086 shell environments, via the ``env`` and ``replace_env`` kwargs to
1087 `~invoke.runners.Runner.run`. Thanks to Fotis Gimian for the report,
1088 ``@philtay`` for an early version of the final patch, and Erich Heine & Vlad
1089 Frolov for feedback.
1090 - :feature:`67` Added ``shell`` option to `~invoke.runners.Runner.run`,
1091 allowing control of the shell used when invoking commands. Previously,
1092 ``pty=True`` used ``/bin/bash`` and ``pty=False`` (the default) used
1093 ``/bin/sh``; the new unified default value is ``/bin/bash``.
1094
1095 Thanks to Jochen Breuer for the report.
1096 - :bug:`152 major` (also :issue:`251`, :issue:`331`) Correctly handle
1097 ``KeyboardInterrupt`` during `~invoke.runners.Runner.run`, re: both mirroring
1098 the interrupt signal to the subprocess *and* capturing the local exception
1099 within Invoke's CLI handler (so there's no messy traceback, just exiting with
1100 code ``130``).
1101
1102 Thanks to Peter Darrow for the report, and to Mika Eloranta & Máté Farkas for
1103 early versions of the patchset.
1104 - :support:`319` Fixed an issue resulting from :issue:`255` which
1105 caused problems with how we generate release wheels (notably, some releases
1106 such as 0.12.1 fail when installing from wheels on Python 2).
1107
1108 .. note::
1109 As part of this fix, the next release will distribute individual Python 2
1110 and Python 3 wheels instead of one 'universal' wheel. This change should be
1111 transparent to users.
1112
1113 Thanks to ``@ojos`` for the initial report and Frazer McLean for some
1114 particularly useful feedback.
1115 - :release:`0.12.2 <2016-02-07>`
1116 - :support:`314 backported` (Partial fix.) Update ``MANIFEST.in`` so source
1117 distributions include some missing project-management files (e.g. our
1118 internal ``tasks.py``). This makes unpacked sdists more useful for things
1119 like running the doc or build tasks.
1120 - :bug:`303` Make sure `~invoke.run` waits for its IO worker threads to cleanly
1121 exit (such as allowing a ``finally`` block to revert TTY settings) when
1122 ``KeyboardInterrupt`` (or similar) aborts execution in the main thread.
1123 Thanks to Tony S Yu and Máté Farkas for the report.
1124 - :release:`0.12.1 <2016-02-03>`
1125 - :bug:`308` Earlier changes to TTY detection & its use in determining features
1126 such as stdin pass-through, were insufficient to handle edge cases such as
1127 nested Invoke sessions or piped stdin to Invoke processes. This manifested as
1128 hangs and ``OSError`` messages about broken pipes.
1129
1130 The issue has been fixed by overhauling all related code to use more specific
1131 and accurate checks (e.g. examining just ``fileno`` and/or just ``isatty``).
1132
1133 Thanks to Tuukka Mustonen and Máté Farkas for the report (and for enduring
1134 the subsequent flood of the project maintainer's stream-of-consciousness
1135 ticket updates).
1136 - :bug:`305` (also :issue:`306`) Fix up some test-suite issues causing failures
1137 on Windows/Appveyor. Thanks to Paul Moore.
1138 - :bug:`289` Handful of issues, all fallout from :issue:`289`, which failed to
1139 make it out the door for 0.12.0. More are on the way but these should address
1140 blockers for some users:
1141
1142 * Windows support for the new stdin replication functionality (this was
1143 totally blocking Windows users, as reported in :issue:`302` - sorry!);
1144 * Stdin is now mirrored to stdout when no PTY is present, so you can see
1145 what you're typing (plus a new `~invoke.runners.Runner.run` option and
1146 config param, ``echo_stdin``, allowing user override of this behavior);
1147 * Exposed the stdin read loop's sleep time as `Runner.input_sleep
1148 <invoke.runners.Runner.input_sleep>`;
1149 * Sped up some tests a bit.
1150
1151 - :release:`0.12.0 <2016-01-12>`
1152 - :bug:`257 major` Fix a RecursionError under Python 3 due to lack of
1153 ``__deepcopy__`` on `~invoke.tasks.Call` objects. Thanks to Markus
1154 Zapke-Gründemann for initial report and Máté Farkas for the patch.
1155 - :support:`265` Update our Travis config to select its newer build
1156 infrastructure and also run on PyPy3. Thanks to Omer Katz.
1157 - :support:`254` Add an ``exclude`` option in our ``setup.py`` so setuptools
1158 doesn't try loading our vendored PyYAML's Python 2 sub-package under Python 3
1159 (or vice versa - though all reports were from Python 3 users). Thanks to
1160 ``@yoshiya0503`` for catch & initial patch.
1161 - :feature:`68` Disable Python's bytecode caching by default, as it complicates
1162 our typical use case (frequently-changing .py files) and offers little
1163 benefit for human-facing startup times. Bytecode caching can be explicitly
1164 re-enabled by specifying ``--write-pyc`` at runtime. Thanks to Jochen Breuer
1165 for feature request and ``@brutus`` for initial patchset.
1166 - :support:`144` Add code-coverage reporting to our CI builds (albeit `CodeCov
1167 <https://codecov.io>`_ instead of `coveralls.io <https://coveralls.io>`_).
1168 Includes rejiggering our project-specific coverage-generating tasks. Thanks
1169 to David Baumgold for the original request/PR and to Justin Abrahms for the
1170 tipoff re: CodeCov.
1171 - :bug:`297 major` Ignore leading and trailing underscores when turning task
1172 arguments into CLI flag names.
1173 - :bug:`296 major` Don't mutate ``sys.path`` on collection load if task's
1174 parent directory is already on ``sys.path``.
1175 - :bug:`295 major` Make sure that `~invoke.run`'s ``hide=True`` also disables
1176 echoing. Otherwise, "hidden" helper ``run`` calls will still pollute output
1177 when run as e.g. ``invoke --echo ...``.
1178 - :feature:`289` (also :issue:`263`) Implement :ref:`autoresponding
1179 <autoresponding>` for `~invoke.run`.
1180 - :support:`-` Removed official Python 3.2 support; sibling projects also did
1181 this recently, it's simply not worth the annoyance given the userbase size.
1182 - :feature:`228` (partial) Modified and expanded implementation of
1183 `~invoke.executor.Executor`, `~invoke.tasks.Task` and `~invoke.tasks.Call` to
1184 make implementing task parameterization easier.
1185 - :support:`-` Removed the ``-H`` short flag, leaving just ``--hide``. This was
1186 done to avoid conflicts with Fabric's host-oriented ``-H`` flag. Favoritism
1187 is real! Apologies.
1188
1189 .. warning:: This change is backwards compatible if you used ``-H``.
1190
1191 - :feature:`173` Overhauled top level CLI functionality to allow reusing
1192 Invoke for distinct binaries, optionally with bundled task namespaces as
1193 subcommands. As a side effect, this functionality is now much more extensible
1194 to boot. Thanks to Erich Heine for feedback/suggestions during development.
1195
1196 .. warning::
1197 This change is backwards incompatible if you imported anything from the
1198 ``invoke.cli`` module (which is now rearchitected as
1199 `~invoke.program.Program`). It should be transparent to everybody else.
1200
1201 .. seealso:: :ref:`reusing-as-a-binary`
1202
1203 - :bug:`- major` Fixed a bug in the parser where ``invoke --takes-optional-arg
1204 avalue --anotherflag`` was incorrectly considering ``--anotherflag`` to be an
1205 ambiguity error (as if ``avalue`` had not been given to
1206 ``--takes-optional-arg``.
1207 - :release:`0.11.1 <2015-09-07>`
1208 - :support:`- backported` Fix incorrect changelog URL in package metadata.
1209 - :release:`0.11.0 <2015-09-07>`
1210 - :feature:`-` Add a ``.command`` attribute to `~invoke.runners.Result` to
1211 preserve the command executed for post-execution introspection.
1212 - :feature:`-` Detect local controlling terminal size
1213 (`~invoke.terminals.pty_size`) and apply that information when creating
1214 pseudoterminals in `~invoke.run` when ``pty=True``.
1215 - :bug:`- major` Display stdout instead of stderr in the ``repr()`` of
1216 `~invoke.exceptions.Failure` objects, when a pseudo-terminal was used.
1217 Previously, failure display focused on the stderr stream, which is always
1218 empty under pseudo-terminals.
1219 - :bug:`- major` Correctly handle situations where `sys.stdin` has been
1220 replaced with an object lacking ``.fileno`` (e.g., some advanced Python
1221 shells, headless code execution tools, etc). Previously, this situation
1222 resulted in an ``AttributeError``.
1223 - :bug:`- major` Capture & reraise exceptions generated by command execution I/O
1224 threads, in the main thread, as a `~invoke.exceptions.ThreadException`.
1225 - :feature:`235` Allow custom stream objects to be used in `~invoke.run` calls,
1226 to be used instead of the defaults of ``sys.stdout``/``sys.stderr``.
1227
1228 .. warning::
1229 This change required a major cleanup/rearchitecture of the command
1230 execution implementation. The vendored ``pexpect`` module has been
1231 completely removed and the API of the `~invoke.runners.Runner` class has
1232 changed dramatically (though **the API for run() itself has not**).
1233
1234 Be aware there may be edge-case terminal behaviors which have changed or
1235 broken as a result of removing ``pexpect``. Please report these as bugs! We
1236 expect to crib small bits of what ``pexpect`` does but need concrete test
1237 cases first.
1238
1239 - :bug:`234 major` (also :issue:`243`) Preserve task-module load location when
1240 creating explicit collections with
1241 `~invoke.collection.Collection.from_module`; when this was not done,
1242 project-local config files were not loading correctly. Thanks to ``@brutus``
1243 and Jan Willems for initial report & troubleshooting, and to Greg Back for
1244 identifying the fix.
1245 - :bug:`237 major` Completion output lacked "inverse" flag names (e.g.
1246 ``--no-myoption`` as a boolean negative version of a defaulting-to-True
1247 boolean ``myoption``). This has been corrected.
1248 - :bug:`239 major` Completion erroneously presented core flags instead of
1249 per-task flags when both are present in the invocation being completed (e.g.
1250 ``inv --debug my_task -<tab>``). This has been fixed.
1251 - :bug:`238 major` (partial fix) Update the ``zsh`` completion script to
1252 account for use of the ``--collection`` core flag.
1253 - :support:`-` Additional rearranging of ``run``/``Runner`` related concerns
1254 for improved subclassing, organization, and use in other libraries,
1255 including:
1256
1257 * Changed the name of the ``runner`` module to ``runners``.
1258 * Moved the top level ``run`` function from its original home in
1259 ``invoke.runner`` to `invoke.__init__ <invoke>`, to reflect the fact that
1260 it's now simply a convenience wrapper around ``Runner``.
1261 * Tweaked the implementation of `~invoke.runners.Runner` so it can
1262 reference `~invoke.context.Context` objects (useful for anticipated
1263 subclasses).
1264
1265 .. warning::
1266 These are backwards incompatible changes if your code was doing any imports
1267 from the ``invoke.runner`` module (including especially
1268 ``invoke.runner.run``, which is now only ``invoke.run``). Function
1269 signatures have **not** changed.
1270
1271 - :support:`224` Add a completion script for the ``fish`` shell, courtesy of
1272 Jaime Marquínez Ferrándiz.
1273 - :release:`0.10.1 <2015-03-17>`
1274 - :support:`- backported` Tweak README to reflect recent(-ish) changes in
1275 ``pip`` re: users who install the development version via ``pip`` instead of
1276 using git.
1277 - :release:`0.10.0 <2015-03-17>`
1278 - :feature:`104` Add core CLI flag ``--complete`` to support shell tab
1279 completion scripts, and add some 'blessed' such scripts for bash (3 and 4)
1280 and zsh. Thanks to Ivan Malison and Andrew Roberts for providing discussion &
1281 early patchsets.
1282 - :support:`-` Reorganize `~invoke.runners.Runner`, `~invoke.runners.Local` and
1283 ``invoke.runner.run`` for improved distribution of responsibilities &
1284 downstream subclassing.
1285
1286 .. warning::
1287 This includes backwards incompatible changes to the API signature of most
1288 members of the ``invoke.runner`` module, including ``invoke.runner.run``.
1289 (However, in the case of ``invoke.runner.run``, the changes are mostly in
1290 the later, optional keyword arguments.)
1291
1292 - :feature:`219` Fall back to non-PTY command execution in situations where
1293 ``pty=True`` but no PTY appears present. See `~invoke.runners.Local` for
1294 details.
1295 - :support:`212` Implement basic linting support using ``flake8``, and apply
1296 formatting changes to satisfy said linting. As part of this shakeup, also
1297 changed all old-style (``%s``) string formatting to new-style (``{0}``).
1298 Thanks to Collin Anderson for the foundational patch.
1299 - :support:`215` (also :issue:`213`, :issue:`214`) Tweak tests & configuration
1300 sections of the code to include Windows compatibility. Thanks to Paul Moore.
1301 - :bug:`201 major` (also :issue:`211`) Replace the old, first-draft gross
1302 monkeypatched Popen code used for ``invoke.runner.run`` with a
1303 non-monkeypatched approach that works better on non-POSIX platforms like
1304 Windows, and also attempts to handle encoding and locale issues more
1305 gracefully (meaning: at all gracefully).
1306
1307 Specifically, the new approach uses threading instead of ``select.select``,
1308 and performs explicit encoding/decoding based on detected or explicitly
1309 expressed encodings.
1310
1311 Major thanks to Paul Moore for an enormous amount of
1312 testing/experimentation/discussion, as well as the bulk of the code changes
1313 themselves.
1314
1315 .. warning::
1316 The top level ``invoke.runner.run`` function has had a minor signature
1317 change: the sixth positional argument used to be ``runner`` and is now
1318 ``encoding`` (with ``runner`` now being the seventh positional argument).
1319
1320 - :feature:`147` Drastically overhaul/expand the configuration system to
1321 account for multiple configuration levels including (but not limited to) file
1322 paths, environment variables, and Python-level constructs (previously the
1323 only option). See :ref:`configuration` for details. Thanks to Erich Heine for
1324 his copious feedback on this topic.
1325
1326 .. warning::
1327 This is technically a backwards incompatible change, though some existing
1328 user config-setting code may continue to work as-is. In addition, this
1329 system may see further updates before 1.0.
1330
1331 - :bug:`191 major` Bypass ``pexpect``'s automatic command splitting to avoid
1332 issues running complex nested/quoted commands under a pty. Credit to
1333 ``@mijikai`` for noticing the problem.
1334 - :bug:`183 major` Task docstrings whose first line started on the same line as
1335 the opening quote(s) were incorrectly presented in ``invoke --help <task>``.
1336 This has been fixed by using `inspect.getdoc`. Thanks to Pekka Klärck for the
1337 catch & suggested fix.
1338 - :bug:`180 major` Empty invocation (e.g. just ``invoke`` with no flags or
1339 tasks, and when no default task is defined) no longer printed help output,
1340 instead complaining about the lack of default task. It now prints help again.
1341 Thanks to Brent O'Connor for the catch.
1342 - :bug:`175 major` ``autoprint`` did not function correctly for tasks stored
1343 in sub-collections; this has been fixed. Credit: Matthias Lehmann.
1344 - :release:`0.9.0 <2014-08-26>`
1345 - :bug:`165 major` Running ``inv[oke]`` with no task names on a collection
1346 containing a default task should (intuitively) have run that default task,
1347 but instead did nothing. This has been fixed.
1348 - :bug:`167 major` Running the same task multiple times in one CLI session was
1349 horribly broken; it works now. Thanks to Erich Heine for the report.
1350 - :bug:`119 major` (also :issue:`162`, :issue:`113`) Better handle
1351 platform-sensitive operations such as pty size detection or use, either
1352 replacing with platform-specific implementations or raising useful
1353 exceptions. Thanks to Gabi Davar and (especially) Paul Moore, for feedback &
1354 original versions of the final patchset.
1355 - :feature:`136` Added the ``autoprint`` flag to
1356 `invoke.tasks.Task`/`@task <invoke.tasks.task>`, allowing users to set up
1357 tasks which act as both subroutines & "print a result" CLI tasks. Thanks to
1358 Matthias Lehmann for the original patch.
1359 - :bug:`162 major` Adjust platform-sensitive imports so Windows users don't
1360 encounter import-time exceptions. Thanks to Paul Moore for the patch.
1361 - :support:`169` Overhaul the Sphinx docs into two trees, one for main project
1362 info and one for versioned API docs.
1363 - :bug:`- major` Fixed a sub-case of the already-mostly-fixed :issue:`149` so
1364 the error message works usefully even with no explicit collection name given.
1365 - :release:`0.8.2 <2014-06-15>`
1366 - :bug:`149` Print a useful message to stderr when Invoke can't find the
1367 requested collection/tasks file, instead of displaying a traceback.
1368 - :bug:`145` Ensure a useful message is displayed (instead of a confusing
1369 exception) when listing empty task collections.
1370 - :bug:`142` The refactored Loader class failed to account for the behavior of
1371 ``imp.find_module`` when run against packages (vs modules) and was exploding
1372 at load time. This has been fixed. Thanks to David Baumgold for catch &
1373 patch.
1374 - :release:`0.8.1 <2014-06-09>`
1375 - :bug:`140` Revert incorrect changes to our ``setup.py`` regarding detection
1376 of sub-packages such as the vendor tree & the parser. Also add additional
1377 scripting to our Travis-CI config to catch this class of error in future.
1378 Thanks to Steven Loria and James Cox for the reports.
1379 - :release:`0.8.0 <2014-06-08>`
1380 - :feature:`135` (also bugs :issue:`120`, :issue:`123`) Implement post-tasks to
1381 match pre-tasks, and allow control over the arguments passed to both (via
1382 `invoke.tasks.call`). For details, see :ref:`pre-post-tasks`.
1383
1384 .. warning::
1385 Pre-tasks were overhauled a moderate amount to implement this feature;
1386 they now require references to **task objects** instead of **task
1387 names**. This is a backwards incompatible change.
1388
1389 - :support:`25` Trim a bunch of time off the test suite by using mocking and
1390 other tools instead of dogfooding a bunch of subprocess spawns.
1391 - :bug:`128 major` Positional arguments containing underscores were not
1392 exporting to the parser correctly; this has been fixed. Thanks to J. Javier
1393 Maestro for catch & patch.
1394 - :bug:`121 major` Add missing help output denoting inverse Boolean options
1395 (i.e. ``--[no-]foo`` for a ``--foo`` flag whose value defaults to true.)
1396 Thanks to Andrew Roberts for catch & patch.
1397 - :support:`118` Update the bundled ``six`` plus other minor tweaks to support
1398 files. Thanks to Matt Iversen.
1399 - :feature:`115` Make it easier to reuse Invoke's primary CLI machinery in
1400 other (non-Invoke-distributed) bin-scripts. Thanks to Noah Kantrowitz.
1401 - :feature:`110` Add task docstrings' 1st lines to ``--list`` output. Thanks to
1402 Hiroki Kiyohara for the original PR (with assists from Robert Read and James
1403 Thigpen.)
1404 - :support:`117` Tidy up ``setup.py`` a bit, including axing the (broken)
1405 `distutils` support. Thanks to Matt Iversen for the original PR & followup
1406 discussion.
1407 - :feature:`87` (also :issue:`92`) Rework the loader module such that recursive
1408 filesystem searching is implemented, and is used instead of searching
1409 `sys.path`.
1410
1411 This adds the behavior most users expect or are familiar with from Fabric 1
1412 or similar tools; and it avoids nasty surprise collisions with other
1413 installed packages containing files named ``tasks.py``.
1414
1415 Thanks to Michael Hahn for the original report & PR, and to Matt Iversen for
1416 providing the discovery algorithm used in the final version of this change.
1417
1418 .. warning::
1419 This is technically a backwards incompatible change (reminder: we're not
1420 at 1.0 yet!). You'll only notice if you were relying on adding your tasks
1421 module to ``sys.path`` and then calling Invoke elsewhere on the
1422 filesystem.
1423
1424 - :support:`-` Refactor the `invoke.runners.Runner` module to differentiate
1425 what it means to run a command in the abstract, from execution specifics. Top
1426 level API is unaffected.
1427 - :bug:`131 major` Make sure one's local tasks module is always first in
1428 ``sys.path``, even if its parent directory was already somewhere else in
1429 ``sys.path``. This ensures that local tasks modules never become hidden by
1430 third-party ones. Thanks to ``@crccheck`` for the early report and to Dorian
1431 Puła for assistance fixing.
1432 - :bug:`116 major` Ensure nested config overrides play nicely with default
1433 tasks and pre-tasks.
1434 - :bug:`127 major` Fill in tasks' exposed ``name`` attribute with body name if
1435 explicit name not given.
1436 - :feature:`124` Add a ``--debug`` flag to the core parser to enable easier
1437 debugging (on top of existing ``INVOKE_DEBUG`` env var.)
1438 - :feature:`125` Improve output of Failure exceptions when printed.
1439 - :release:`0.7.0 <2014.01.28>`
1440 - :feature:`109` Add a ``default`` kwarg to
1441 `invoke.collection.Collection.add_task` allowing per-collection control over
1442 default tasks.
1443 - :feature:`108` Update `invoke.collection.Collection.from_module` to accept
1444 useful shorthand arguments for tweaking the `invoke.collection.Collection`
1445 objects it creates (e.g. name, configuration.)
1446 - :feature:`107` Update configuration merging behavior for more flexible reuse
1447 of imported task modules, such as parameterizing multiple copies of a module
1448 within a task tree.
1449 - :release:`0.6.1 <2013.11.21>`
1450 - :bug:`96` Tasks in subcollections which set explicit names (via e.g.
1451 ``@task(name='foo')``) were not having those names honored. This is fixed.
1452 Thanks to Omer Katz for the report.
1453 - :bug:`98` **BACKWARDS INCOMPATIBLE CHANGE!** Configuration merging has been
1454 reversed so outer collections' config settings override inner collections.
1455 This makes distributing reusable modules significantly less silly.
1456 - :release:`0.6.0 <2013.11.21>`
1457 - :bug:`86 major` Task arguments named with an underscore broke the help feature;
1458 this is now fixed. Thanks to Stéphane Klein for the catch.
1459 - :feature:`89` Implemented configuration for distributed task modules: can set
1460 config options in `invoke.collection.Collection` objects and they are made
1461 available to contextualized tasks.
1462 - :release:`0.5.1 <2013.09.15>`
1463 - :bug:`81` Fall back to sane defaults for PTY sizes when autodetection gives
1464 insane results. Thanks to ``@akitada`` for the patch.
1465 - :bug:`83` Fix a bug preventing underscored keyword arguments from working
1466 correctly as CLI flags (e.g. ``mytask --my-arg`` would not map back correctly
1467 to ``mytask(my_arg=...)``.) Credit: ``@akitada``.
1468 - :release:`0.5.0 <2013.08.16>`
1469 - :feature:`57` Optional-value flags added - e.g. ``--foo`` tells the parser to
1470 set the ``foo`` option value to True; ``--foo myval`` sets the value to
1471 "myval". The built-in ``--help`` option now leverages this feature for
1472 per-task help (e.g. ``--help`` displays global help, ``--help mytask``
1473 displays help for ``mytask`` only.)
1474 - :bug:`55 major` A bug in our vendored copy of ``pexpect`` clashed with a
1475 Python 2->3 change in import behavior to prevent Invoke from running on
1476 Python 3 unless the ``six`` module was installed in one's environment. This
1477 was fixed - our vendored ``pexpect`` now always loads its sibling vendored
1478 ``six`` correctly.