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
merged 1 commit into from Dec 30, 2019

Conversation

@iamdefinitelyahuman
Copy link
Contributor

iamdefinitelyahuman commented Dec 23, 2019

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 mentioned this pull request Dec 24, 2019
16 of 16 tasks complete
@iamdefinitelyahuman iamdefinitelyahuman force-pushed the iamdefinitelyahuman:windows-imports-fix branch 3 times, most recently from fe10882 to c8b2073 Dec 29, 2019
@iamdefinitelyahuman

This comment has been minimized.

Copy link
Contributor Author

iamdefinitelyahuman commented Dec 29, 2019

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

This comment has been minimized.

Copy link
Member

fubuloubu commented Dec 29, 2019

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
12 checks passed
12 checks passed
lint
Details
lint
Details
mypy
Details
mypy
Details
py36-core
Details
py36-core
Details
py37-core
Details
py37-core
Details
py38-core
Details
py38-core
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
@iamdefinitelyahuman iamdefinitelyahuman deleted the iamdefinitelyahuman:windows-imports-fix branch Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.