Skip to content

Commit

Permalink
refactor: resolve circular imports by inlining file adapter
Browse files Browse the repository at this point in the history
 - while it's perfectly fine to use lazy imports to workaround circular references, it appears to destroy the pylance integration and auto-imports.
 - move the clients.py and file.py code into base to make it so there is no need for lazy import workarounds.
  • Loading branch information
justindujardin committed Apr 19, 2021
1 parent 3e53f21 commit a60006f
Show file tree
Hide file tree
Showing 10 changed files with 446 additions and 454 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Stat for a bucket item
```python (doc)
use_fs(
root: Optional[str, pathlib.Path, bool] = None,
) -> Optional[pathy.file.BucketClientFS]
) -> Optional[pathy.base.BucketClientFS]
```

Use a path in the local file-system to store blobs and buckets.
Expand All @@ -364,7 +364,7 @@ applications.
# get_fs_client <kbd>function</kbd>

```python (doc)
get_fs_client() -> Optional[pathy.file.BucketClientFS]
get_fs_client() -> Optional[pathy.base.BucketClientFS]
```

Get the file-system client (or None)
Expand Down
51 changes: 29 additions & 22 deletions pathy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
from .base import (
BasePath,
Blob,
BlobStat,
Bucket,
BucketClient,
BucketEntry,
BucketsAccessor,
ClientError,
FluidPath,
Pathy,
PurePathy,
BasePath as BasePath,
Blob as Blob,
BlobStat as BlobStat,
Bucket as Bucket,
BucketClient as BucketClient,
BucketEntry as BucketEntry,
BucketsAccessor as BucketsAccessor,
ClientError as ClientError,
FluidPath as FluidPath,
Pathy as Pathy,
PurePathy as PurePathy,
BlobFS as BlobFS,
BucketClientFS as BucketClientFS,
BucketEntryFS as BucketEntryFS,
BucketFS as BucketFS,
clear_fs_cache as clear_fs_cache,
get_client as get_client,
get_fs_cache as get_fs_cache,
get_fs_client as get_fs_client,
register_client as register_client,
set_client_params as set_client_params,
use_fs as use_fs,
use_fs_cache as use_fs_cache,
)
from .clients import (
clear_fs_cache,
get_client,
get_fs_cache,
get_fs_client,
register_client,
set_client_params,
use_fs,
use_fs_cache,
from .gcs import (
BlobGCS as BlobGCS,
BucketClientGCS as BucketClientGCS,
BucketEntryGCS as BucketEntryGCS,
BucketGCS as BucketGCS,
has_gcs as has_gcs,
)
from .file import BlobFS, BucketClientFS, BucketEntryFS, BucketFS
from .gcs import BlobGCS, BucketClientGCS, BucketEntryGCS, BucketGCS, has_gcs
Loading

0 comments on commit a60006f

Please sign in to comment.