Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stat): return BlobStat for all pathy paths #96

Merged
merged 3 commits into from
Nov 23, 2022

Conversation

justindujardin
Copy link
Owner

@justindujardin justindujardin commented Nov 23, 2022

Return BlobStat consistently for local and remote paths.

Changes

  • implement stat in BasePath and yield BlobStats instead of os.stat_result.
  • implement all the pathlib file mode checking helpers because they use self.stat() internally which doesn't work with BlobStats.
  • add tests for base path helpers
  • update CLI test to assert that stats are BlobStat now

BREAKING CHANGE: Previously, when using Pathy.fluid paths that point to local file system paths, Pathy would return an os.stat_result rather than a BlobStat. This made it difficult to treat mixed paths consistently.

Now Pathy returns a BlobStat structure for local and remote paths.

If you need to use os.stat_result, you can still call os.stat(my_path) to access it.

- implement `stat` in `BasePath` and yield `BlobStat`s instead of `os.stat_result`.
- implement all the pathlib file mode checking helpers because they use `self.stat()` internally which doesn't work with BlobStats.
- add tests for base path helpers
- update CLI test to assert that stats are BlobStat now

BREAKING CHANGE: Previously when using Pathy.fluid paths that point to local file system paths, Pathy would return an `os.stat_result` rather than a `BlobStat`. This made it difficulty to treat mixed paths consistently.

Now Pathy returns a BlobStat structure for local and remote paths.

If you need to use `os.stat_result` you can still call `os.stat(my_path)` to access it.
@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (61c6afd) compared to base (ba5b5b3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #96   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines         1125      1159   +34     
=========================================
+ Hits          1125      1159   +34     
Impacted Files Coverage Δ
pathy/__init__.py 100.00% <100.00%> (ø)
pathy/about.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

 - seems related to : actions/setup-python#162
 - a fix is to use ubuntu 20.04, and we don't NEED latest for anything. We can switch this back later if the issue gets resolved.
@justindujardin justindujardin merged commit f092605 into master Nov 23, 2022
@justindujardin justindujardin deleted the fix/stat-consistency branch November 23, 2022 19:16
github-actions bot pushed a commit that referenced this pull request Nov 23, 2022
# [0.10.0](v0.9.0...v0.10.0) (2022-11-23)

### Bug Fixes

* **stat:** return BlobStat for all pathy paths ([#96](#96)) ([f092605](f092605))

### BREAKING CHANGES

* **stat:** Previously when using Pathy.fluid paths that point to local file system paths, Pathy would return an `os.stat_result` rather than a `BlobStat`. This made it difficulty to treat mixed paths consistently.

Now Pathy returns a BlobStat structure for local and remote paths.

If you need to use `os.stat_result` you can still call `os.stat(my_path)` to access it.
@github-actions
Copy link

🎉 This PR is included in version 0.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant