-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 buggy support of ethpm-spec submodule #1682
Conversation
dffb54b
to
05451df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when they don't initialize it. Do they get a reasonable error message? If not I'd advocate for something in the test suite that detects the directory is missing and gives something indicating how it should be fixed.
@marcgarreau Good call on the |
8e5f22b
to
f2b9c7b
Compare
52f31b0
to
7bea403
Compare
@marcgarreau Ok, I feel much better about this now.
|
7bea403
to
cc71b70
Compare
if not v3_spec.is_file(): | ||
raise FileNotFoundError( | ||
"The ethpm-spec submodule is not available. " | ||
"Please import the submodule with `git submodule update --init`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this error message should be expanded since there are two main paths that it seems like a user would find themselves in this situation.
pip install web3
with a broken package that doesn't include the assetsget clone ...
that doesn't pull the submodules.
Maybe lets expand this error message to include sections for both of those. In the case where the problem is get clone
based, the user has agency to fix it. In the pip install ...
case, they have no agency to fix the problem because it is likely indicative of a broken release....
The current exception messaging would be confusing in the pip install
case since it would not actually fix the user's problem.
Alternatively, we could allow use of an environment variable to point at a different spec directory than the default one... but I'm skeptical that is the right approach because it would only serve as a way to make broken web3.py releases work, when we really should be focusing on not issuing broken releases....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pipermerriam My assumption was that adding the spec json assets in MANIFEST.in
(as far as I understand) guarantees that the spec files will always be included in the distribution, so I wasn't really considering case #1 to be a probable scenario. That being said, things can always go wrong I guess, but it just seemed unlikely enough that it doesn't warrant its own message. But, if you feel like this is a case we should guard against, I can definitely update the warning strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queues up beta.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about someone who does pip install GIT-HUB_URL
? I suspect that would put us in that position as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested a fresh install with pip install git+https://github.com/ethereum/web3.py/
and the ethpm-spec
submodule assets are all included in that install. This should mean all the install stories are covered (at least the ones I'm familiar with), but if we want to go with a better safe than sorry approach here, I can update the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I would not have expected the submodules assets to make their way in. In fact, I'm surprised enough by that to be suspicious (but not enough to dig in myself).
If you are confident that there are not any obvious cases where a user would find themselves in this position, I don't think the warning/error-messaging change is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also curious, these docs seemed the most helpul to me, but I was unable to glean any relevant/meaningful insight from those docs, my best guess is that it uses the MANIFEST.in
file during the installation process.
What was wrong?
For developer setup / to run the
ethpm
tests successfully, developers will have to initialize theethpm-spec/
submodule.Todo:
Cute Animal Picture