-
Notifications
You must be signed in to change notification settings - Fork 2
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
Import iter_subproc()
#23
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
===========================================
- Coverage 100.00% 98.61% -1.39%
===========================================
Files 3 8 +5
Lines 78 432 +354
Branches 13 71 +58
===========================================
+ Hits 78 426 +348
- Misses 0 3 +3
- Partials 0 3 +3 ☔ View full report in Codecov by Sentry. |
mih
force-pushed
the
itersubproc
branch
3 times, most recently
from
June 12, 2024 08:39
cf9d316
to
8ded4b9
Compare
This was referenced Jun 12, 2024
Previously a 3rd-party GitHub action was used. Now we do automatically what a developer would run locally to minimize surprises and friction.
This is a code import from datalad-next@0f4829f4b69b826057c2881f0318329480cc9f38 This 3rd-party implementation had been originally introduced in datalad-next V1.1. It is a context manager that feeds input to subprocesses via iterables, and also exposes their output as an iterable. The implementation is based on https://github.com/uktrade/iterable-subprocess, and this fork has been modified to work homogeneously on the Windows platform too. This code is the foundation for a future code import of `iter_subproc()`, the core subprocess execution utility of datalad-next. For documentation/compliance purposes, the code import include the original license, README, and `pyproject.toml` metadata.
A truncated string with the error output is included, in an effort to relay possible error messages. For byte strings an attempt is made to decode it using the system's default encoding (see rationale in the comments on why that and why not more). The tests are extended with a few illustrative cases. This change should provide the necessary error reporting behavior for the `iterable_subprocess` tests to pass.
This is no more than using the `returncode` argument, instead of `code`.
This includes manually implementing suggestions, case-by-case whitelisting exceptions to rules, and also automated fixes and reformating.
This created a branch that could never be reached in practice.
Also add this documentation to the main index.
This involved "littering" the code with a number if `TYPE_CHECKING` conditionals to document a number of assert regarding various type changes at runtime.
This is a code import from datalad-next@0f4829f4b69b826057c2881f0318329480cc9f38 `iter_subproc()` is a convenience wrapper around `iterable_subprocess()` that slightly tunes its API for the purpose of a somewhat more homogeneous integration with other iterators in the DataLad ecosystem.
For now, `COPY_BUFSIZE` import and definition are included in the module. At least until a second consumer exists.
The original names shadowed a built-in. While this did not cause an actual problem, it is confusing. The plural form also matches better, because `inputs` is an iterable.
Code Climate has analyzed commit 4b44891 and detected 4 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
iter_subproc
#9TODO:
iterable_subprocess
iterable_subprocess
iter_subproc