You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running python 2.7.11 with pyannotate v1.0.3 installed in a virtualenv on ubuntu 16.0.4. I cloned this repo and ran the following
cd example
python driver.py
pyannotate gcd.py
This resulted in the expected
Refactored gcd.py
--- gcd.py (original)
+++ gcd.py (refactored)
@@ -1,8 +1,10 @@
def main():
+ # type: () -> None
print(gcd(15, 10))
print(gcd(45, 12))
def gcd(a, b):
+ # type: (int, int) -> int
while b:
a, b = b, a%b
return a
Files that need to be modified:
gcd.py
NOTE: this was a dry run; use -w to write files
If I then create an __init__.py file, and run pyannotate gcd.py, I get
No files need to be modified.
NOTE: this was a dry run; use -w to write files
which is not what I expect to get. This is preventing me from running across my project's codebase. The type_info.json file is created correctly. It's the pyannotate step that fails to identify any changes.
This is likely because you're running pyannotate from inside the package. You shouldn't do that. Or you should delete the unneeded toplevel __init__.py file. Check out the function crawl_up() to understand.
@gvanrossum That makes perfect sense. We had a stray __init__.py in our root folder causing the issue. All is working well now. Many thanks for a great tool.
Running python 2.7.11 with pyannotate v1.0.3 installed in a virtualenv on ubuntu 16.0.4. I cloned this repo and ran the following
This resulted in the expected
If I then create an
__init__.py
file, and runpyannotate gcd.py
, I getwhich is not what I expect to get. This is preventing me from running across my project's codebase. The
type_info.json
file is created correctly. It's thepyannotate
step that fails to identify any changes.pipdeptree output showing what is installed
The text was updated successfully, but these errors were encountered: