Skip to content

Commit

Permalink
rf: adhere code style conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-monch committed Jan 18, 2025
1 parent d4ec222 commit 60dd847
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 18 deletions.
1 change: 0 additions & 1 deletion datalad_remake/annexremotes/remake_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def transfer_retrieve(self, key: str, file_name: str) -> None:
compute_info['root_version'],
compute_info['input'],
) as worktree:

# Ensure that the method template is present, in case it is annexed.
lgr.debug('Fetching method template')
with patched_env(remove=['GIT_DIR', 'GIT_WORK_TREE']):
Expand Down
7 changes: 3 additions & 4 deletions datalad_remake/annexremotes/tests/test_hierarchies.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"Write-Output 'content: {first}' > a.txt;"
"Write-Output 'content: {second}' > b.txt;"
"Write-Output 'content: {third}' > new.txt;"
"ni -type directory d2_subds0;"
"ni -type directory d2_subds0/d2_subds1;"
"ni -type directory d2_subds0/d2_subds1/d2_subds2;"
'ni -type directory d2_subds0;'
'ni -type directory d2_subds0/d2_subds1;'
'ni -type directory d2_subds0/d2_subds1/d2_subds2;'
"Write-Output 'content: {first}' > d2_subds0/a0.txt;"
"Write-Output 'content: {second}' > d2_subds0/b0.txt;"
"Write-Output 'content: {third}' > d2_subds0/new.txt;"
Expand Down Expand Up @@ -158,7 +158,6 @@ def test_end_to_end(tmp_path, cfgman, monkeypatch, output_pattern):
_check_content(root_dataset, test_file_content)


#@skip_if_on_windows
def test_input_subdatasets(tmp_path, cfgman):
if on_windows:
simple_test_method = """
Expand Down
2 changes: 1 addition & 1 deletion datalad_remake/annexremotes/tests/test_remake_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datalad_remake import allow_untrusted_execution_key
from datalad_remake.commands.tests.create_datasets import create_ds_hierarchy
from datalad_remake.utils.platform import on_windows

from ... import (
PatternPath,
specification_dir,
Expand All @@ -16,7 +17,6 @@
run_remake_remote,
)


if on_windows:
template = """
parameters = ['content']
Expand Down
2 changes: 1 addition & 1 deletion datalad_remake/commands/provision_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def provide(
if on_windows:
with patched_env(remove=['GIT_WORK_TREE', 'GIT_DIR']):
# Create a worktree via `git clone` and check out the requested commit
args = (['clone', '.', str(resolved_worktree_dir)])
args = ['clone', '.', str(resolved_worktree_dir)]
call_git_lines(args, cwd=dataset.pathobj)
if source_branch:
args = ['checkout', source_branch]
Expand Down
2 changes: 0 additions & 2 deletions datalad_remake/commands/tests/test_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from pathlib import Path

from datalad_next.tests import skip_if_on_windows

from datalad_remake.commands.make_cmd import collect

from ... import PatternPath
Expand Down
2 changes: 0 additions & 2 deletions datalad_remake/commands/tests/test_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from datalad_core.config import ConfigItem
from datalad_next.datasets import Dataset
from datalad_next.tests import skip_if_on_windows

import datalad_remake.commands.make_cmd
from datalad_remake import (
Expand All @@ -16,7 +15,6 @@
)
from datalad_remake.utils.platform import on_windows


if on_windows:
test_method = """
parameters = ['name', 'file']
Expand Down
9 changes: 3 additions & 6 deletions datalad_remake/tests/test_complex_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
)
from datalad_remake.utils.platform import on_windows


if on_windows:
template = """
parameters = ['line']
Expand Down Expand Up @@ -63,9 +62,7 @@ def test_input_is_output(tmp_path: Path, cfgman):
# check that get works
root_dataset.drop('a.txt', result_renderer='disabled')
if (root_dataset.pathobj / 'a.txt').exists():
assert (root_dataset.pathobj / 'a.txt').read_text().startswith(
'/annex/objects'
)
assert (root_dataset.pathobj / 'a.txt').read_text().startswith('/annex/objects')

with cfgman.overrides(
{
Expand Down Expand Up @@ -120,8 +117,8 @@ def test_chain_dependency(tmp_path: Path, cfgman):
for file in ['c1.txt', 'c2.txt']:
root_dataset.drop(file, result_renderer='disabled')
if (root_dataset.pathobj / file).exists():
assert (root_dataset.pathobj / file).read_text().startswith(
'/annex/objects'
assert (
(root_dataset.pathobj / file).read_text().startswith('/annex/objects')
)

with cfgman.overrides(
Expand Down
3 changes: 2 additions & 1 deletion datalad_remake/utils/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def resolve_patterns(
recursive: bool = True,
) -> set[PatternPath]:
return {
PatternPath(Path(p)) for p in filter(
PatternPath(Path(p))
for p in filter(
# This expression works because a `PatternPath` instance can be
# safely appended to a system path via `/`. The result is a system
# path where the last parts are the parts of the `PatternPath`
Expand Down

0 comments on commit 60dd847

Please sign in to comment.