-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
feat: add python sys.path
to vyper path
#3763
feat: add python sys.path
to vyper path
#3763
Conversation
this allows users to install packages from pip and import them using a regular python workflow.
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.
Can the package name be used as the base of the namespace?
e.g. from snekmate.auth import ...
that's an issue for the package maintainer -- snekmate is currently installing |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3763 +/- ##
===========================================
- Coverage 84.95% 69.61% -15.34%
===========================================
Files 92 92
Lines 13595 13135 -460
Branches 3061 2935 -126
===========================================
- Hits 11549 9144 -2405
- Misses 1560 3319 +1759
- Partials 486 672 +186 ☔ View full report in Codecov by Sentry. |
This is correct - I opened a PR to fix this pattern in snekmate: pcaversaccio/snekmate#204 (@charles-cooper can you quickly have a look). If you use the fixed pattern via: pip install -i https://test.pypi.org/simple/ snekmate==0.0.5rc2 and the introduced changes in this PR, you will get: Error compiling: Test.vy
vyper.exceptions.ModuleNotFound: vyper.interfaces.ERC165
contract "/mnt/c/Users/pasca/Desktop/vyper/venvU/lib/python3.11/site-packages/snekmate/auth/AccessControl.vy:54", line 54:0
53 # which is a built-in interface of the Vyper compiler.
---> 54 from vyper.interfaces import ERC165
--------^
55 implements: ERC165 The compilation error currently is due to the recent change introduced here #3741 (I would need to refactor this to If I adjust the snekmate Error compiling: Test.vy
vyper.exceptions.CompilerPanic: unhandled exception 'ModuleInfo' object has no attribute '_invalid_locations'
contract "C:\Users\pasca\Desktop\vyper\venv\Lib\site-packages\snekmate\auth\AccessControl.vy:62", line 62:0
61 import interfaces.IAccessControl as IAccessControl
---> 62 implements: IAccessControl
--------^
63
This is an unhandled internal compiler error. Please create an issue on Github to notify the developers!
https://github.com/vyperlang/vyper/issues/new?template=bug.md |
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.
Can we add one test case please?
seems like an outstanding issue |
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.
Figure out a way to mock this for testing
test added here eac2d2f |
sys.path
to vyper path
that error message should be fixed in #3775 |
this allows users to install packages from pip and import them using a regular python workflow.
What I did
opening pandora's box
How I did it
inject
sys.path
into the vyper compiler's search pathHow to verify it
Commit message
Description for the changelog
Cute Animal Picture