-
Notifications
You must be signed in to change notification settings - Fork 129
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
Force the python env version to 2.7 #246
Conversation
Python 2.7 is being EOL so we should upgrade this to use >= Python3.6. |
I wrote up an analysis of the problem in this Slack thread. The basic question I asked is: Why on earth is there a Python dependency in the first place? Nothing in this repository uses Python directly! To quote my rant at the end:
The dependency in question ( Ideally, we would prevent this dependency from being installed in the first place. I haven't yet found a way of disabling specific optional dependencies in npm. |
I spent some more time looking into this. The saga is in the next paragraph, feel free to skip to the conclusion: Looking into this further, the lack of Python 3 support is not an issue with dtrace-provider but node-gyp (see this issue) which ships with npm itself. After installing the latest version of npm with So in summary, the error is also resolved if you:
I also looked into ways to just not install the dependencies that we don't need. I tried This left me 😢 and 🤦♂ at the chaos of it all. The one-line fix in this PR is frankly probably a better solution for the moment until a newer npm version is released. I wanted to add a comment to explain why it is needed but the |
The `web-ext` npm dependency installs `dtrace-provider` via the `web-ext > bunyan > dtrace-provider` transitive dependency. dtrace-provider requries node-gyp to build and, except for the very latest version of node-gyp, this fails to build with Python 3 and produces a ton of confusing debug output when running `npm install` if the `python` binary is Python 3. dtrace-provider uses a stub implementation if it fails to build, so the issue isn't fatal but it is very confusing. We don't even need this package, but npm doesn't provide a convenient way to override it AFAIK. Since we use pyenv for all of Hypothesis' projects to manage the Python version, use a .python-version file to force the use of Python 2.7 here as a workaround. See #246 for the full saga.
bea213e
to
5a4a4d5
Compare
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.
😢 at the JS ecosystem. Approved as the easiest workaround for the time being.
Ran into an error when running this tool due to it wanting an older version of python (I have 3.6 in my global env), seems like the logical solution is to force an older version.
OR
Do we want to change the tool so it uses a newer version?