axio-tools-local 0.2.4__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- axio_tools_local-0.3.2/.gitignore +12 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/Makefile +1 -1
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/PKG-INFO +1 -1
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/pyproject.toml +1 -1
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_list_files.py +4 -3
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_patch_file.py +2 -1
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_read_file.py +4 -2
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_run_python.py +2 -2
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_shell.py +2 -3
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/test_write_file.py +4 -2
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/uv.lock +1 -1
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/.github/workflows/publish.yml +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/.github/workflows/tests.yml +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/LICENSE +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/README.md +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/__init__.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/list_files.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/patch_file.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/read_file.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/run_python.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/shell.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/src/axio_tools_local/write_file.py +0 -0
- {axio_tools_local-0.2.4 → axio_tools_local-0.3.2}/tests/conftest.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: axio-tools-local
|
|
3
|
-
Version: 0.2
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Core filesystem and execution tools for Axio
|
|
5
5
|
Project-URL: Homepage, https://github.com/axio-agent/axio-tools-local
|
|
6
6
|
Project-URL: Repository, https://github.com/axio-agent/axio-tools-local
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
from collections.abc import Generator
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
|
|
8
9
|
import pytest
|
|
@@ -11,7 +12,7 @@ from axio_tools_local.list_files import ListFiles
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
@pytest.fixture()
|
|
14
|
-
def tmp_cwd(tmp_path: Path) -> Path:
|
|
15
|
+
def tmp_cwd(tmp_path: Path) -> Generator[Path, None, None]:
|
|
15
16
|
old = os.getcwd()
|
|
16
17
|
os.chdir(tmp_path)
|
|
17
18
|
yield tmp_path
|
|
@@ -37,8 +38,8 @@ class TestListFilesBasic:
|
|
|
37
38
|
(tmp_cwd / "a_dir").mkdir()
|
|
38
39
|
result = await ls()
|
|
39
40
|
lines = result.splitlines()
|
|
40
|
-
dir_idx = next(i for i,
|
|
41
|
-
file_idx = next(i for i,
|
|
41
|
+
dir_idx = next(i for i, line in enumerate(lines) if "a_dir/" in line)
|
|
42
|
+
file_idx = next(i for i, line in enumerate(lines) if "z_file.txt" in line)
|
|
42
43
|
assert dir_idx < file_idx
|
|
43
44
|
|
|
44
45
|
async def test_empty_directory(self, tmp_cwd: Path) -> None:
|
|
@@ -8,6 +8,7 @@ All line numbers are 1-indexed, both inclusive:
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
10
|
import os
|
|
11
|
+
from collections.abc import Generator
|
|
11
12
|
from pathlib import Path
|
|
12
13
|
|
|
13
14
|
import pytest
|
|
@@ -16,7 +17,7 @@ from axio_tools_local.patch_file import PatchFile
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
@pytest.fixture()
|
|
19
|
-
def tmp_cwd(tmp_path: Path) -> Path:
|
|
20
|
+
def tmp_cwd(tmp_path: Path) -> Generator[Path, None, None]:
|
|
20
21
|
old = os.getcwd()
|
|
21
22
|
os.chdir(tmp_path)
|
|
22
23
|
yield tmp_path
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
from collections.abc import Generator
|
|
6
7
|
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
7
9
|
|
|
8
10
|
import pytest
|
|
9
11
|
|
|
@@ -11,14 +13,14 @@ from axio_tools_local.read_file import ReadFile
|
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
@pytest.fixture()
|
|
14
|
-
def tmp_cwd(tmp_path: Path) -> Path:
|
|
16
|
+
def tmp_cwd(tmp_path: Path) -> Generator[Path, None, None]:
|
|
15
17
|
old = os.getcwd()
|
|
16
18
|
os.chdir(tmp_path)
|
|
17
19
|
yield tmp_path
|
|
18
20
|
os.chdir(old)
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
async def read(tmp_cwd: Path, filename: str, **kwargs:
|
|
23
|
+
async def read(tmp_cwd: Path, filename: str, **kwargs: Any) -> str:
|
|
22
24
|
return await ReadFile(filename=filename, **kwargs)()
|
|
23
25
|
|
|
24
26
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import os
|
|
6
5
|
import tempfile
|
|
7
6
|
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
8
|
|
|
9
9
|
from axio_tools_local.run_python import RunPython
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
async def run(code: str, **kwargs:
|
|
12
|
+
async def run(code: str, **kwargs: Any) -> str:
|
|
13
13
|
return await RunPython(code=code, **kwargs)()
|
|
14
14
|
|
|
15
15
|
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
import pytest
|
|
6
|
+
from typing import Any
|
|
8
7
|
|
|
9
8
|
from axio_tools_local.shell import Shell
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
async def sh(command: str, **kwargs:
|
|
11
|
+
async def sh(command: str, **kwargs: Any) -> str:
|
|
13
12
|
return await Shell(command=command, **kwargs)()
|
|
14
13
|
|
|
15
14
|
|
|
@@ -4,7 +4,9 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
import stat
|
|
7
|
+
from collections.abc import Generator
|
|
7
8
|
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
8
10
|
|
|
9
11
|
import pytest
|
|
10
12
|
|
|
@@ -12,14 +14,14 @@ from axio_tools_local.write_file import WriteFile
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
@pytest.fixture()
|
|
15
|
-
def tmp_cwd(tmp_path: Path) -> Path:
|
|
17
|
+
def tmp_cwd(tmp_path: Path) -> Generator[Path, None, None]:
|
|
16
18
|
old = os.getcwd()
|
|
17
19
|
os.chdir(tmp_path)
|
|
18
20
|
yield tmp_path
|
|
19
21
|
os.chdir(old)
|
|
20
22
|
|
|
21
23
|
|
|
22
|
-
async def write(filename: str, content: str, **kwargs:
|
|
24
|
+
async def write(filename: str, content: str, **kwargs: Any) -> str:
|
|
23
25
|
return await WriteFile(file_path=filename, content=content, **kwargs)()
|
|
24
26
|
|
|
25
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|