Skip to content
New issue

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

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

Already on GitHub? # to your account

Import Remappings #4240

Open
PatrickAlphaC opened this issue Sep 15, 2024 · 1 comment
Open

Import Remappings #4240

PatrickAlphaC opened this issue Sep 15, 2024 · 1 comment

Comments

@PatrickAlphaC
Copy link

Simple Summary

Make shorthands for imports, similar to solidity remappings

Motivation

If I have a contract in a folder many directories away, it would be nice to be able to reference it easier.

Specification

If you have an import as such:

from my.path.to.my.other.package.here.some.other.dir.package_name import hello

it would be nice to be able to represent it as:

from @package_name import hello

When you compile, you could add a remapping to have these be identical, like:

vyper --remapping "@package_name=my.path.to.my.other.package.here.some.other.dir.package_name"

Backwards Compatibility

This is a new feature, so it should not have issues here.

Dependencies

None

References

None

Copyright

Copyright and related rights waived via CC0

@charles-cooper
Copy link
Member

I think search paths does what you want right?

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

No branches or pull requests

2 participants