Closed justindujardin closed 3 years ago
Merging #53 (e61fb01) into master (3e53f21) will increase coverage by
6.09%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #53 +/- ##
===========================================
+ Coverage 93.90% 100.00% +6.09%
===========================================
Files 13 4 -9
Lines 1869 884 -985
===========================================
- Hits 1755 884 -871
+ Misses 114 0 -114
Impacted Files | Coverage Δ | |
---|---|---|
pathy/__init__.py | 100.00% <100.00%> (ø) |
|
pathy/about.py | 100.00% <100.00%> (ø) |
|
pathy/cli.py | 100.00% <100.00%> (+8.69%) |
:arrow_up: |
pathy/gcs.py | 100.00% <100.00%> (+19.49%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3e53f21...e61fb01. Read the comment docs.
:tada: This PR is included in version 0.5.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
This PR refactors Pathy to improve its type completeness and support for tools like pylance, and tightens up behaviors by adding more tests and fixing or removing buggy or untested paths.
Changes
_tests
, but it can still be accessed directly to verify the test suite passes. e.g.pytest --pyargs pathy._tests
Pathy.as_uri
no longer prependsfile:///
to the output string. This didn't make sense in most cases.Pathy.mkdir
had logic to raise aFileNotFoundError
ifself.bucket is None
but I couldn't construct a test-case to exercise it.ValueError
is raised byparse_parts
before mkdir gets called. The check is removed.BucketsAccessor.is_dir
had logic to return true whenstr(path) == path.root
but this case can't be reached. If the root is invalid,parse_parts
will raise a value error because the path doesn't have atleast 2 parts for parsing. The check is removed.BucketsAccessor.exists
had logic to handle aClientError
being raise from callingclient.lookup_bucket
. The bucket lookup function does not raise, but returns None in the case a bucket doesn't exist. The only client error that might be handled here is an invalid configuration error from the GCS library, which we don't want to eat anyway. The check is removed.BucketsAccessor.mkdir
had logic for throwing a "Blob already exists" error if you called mkdir with a blob that already exists. Because the purpose of calling mkdir with a file is to create the intermediate folders leading up to the file, I don't see a reason to error if those folders already exist, or if the file at the end does. The error raising logic is removed.New/Improved Tests
parse_parts
utilPathy.open
Pathy.rmdir
Pathy.samefile/touch
BucketsAccessor.rename/replace/exist/get_blob
BucketClient.rmdir/makeuri
BucketClient.make_uri
BucketEntry
Pathy.prefix
propertyuse_fs/use_fs_cache
creating needed sub-folderspathy ls
,pathy rm
, andpathy cp
commands