-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PersistentSubShell
-feature
#596
Commits on Feb 26, 2024
-
add
bufsize
parameter to iterable subprocessesThis commit adds the parameter `bufsize` to `iterable_subprocesses` and to `iter_subproc`. Its value is passed into `subprocess.Popen`. This change is necessary to implement interactions with interactive subprocesses, for example a remote shell. These processes usually require a buffer size of zero, because each "request", i.e. an input to an interactive process, results in a "response" of unknown size and structure. In an interactive communication, each repsonse has to be interpreted before the next request can be sent. Therefore every byte that an interactive process emits has to be sent to the client, which processes it and assembles a response. In addition this commit makes the previously internal class `OutputFrom` (defined in `datalad_next.iterable_subprocess.iterable_subprocess`) available as `datalad_next.iterable_subprocess.OutputFrom`. This commit is in preparation for an interactive shell-class that will be used, for example, in RIA stores.
Configuration menu - View commit details
-
Copy full SHA for 4261fdf - Browse repository at this point
Copy the full SHA 4261fdfView commit details -
improve
align_pattern
performanceThis commit improves the performance of `align_pattern` by using a compiled regular expression to match pattern prefixes at the end of chunks. This increases the performance of `align_pattern`, roughly by the factor 8.
Configuration menu - View commit details
-
Copy full SHA for f592614 - Browse repository at this point
Copy the full SHA f592614View commit details -
add
datalad_next.shell.shell
context managerThe `shell` context manager opens a connection to a shell. Typically the shell is executed remotely via ssh, but it might also be a local shell, e.g. `bash`. It allows to send commands to the shell, read the output of `stdout` and determines the return code of the command. When the context is left, the shell is closed, by closing its `stdin`. The `shell` context manager is extensible through the concept of "Response Generators". New response generator-classes can be used to support new operating system, differing command line syntax, or different behavior of commands on different operating system. Currently it supports `bash` and `PowerShell`. The commit also includes a number of "convenience" functions for Linux and OSX that can be executed on a `shell`-context. - download files - upload files - delete files This commit incoroporates fixes and suggestions from: Adina Wagner <[email protected]> Michael Hanke <[email protected]> Many thanks for that.
Configuration menu - View commit details
-
Copy full SHA for 025c18a - Browse repository at this point
Copy the full SHA 025c18aView commit details
Commits on Mar 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 68c22af - Browse repository at this point
Copy the full SHA 68c22afView commit details
Commits on Mar 8, 2024
-
add
safe_read
wrapper to fix a bugThis commit adds a safe_read wrapper to prevent a `ValueError`-exception if the thread `iterable_subprocess.<locals>.input_to` tries to read from a closed file. A situation that triggers this error is described here: <datalad#596 (comment)>
Configuration menu - View commit details
-
Copy full SHA for d57f533 - Browse repository at this point
Copy the full SHA d57f533View commit details
Commits on Mar 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 45c5fac - Browse repository at this point
Copy the full SHA 45c5facView commit details
Commits on Mar 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 81d8554 - Browse repository at this point
Copy the full SHA 81d8554View commit details -
raise CommandError if shell commands fail
This commit modifies the code to always raise a `CommandError`, if a command that is executed in a shell fails. This is in line with the behavior of the other runner-tools.
Configuration menu - View commit details
-
Copy full SHA for 6cb2b7c - Browse repository at this point
Copy the full SHA 6cb2b7cView commit details
Commits on Mar 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2b6917c - Browse repository at this point
Copy the full SHA 2b6917cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c5c776e - Browse repository at this point
Copy the full SHA c5c776eView commit details
Commits on Mar 14, 2024
-
support
str
-commands in ShellCommandExecutorThis commit addressed a reviewer comment that auggested to also accept commands given as `str`. This leads to an extension of the `ShellCommandExecutor.__call__`-interface by the new parameter `encoding` that defines the encoding that should be used when converting `str`-commands into `bytes`-commands.
Configuration menu - View commit details
-
Copy full SHA for c1b964a - Browse repository at this point
Copy the full SHA c1b964aView commit details -
clean up code and improve names
`ShellCommandResponseGenerator.get_command_list` is renamed to `ShellCommandResponseGenerator.get_final_command` and its return value is now `bytes` instead of a list of bytes. Some duplicated code in response generators has been moved into base classes. `ShellCommandResponseGenerator.get_number_and_newline` was made private since it is only used by subclasses of `ShellCommandResponseGenerator`.
Configuration menu - View commit details
-
Copy full SHA for ee4bdf5 - Browse repository at this point
Copy the full SHA ee4bdf5View commit details -
fix an error in
str
-command handlingThis commit fixed an error in `str`-command handling and adds testing for `str`-commands.
Configuration menu - View commit details
-
Copy full SHA for 950ec40 - Browse repository at this point
Copy the full SHA 950ec40View commit details -
Configuration menu - View commit details
-
Copy full SHA for f005419 - Browse repository at this point
Copy the full SHA f005419View commit details
Commits on Mar 15, 2024
-
use a queue to signal completion in
posix.upload
This commit adds a queue to upload that is used by an iterator to signal the completion of the read-operation on the local file. This is a better way to prevent the "read() on closed file"-error. A docstring-error is fixed as well.
Configuration menu - View commit details
-
Copy full SHA for b849323 - Browse repository at this point
Copy the full SHA b849323View commit details
Commits on Mar 18, 2024
-
replace
stat
withls
in download-opThis commit uses `ls -dln` instead of `stat` to determine the size of a file on the connected shell. This is supported by more Unix-flavors, e.g. by Linux and OSX.
Configuration menu - View commit details
-
Copy full SHA for 1f34132 - Browse repository at this point
Copy the full SHA 1f34132View commit details
Commits on Mar 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 620bbe1 - Browse repository at this point
Copy the full SHA 620bbe1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 028e752 - Browse repository at this point
Copy the full SHA 028e752View commit details
Commits on Apr 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9d4ae1a - Browse repository at this point
Copy the full SHA 9d4ae1aView commit details
Commits on Apr 17, 2024
-
TODO: update docstrings 1. make shell.__call__ consume everything 2. add shell.start 3. don't raise CommandError by default 4. add check to enable CommandError-raising 5. small improvements 6. extend tests
Configuration menu - View commit details
-
Copy full SHA for d006050 - Browse repository at this point
Copy the full SHA d006050View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a99586 - Browse repository at this point
Copy the full SHA 1a99586View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba8985e - Browse repository at this point
Copy the full SHA ba8985eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e68aa0d - Browse repository at this point
Copy the full SHA e68aa0dView commit details -
Employ
shell
feature in SSH test fixturePreviously, this has been a series of SSH calls, each running in its own shell. Now a persistent shell is used to interleave remote and local checks.
Configuration menu - View commit details
-
Copy full SHA for 7b5635e - Browse repository at this point
Copy the full SHA 7b5635eView commit details -
adapt mih's changes to changed code
This commit adapts the changes made by mih in his forked branch to the changes that were made in this branch in the meantime.
Configuration menu - View commit details
-
Copy full SHA for c1a2dcf - Browse repository at this point
Copy the full SHA c1a2dcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2117d65 - Browse repository at this point
Copy the full SHA 2117d65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04b4140 - Browse repository at this point
Copy the full SHA 04b4140View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcb39b8 - Browse repository at this point
Copy the full SHA bcb39b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79436f8 - Browse repository at this point
Copy the full SHA 79436f8View commit details
Commits on Apr 18, 2024
-
Update datalad_next/shell/operations/posix.py
Co-authored-by: Michael Hanke <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ce445a8 - Browse repository at this point
Copy the full SHA ce445a8View commit details