"Could not find builtins" error #915

Closed
wizzardx opened this Issue Oct 12, 2015 · 16 comments

Comments

Projects
None yet
5 participants
@wizzardx
Contributor

wizzardx commented Oct 12, 2015

Hi there.

With the latest dev version of mypy (currently 47b40a7) - since my most recent git pull, I get this error when trying to run mypy:


test.py:1: error: Could not find builtins

Where this is the complete contents of test.py:


!/usr/bin/env python3.4

print("HELLO WORLD")

And the command-line is:


mypy test.py

(Where I am under a Python virtualenv, where the latest dev version of mypy has been installed).

I ran a git bisect to track down where this issue started, and ended up at this commit where - in my testing - this problem starts manifesting:


commit 2c009ca
Author: Ben Longbons b.r.longbons@gmail.com
Date: Tue Jun 30 22:18:20 2015 -0700

Move script to mypy.main module and just leave stubs

This is a breaking issue for me - for now I need to do my dev/testing against the commit prior to that, 2e591dc, where the problem has not yet manifested.

Please advise?

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 12, 2015

Contributor

Suspect that something is wrong with setup.py, but travis doesn't test that yet.

Contributor

o11c commented Oct 12, 2015

Suspect that something is wrong with setup.py, but travis doesn't test that yet.

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 12, 2015

Contributor

Or it might be a problem with default_data_dir etc ... those functions are definitely suspicious.

Contributor

o11c commented Oct 12, 2015

Or it might be a problem with default_data_dir etc ... those functions are definitely suspicious.

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

Have reproduced after modifying the way the tests are run.

WIP: https://github.com/o11c/mypy/tree/setup

Contributor

o11c commented Oct 13, 2015

Have reproduced after modifying the way the tests are run.

WIP: https://github.com/o11c/mypy/tree/setup

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

@JukkaL The PR I'm about to create will be high priority.

Contributor

o11c commented Oct 13, 2015

@JukkaL The PR I'm about to create will be high priority.

@t2y

This comment has been minimized.

Show comment
Hide comment
@t2y

t2y Oct 13, 2015

Contributor

I had same issue. Is there any workaround?

Contributor

t2y commented Oct 13, 2015

I had same issue. Is there any workaround?

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

@t2y Workaround is to set PYTHONPATH (and PATH to scripts subdir) to the source dir of mypy instead of installing it.

But I think a fix is ready on my fork, use:

pip install git+https://github.com/JukkaL/o11c@setup
Contributor

o11c commented Oct 13, 2015

@t2y Workaround is to set PYTHONPATH (and PATH to scripts subdir) to the source dir of mypy instead of installing it.

But I think a fix is ready on my fork, use:

pip install git+https://github.com/JukkaL/o11c@setup
@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

My fix has been rejected, just use my fork instead permanently.

Contributor

o11c commented Oct 13, 2015

My fix has been rejected, just use my fork instead permanently.

@JukkaL JukkaL closed this in c8f7dcf Oct 13, 2015

@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2015

Collaborator

@o11c: I did not reject your fix, I asked you to resend it with unrelated changes removed and with an explanation of how the fix works. You did not wish to do this but started complaining publicly, so I had to fix it myself. Emergency fixes should be short and to the point. Time and time again a rushed fix has introduced additional problems (see http://www.infoworld.com/article/2608134/microsoft-windows/the-new-kb-2919355-windows-8-1-update-causes-more-problems-than-it-fixes.html for example).

@wizzardx @t2y: Please let me know if it works for you now.

Collaborator

JukkaL commented Oct 13, 2015

@o11c: I did not reject your fix, I asked you to resend it with unrelated changes removed and with an explanation of how the fix works. You did not wish to do this but started complaining publicly, so I had to fix it myself. Emergency fixes should be short and to the point. Time and time again a rushed fix has introduced additional problems (see http://www.infoworld.com/article/2608134/microsoft-windows/the-new-kb-2919355-windows-8-1-update-causes-more-problems-than-it-fixes.html for example).

@wizzardx @t2y: Please let me know if it works for you now.

@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2015

Collaborator

Postmortem:

The new test runner moved most of the logic from scripts/mypy to scripts/main.py. However, some of the logic in the file assumed that the file was living in the original path, and moving the file broke running mypy when installed. I fixed it by passing the path of script in the new stub scripts/mypy to scripts/main.py. This change also uncovered another bug that I also fixed. I'm not sure whether the latter bug actually caused any problems until this fix.

Collaborator

JukkaL commented Oct 13, 2015

Postmortem:

The new test runner moved most of the logic from scripts/mypy to scripts/main.py. However, some of the logic in the file assumed that the file was living in the original path, and moving the file broke running mypy when installed. I fixed it by passing the path of script in the new stub scripts/mypy to scripts/main.py. This change also uncovered another bug that I also fixed. I'm not sure whether the latter bug actually caused any problems until this fix.

@wizzardx

This comment has been minimized.

Show comment
Hide comment
@wizzardx

wizzardx Oct 13, 2015

Contributor

Already did some testing on my end, but didn't want to fan a possible flame thread :-). Good damage control there.

Both your updates and o11c's fork fixed the problem I reported earlier, thanks.

Contributor

wizzardx commented Oct 13, 2015

Already did some testing on my end, but didn't want to fan a possible flame thread :-). Good damage control there.

Both your updates and o11c's fork fixed the problem I reported earlier, thanks.

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

@JukkaL We do agree on one thing: you don't understand what bug was actually fixed by my patch.

Contributor

o11c commented Oct 13, 2015

@JukkaL We do agree on one thing: you don't understand what bug was actually fixed by my patch.

@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2015

Collaborator

@o11c: I've previously said that I prefer getting PRs with a single logical change instead of large PRs with multiple, unrelated changes. From now on I'll take a firmer stand and ask you to split all PRs into cohesive units. Also, I'm the BDFL of this project (or at least BDForNow) and it would be much easier for you to follow the guidelines that I set (which are similar for all contributors, except for new contributors who get some slack) instead of constantly bickering about me asking you to follow rules that you don't agree with. If you don't like a rule or if the guidelines are not explicit enough you can open an issue for discussing whether that should be changed, but please be civil. I may have to create a code for conduct for this project, but hopefully I don't have to go that far.

@o11c: And yes, I did not quite understand your patch, but I asked for clarification. Is this going to be some sort of guess-what-my-patch does mystery game? Not understanding something is totally fine in this project, and I hope that everybody who contributes acknowledges that we are all human and sometimes need help. Ridiculing others for having trouble with something is totally not cool.

Collaborator

JukkaL commented Oct 13, 2015

@o11c: I've previously said that I prefer getting PRs with a single logical change instead of large PRs with multiple, unrelated changes. From now on I'll take a firmer stand and ask you to split all PRs into cohesive units. Also, I'm the BDFL of this project (or at least BDForNow) and it would be much easier for you to follow the guidelines that I set (which are similar for all contributors, except for new contributors who get some slack) instead of constantly bickering about me asking you to follow rules that you don't agree with. If you don't like a rule or if the guidelines are not explicit enough you can open an issue for discussing whether that should be changed, but please be civil. I may have to create a code for conduct for this project, but hopefully I don't have to go that far.

@o11c: And yes, I did not quite understand your patch, but I asked for clarification. Is this going to be some sort of guess-what-my-patch does mystery game? Not understanding something is totally fine in this project, and I hope that everybody who contributes acknowledges that we are all human and sometimes need help. Ridiculing others for having trouble with something is totally not cool.

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

You have a very strange sense of "unrelated changes", and some disturbing lacks of knowledge about your own project and the language you are using to write it.

And you don't have to worry about me splitting PRs, I won't be making any more. Rather, I will encourage people to submit their PRs directly to my repo, since most people seem to have a significantly different idea of it than you.

To you, mypy is still your toy little project. But since PEP 484 landed, that's no longer what it is, and you can't afford to keep thinking of it that way.

Contributor

o11c commented Oct 13, 2015

You have a very strange sense of "unrelated changes", and some disturbing lacks of knowledge about your own project and the language you are using to write it.

And you don't have to worry about me splitting PRs, I won't be making any more. Rather, I will encourage people to submit their PRs directly to my repo, since most people seem to have a significantly different idea of it than you.

To you, mypy is still your toy little project. But since PEP 484 landed, that's no longer what it is, and you can't afford to keep thinking of it that way.

@jhance

This comment has been minimized.

Show comment
Hide comment
@jhance

jhance Oct 13, 2015

Contributor

We do agree on one thing: you don't understand what bug was actually fixed by my patch.

Maybe this means you should have written what bug was fixed in your patch in your commit message?

Contributor

jhance commented Oct 13, 2015

We do agree on one thing: you don't understand what bug was actually fixed by my patch.

Maybe this means you should have written what bug was fixed in your patch in your commit message?

@o11c

This comment has been minimized.

Show comment
Hide comment
@o11c

o11c Oct 13, 2015

Contributor

Maybe this means you should have written what bug was fixed in your patch in your commit message?

You mean the "actually test that mypy can be installed" one?

Contributor

o11c commented Oct 13, 2015

Maybe this means you should have written what bug was fixed in your patch in your commit message?

You mean the "actually test that mypy can be installed" one?

o11c referenced this issue in matthiaskramm/mypy Oct 13, 2015

add git (submodule) integrity check
If mypy is a git repository, check that the submodules are up-to-date (and
abort if not) in runtests.py, scripts/mypy, setup.py.
New option --dirty-stubs for runtests.py + scripts/mypy, for bypassing said
check.
@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 13, 2015

Collaborator

@o11c: I've blocked you for now, as I'm tired of you not being respectful. I'll add some instructions on how to unblock yourself if you want to work on your behavior (they will be added to http://www.mypy-lang.org/wiki/DeveloperGuides). The mypy repo has become a toxic place for me to work in (and probably others) recently. It should be a fun, friendly and co-operative environment.

everybody: Apologies for everybody affected -- I should have been more proactive and not have waited until things escalate this far. Feel free to email me if you want to understand the background a little better or have any concerns, or open issues to discuss what is acceptable behavior. This has been an isolated incident and almost everybody has been wonderful.

Collaborator

JukkaL commented Oct 13, 2015

@o11c: I've blocked you for now, as I'm tired of you not being respectful. I'll add some instructions on how to unblock yourself if you want to work on your behavior (they will be added to http://www.mypy-lang.org/wiki/DeveloperGuides). The mypy repo has become a toxic place for me to work in (and probably others) recently. It should be a fun, friendly and co-operative environment.

everybody: Apologies for everybody affected -- I should have been more proactive and not have waited until things escalate this far. Feel free to email me if you want to understand the background a little better or have any concerns, or open issues to discuss what is acceptable behavior. This has been an isolated incident and almost everybody has been wonderful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment