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 Windows path issue when importing interfaces #1781

merged 1 commit into from Dec 30, 2019


Copy link

The Issue

To prevent imports outside of the the root path, vyper-json prepends import paths with /__vyper and then ensures the final resolved path is still a subfolder of that path. On Windows this check is failing with ValueError: 'C:\\__vyper\\path.vy' does not start with '\\__vyper'. Oopsies.

You can see a detailed traceback for the issue here.

How I fixed it

Perform the relative_to check against a Path object, so that it works on any filesystem.

How to verify it

I confirmed that it works in a Windows 10 VM. Not sure if anyone wants to add Windows to the CI...

Cute Animal Picture


@iamdefinitelyahuman iamdefinitelyahuman force-pushed the windows-imports-fix branch 3 times, most recently from fe10882 to c8b2073 Compare December 29, 2019 12:35
Copy link
Contributor Author

Ignore my force pushes, was trying to get Windows CI to work but there's an upstream issue installing pyethash (Consensys/ethjsonrpc#5) which is required by py-evm (ethereum/py-evm#395). Unless we remove py-evm as a testing dependency, running tests on Windows is a no-go.

Copy link

What if we don't run the full test-suite with Windows, but instead run just the CLI stuff?

@fubuloubu fubuloubu merged commit ca9f050 into vyperlang:master Dec 30, 2019
@iamdefinitelyahuman iamdefinitelyahuman deleted the windows-imports-fix branch January 2, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants