Skip to content

Formatting Changes + Renames #27

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

AliabbasMerchant
Copy link
Member

Lots of formatting changes [Including consistent spacing with tabs 😉]
Renamed the local abc to datastore_abc and typing to datastore_typing, so as to help resolve imports unambiguously.

ntninja added 14 commits April 4, 2020 01:38
…tore

This is fully compatible with the way go-ipfs tracks the filesystem datastore's size and
unfortunately also contains quite a bit of code to work around concurrency-related
limitations in their implementation.
…this

Bonus: F821 is now fixed by pinning a newer pyflakes version.
…egates to the synchronous `__init__`

`FileSystemDatastore` already overwrites this for instance, to provide its async-only construction method instead.
…tistics about the given datastore

Includes handling for delegating to child datastores, particularily in
situations where more than one child datastore may be present. Allowing
callers to either provide a “selector” key to choose the backing store
they are interested in or get the total size of all connected datastores.
(Cancellation handling in tiered is broken, so those tests fail in this commit.)
@AliabbasMerchant
Copy link
Member Author

Damn. Style check failed. I will fix it today

@AliabbasMerchant AliabbasMerchant force-pushed the pr/24 branch 2 times, most recently from acfc93a to d27217c Compare May 16, 2020 02:52
Comment on lines +15 to +20
mount_item_t = typing.Tuple['mount_tree_t[DS]', typing.Optional[DS]]


class mount_tree_t(typing.Dict[str, mount_item_t[DS]]):
...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that looks like a better solution. 👍

Copy link
Member Author

@AliabbasMerchant AliabbasMerchant May 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alexander255 This change was made by you, not me. I hope you aren't going through all commits. Just go through the last 1-2 commits (the ones made by me)

@ntninja
Copy link
Collaborator

ntninja commented May 18, 2020

I'm opposed to this, having a “locally namespaced” version of standard library modules
is not an error and should work without issues in Python 3. (Python 2 had something
latter dubbed “relative imports” that caused issues when doing this but that was
fixed as an opt-in with PEP-428 and
“absolute imports” in Python 2.5+ and made permanent since Python 3.0).

When doing this, I actually took inspiration from our dependencies:

Could you explain which issues you encountered with the previous datastore.{abc,typing}
names that renaming would fix?

Also please rebase this, merging #24 appears to have made GitHub sad. 😉

@AliabbasMerchant
Copy link
Member Author

It was mainly the issues I faced with my editor (PyCharm). It would recognise the typing and abc modules as the internal dependencies, and it would report errors as it could not find the std lib objects like List, etc in the modules.
PyCharm is starting to lose its 'charm' 😉 in such cases and also in the #type: ignore comments. Doesn't recognize them 🤦‍♂️
Which editor do you use?

If having same names for internal modules is not a matter of concern, then its okay with me.
No need to rebase. We can directly discard this PR.

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

Successfully merging this pull request may close these issues.

2 participants