Skip to content

Commit

Permalink
[python/c++] Typo fixes / nits (#2596) (#2613)
Browse files Browse the repository at this point in the history
* typos

* version.py: comment/varname tweaks

Co-authored-by: Ryan Williams <[email protected]>
  • Loading branch information
johnkerl and ryan-williams authored May 21, 2024
1 parent 30d67ff commit 011e2bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions apis/python/src/tiledbsoma/options/_tiledb_create_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ def from_platform_config(
attrs: Tuple[attrs_.Attribute, ...] = cls.__attrs_attrs__ # type: ignore[type-arg]
attr_names = frozenset(a.name for a in attrs)
# Explicitly opt out of type-checking for these kwargs.
filered_create_entry: Dict[str, Any] = {
filtered_create_entry: Dict[str, Any] = {
key: value for (key, value) in create_entry.items() if key in attr_names
}
return cls(**filered_create_entry)
return cls(**filtered_create_entry)
return create_entry

def cell_tile_orders(self) -> Tuple[Optional[str], Optional[str]]:
Expand Down
17 changes: 9 additions & 8 deletions apis/python/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ def err(*args, **kwargs):
def lines(
*cmd, drop_trailing_newline: bool = True, stderr=DEVNULL, **kwargs
) -> List[str]:
"""Run a command and return its output as a list of lines.
"""Run a command and return its stdout as a list of lines.
Strip trailing newlines, and drop the last line if it's empty, by default."""
Strip echo line's trailing newline, and drop the last line if it's empty, by default.
"""
lns = [
ln.rstrip("\n")
for ln in check_output(cmd, stderr=stderr, **kwargs).decode().splitlines()
Expand All @@ -109,7 +110,7 @@ def lines(


def line(*cmd, **kwargs) -> str:
"""Run a command, verify exactly one line of stdout, return it."""
"""Run a command, verify it produces exactly one line of stdout, return it."""
lns = lines(*cmd, **kwargs)
if len(lns) != 1:
raise RuntimeError(f"Expected 1 line, found {len(lns)}: {shlex.join(cmd)}")
Expand Down Expand Up @@ -216,15 +217,15 @@ def get_git_version() -> Optional[str]:
else:
# Didn't find a suitable local tag, look for a tracked/default "remote", and find its
# latest release tag
tracked_remote = get_default_remote()
if tracked_remote:
remote = get_default_remote()
if remote:
try:
latest_tag = get_latest_remote_tag(tracked_remote)
latest_tag = get_latest_remote_tag(remote)
err(
f"Git traversal returned {ver}, using latest tag {latest_tag} from tracked remote {tracked_remote}"
f"Git traversal returned {ver}, using latest tag {latest_tag} from remote {remote}"
)
except CalledProcessError:
err(f"Failed to find tags in remote {tracked_remote}")
err(f"Failed to find tags in remote {remote}")
return None
else:
err("Failed to find a suitable remote for tag traversal")
Expand Down
2 changes: 1 addition & 1 deletion scripts/bld
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if [ -n "${tiledb}" ]; then
# if [[ -v LD_LIBRARY_PATH ]]; then
# ...
# fi
# -- however, this is supproted by bash not sh. And this script can
# -- however, this is supported by bash not sh. And this script can
# be invoked by python via its shell-out which seems to use sh.
# It's simplest to just pause set -u.

Expand Down

0 comments on commit 011e2bf

Please sign in to comment.