[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Closing, as suggested above. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-10 Thread Pavel Roskin
Pavel Roskin added the comment: Thank you for the comments. I was annoyed by py_compile making files with names very similar to the original scripts, names that could not even be recognized by shell patterns in .gitignore unless scripts ending with "c" are banned. But that problem is addressed

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: On the side issue: While the example given, which uses the py_compile.compile defaults via the command line interface, is useless, I disagree that writing a .pyc file for a file without .py is a bug. Python will run python code with any filename as main module

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread Pavel Roskin
Pavel Roskin added the comment: That's what I have now: check: $(PYTHON) -m py_compile $(SOURCES) rm -f $(addsuffix c, $(SOURCES)) make check python -m py_compile redacted-build redacted-git-diff redacted-git-gc redacted-git-status redacted-init redacted-server redactedbuilder.

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread R. David Murray
R. David Murray added the comment: Well, the thing is that py_compile *already* has all the needed logic, the flag would just allow us to add an if statement before the two lines that write the compiled bytecode out to the file system. py_compile also has the advantage that it supports the im

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread Brett Cannon
Brett Cannon added the comment: You can verify a script is syntactically correct by compiling it to an AST or just calling compile() which is another way of doing essentially what `import` does but without having to worry about import-related side-effects in the code being checked. But is thi

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread R. David Murray
R. David Murray added the comment: OK, I'll change the title to reflect the current proposal, and we'll see if anyone is interested in proposing a patch. The bug with python -m py_compile is when you do: python -m py_compile myscript where myscript is a file containing python code (note t