Skip to content

Fix Windows path issue when importing interfaces#1781

Merged
fubuloubu merged 1 commit intovyperlang:masterfrom
iamdefinitelyahuman:windows-imports-fix
Dec 30, 2019
Merged

Fix Windows path issue when importing interfaces#1781
fubuloubu merged 1 commit intovyperlang:masterfrom
iamdefinitelyahuman:windows-imports-fix

Conversation

@iamdefinitelyahuman
Copy link
Contributor

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

image

@iamdefinitelyahuman iamdefinitelyahuman force-pushed the windows-imports-fix branch 3 times, most recently from fe10882 to c8b2073 Compare December 29, 2019 12:35
@iamdefinitelyahuman
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.

@fubuloubu
Copy link
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants