vsmbfs 0.1.0__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.
vsmbfs-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: vsmbfs
3
+ Version: 0.1.0
4
+ Summary: VFSI fsspec filesystem backed by the vectorized vsmb client
5
+ Author-email: Ming Chen <v.mingchen@gmail.com>
6
+ License-Expression: MIT OR Apache-2.0
7
+ Project-URL: Homepage, https://github.com/vmingchen/vnfs
8
+ Project-URL: Documentation, https://github.com/vmingchen/vnfs/tree/main/adapters/vsmbfs
9
+ Project-URL: Repository, https://github.com/vmingchen/vnfs
10
+ Project-URL: Issues, https://github.com/vmingchen/vnfs/issues
11
+ Project-URL: Changelog, https://github.com/vmingchen/vnfs/blob/main/CHANGELOG.md
12
+ Keywords: vfsi,fsspec,smb,smb2,smb3,filesystem,vectorized-io
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: fsspec>=2024.12.0
22
+ Requires-Dist: vfsi-fsspec<0.2,>=0.1
23
+ Requires-Dist: vsmb<0.2,>=0.1
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest; extra == "test"
26
+ Provides-Extra: dev
27
+ Requires-Dist: black; extra == "dev"
28
+ Requires-Dist: build; extra == "dev"
29
+ Requires-Dist: mypy; extra == "dev"
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+
34
+ # vsmbfs
35
+
36
+ `vsmbfs` is the fsspec adapter for the low-level `vsmb` vector SMB2/3 client.
37
+
38
+ ```sh
39
+ python -m pip install vsmbfs
40
+ ```
41
+
42
+ ```python
43
+ import fsspec
44
+ import vsmbfs
45
+
46
+ fs = fsspec.filesystem(
47
+ "vsmbfs",
48
+ host="files.example",
49
+ share="data",
50
+ username="user",
51
+ password="secret",
52
+ )
53
+ print(fs.ls("/"))
54
+ ```
55
+
56
+ Bulk fsspec operations and coordinated `open_files` buffering use VFSI vector
57
+ operations so independent SMB requests can be issued in bounded batches.
vsmbfs-0.1.0/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # vsmbfs
2
+
3
+ `vsmbfs` is the fsspec adapter for the low-level `vsmb` vector SMB2/3 client.
4
+
5
+ ```sh
6
+ python -m pip install vsmbfs
7
+ ```
8
+
9
+ ```python
10
+ import fsspec
11
+ import vsmbfs
12
+
13
+ fs = fsspec.filesystem(
14
+ "vsmbfs",
15
+ host="files.example",
16
+ share="data",
17
+ username="user",
18
+ password="secret",
19
+ )
20
+ print(fs.ls("/"))
21
+ ```
22
+
23
+ Bulk fsspec operations and coordinated `open_files` buffering use VFSI vector
24
+ operations so independent SMB requests can be issued in bounded batches.
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vsmbfs"
7
+ version = "0.1.0"
8
+ description = "VFSI fsspec filesystem backed by the vectorized vsmb client"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT OR Apache-2.0"
12
+ authors = [{ name = "Ming Chen", email = "v.mingchen@gmail.com" }]
13
+ keywords = ["vfsi", "fsspec", "smb", "smb2", "smb3", "filesystem", "vectorized-io"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: System Administrators",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Typing :: Typed",
21
+ ]
22
+ dependencies = [
23
+ "fsspec>=2024.12.0",
24
+ "vfsi-fsspec>=0.1,<0.2",
25
+ "vsmb>=0.1,<0.2",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/vmingchen/vnfs"
30
+ Documentation = "https://github.com/vmingchen/vnfs/tree/main/adapters/vsmbfs"
31
+ Repository = "https://github.com/vmingchen/vnfs"
32
+ Issues = "https://github.com/vmingchen/vnfs/issues"
33
+ Changelog = "https://github.com/vmingchen/vnfs/blob/main/CHANGELOG.md"
34
+
35
+ [project.entry-points."fsspec.specs"]
36
+ vsmbfs = "vsmbfs:VsmbFileSystem"
37
+
38
+ [project.optional-dependencies]
39
+ test = ["pytest"]
40
+ dev = ["black", "build", "mypy", "pytest", "ruff", "twine"]
41
+
42
+ [tool.setuptools]
43
+ package-dir = {"" = "python"}
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["python"]
47
+
48
+ [tool.black]
49
+ line-length = 88
50
+ target-version = ["py39"]
51
+
52
+ [tool.ruff]
53
+ target-version = "py39"
54
+
55
+ [tool.ruff.lint]
56
+ select = ["E4", "E7", "E9", "F", "I"]
57
+
58
+ [tool.pytest.ini_options]
59
+ testpaths = ["tests"]
@@ -0,0 +1,12 @@
1
+ """fsspec filesystem backed by the vectorized :mod:`vsmb` client."""
2
+
3
+ import fsspec
4
+ from vfsi_fsspec import install_fsspec_blockcache_compat
5
+ from vsmb import __version__ as __version__
6
+
7
+ from ._fs import SmbFileSystem, VsmbFile, VsmbFileSystem
8
+
9
+ __all__ = ["SmbFileSystem", "VsmbFile", "VsmbFileSystem"]
10
+
11
+ fsspec.register_implementation("vsmbfs", VsmbFileSystem)
12
+ install_fsspec_blockcache_compat(VsmbFileSystem)
@@ -0,0 +1,6 @@
1
+ from ._fs import SmbFileSystem as SmbFileSystem
2
+ from ._fs import VsmbFile as VsmbFile
3
+ from ._fs import VsmbFileSystem as VsmbFileSystem
4
+
5
+ __version__: str
6
+ __all__: list[str]
@@ -0,0 +1,31 @@
1
+ """SMB-specific facade over the shared VFSI fsspec engine."""
2
+
3
+ from vfsi_fsspec import VfsiFile
4
+ from vfsi_fsspec import VfsiFileSystem as _VfsiFileSystem
5
+ from vsmb import _native
6
+
7
+
8
+ class VsmbFileSystem(_VfsiFileSystem):
9
+ """Vectorized SMB2/3 filesystem."""
10
+
11
+ protocol = "vsmbfs"
12
+ _native_module = _native
13
+ _supported_backends = frozenset({"smb"})
14
+
15
+ def __init__(self, host="127.0.0.1", root="", share=None, **kwargs):
16
+ backend = kwargs.pop("backend", "smb")
17
+ if backend != "smb":
18
+ raise ValueError("vsmbfs only supports backend='smb'")
19
+ super().__init__(
20
+ host=host,
21
+ root=root,
22
+ backend="smb",
23
+ share=share,
24
+ **kwargs,
25
+ )
26
+
27
+
28
+ SmbFileSystem = VsmbFileSystem
29
+ VsmbFile = VfsiFile
30
+
31
+ __all__ = ["SmbFileSystem", "VsmbFile", "VsmbFileSystem"]
@@ -0,0 +1,17 @@
1
+ from typing import Any, Optional
2
+
3
+ from vfsi_fsspec import VfsiFile, VfsiFileSystem
4
+
5
+ VsmbFile = VfsiFile
6
+
7
+ class VsmbFileSystem(VfsiFileSystem):
8
+ protocol: str
9
+ def __init__(
10
+ self,
11
+ host: str = "127.0.0.1",
12
+ root: str = "",
13
+ share: Optional[str] = None,
14
+ **kwargs: Any,
15
+ ) -> None: ...
16
+
17
+ SmbFileSystem = VsmbFileSystem
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: vsmbfs
3
+ Version: 0.1.0
4
+ Summary: VFSI fsspec filesystem backed by the vectorized vsmb client
5
+ Author-email: Ming Chen <v.mingchen@gmail.com>
6
+ License-Expression: MIT OR Apache-2.0
7
+ Project-URL: Homepage, https://github.com/vmingchen/vnfs
8
+ Project-URL: Documentation, https://github.com/vmingchen/vnfs/tree/main/adapters/vsmbfs
9
+ Project-URL: Repository, https://github.com/vmingchen/vnfs
10
+ Project-URL: Issues, https://github.com/vmingchen/vnfs/issues
11
+ Project-URL: Changelog, https://github.com/vmingchen/vnfs/blob/main/CHANGELOG.md
12
+ Keywords: vfsi,fsspec,smb,smb2,smb3,filesystem,vectorized-io
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: fsspec>=2024.12.0
22
+ Requires-Dist: vfsi-fsspec<0.2,>=0.1
23
+ Requires-Dist: vsmb<0.2,>=0.1
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest; extra == "test"
26
+ Provides-Extra: dev
27
+ Requires-Dist: black; extra == "dev"
28
+ Requires-Dist: build; extra == "dev"
29
+ Requires-Dist: mypy; extra == "dev"
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+
34
+ # vsmbfs
35
+
36
+ `vsmbfs` is the fsspec adapter for the low-level `vsmb` vector SMB2/3 client.
37
+
38
+ ```sh
39
+ python -m pip install vsmbfs
40
+ ```
41
+
42
+ ```python
43
+ import fsspec
44
+ import vsmbfs
45
+
46
+ fs = fsspec.filesystem(
47
+ "vsmbfs",
48
+ host="files.example",
49
+ share="data",
50
+ username="user",
51
+ password="secret",
52
+ )
53
+ print(fs.ls("/"))
54
+ ```
55
+
56
+ Bulk fsspec operations and coordinated `open_files` buffering use VFSI vector
57
+ operations so independent SMB requests can be issued in bounded batches.
@@ -0,0 +1,16 @@
1
+ README.md
2
+ pyproject.toml
3
+ python/vsmbfs/__init__.py
4
+ python/vsmbfs/__init__.pyi
5
+ python/vsmbfs/_fs.py
6
+ python/vsmbfs/_fs.pyi
7
+ python/vsmbfs/py.typed
8
+ python/vsmbfs.egg-info/PKG-INFO
9
+ python/vsmbfs.egg-info/SOURCES.txt
10
+ python/vsmbfs.egg-info/dependency_links.txt
11
+ python/vsmbfs.egg-info/entry_points.txt
12
+ python/vsmbfs.egg-info/requires.txt
13
+ python/vsmbfs.egg-info/top_level.txt
14
+ tests/test_fsspec_abstract.py
15
+ tests/test_package.py
16
+ tests/test_smb_integration.py
@@ -0,0 +1,2 @@
1
+ [fsspec.specs]
2
+ vsmbfs = vsmbfs:VsmbFileSystem
@@ -0,0 +1,14 @@
1
+ fsspec>=2024.12.0
2
+ vfsi-fsspec<0.2,>=0.1
3
+ vsmb<0.2,>=0.1
4
+
5
+ [dev]
6
+ black
7
+ build
8
+ mypy
9
+ pytest
10
+ ruff
11
+ twine
12
+
13
+ [test]
14
+ pytest
@@ -0,0 +1 @@
1
+ vsmbfs
vsmbfs-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,45 @@
1
+ """Run fsspec's upstream abstract contract against live vsmbfs."""
2
+
3
+ import posixpath
4
+
5
+ import pytest
6
+ from fsspec.tests.abstract import AbstractFixtures
7
+ from fsspec.tests.abstract.copy import AbstractCopyTests
8
+ from fsspec.tests.abstract.get import AbstractGetTests
9
+ from fsspec.tests.abstract.open import AbstractOpenTests
10
+ from fsspec.tests.abstract.pipe import AbstractPipeTests
11
+ from fsspec.tests.abstract.put import AbstractPutTests
12
+
13
+
14
+ class VsmbAbstractFixtures(AbstractFixtures):
15
+ @pytest.fixture
16
+ def fs(self, smb_fs):
17
+ yield smb_fs
18
+
19
+ @pytest.fixture
20
+ def fs_join(self):
21
+ return posixpath.join
22
+
23
+ @pytest.fixture
24
+ def fs_path(self):
25
+ return "/"
26
+
27
+
28
+ class TestAbstractOpen(AbstractOpenTests, VsmbAbstractFixtures):
29
+ pass
30
+
31
+
32
+ class TestAbstractPipe(AbstractPipeTests, VsmbAbstractFixtures):
33
+ pass
34
+
35
+
36
+ class TestAbstractCopy(AbstractCopyTests, VsmbAbstractFixtures):
37
+ pass
38
+
39
+
40
+ class TestAbstractGet(AbstractGetTests, VsmbAbstractFixtures):
41
+ pass
42
+
43
+
44
+ class TestAbstractPut(AbstractPutTests, VsmbAbstractFixtures):
45
+ pass
@@ -0,0 +1,15 @@
1
+ """Package boundary tests for the vsmbfs adapter."""
2
+
3
+ import fsspec
4
+ import pytest
5
+ import vsmbfs
6
+
7
+
8
+ def test_registers_dedicated_fsspec_protocol():
9
+ assert fsspec.get_filesystem_class("vsmbfs") is vsmbfs.VsmbFileSystem
10
+ assert vsmbfs.VsmbFileSystem.protocol == "vsmbfs"
11
+
12
+
13
+ def test_rejects_non_smb_backend_before_connecting():
14
+ with pytest.raises(ValueError, match="only supports backend='smb'"):
15
+ vsmbfs.VsmbFileSystem(backend="nfs", share="data")
@@ -0,0 +1,15 @@
1
+ """Integration coverage for the Python/fsspec SMB backend."""
2
+
3
+ from vsmb import _native
4
+
5
+ from .common import run_correctness_suite
6
+
7
+
8
+ def test_correctness_suite_on_smb(smb_fs):
9
+ run_correctness_suite(smb_fs)
10
+
11
+
12
+ def test_smb_identity_and_capabilities(smb_fs):
13
+ assert 0x0202 <= smb_fs.smb_dialect() <= 0x0311
14
+ assert smb_fs._client.minor_version() is None
15
+ assert smb_fs._client.capabilities() & _native.CAP_LSTAT == 0