classification
Title: distutils2 should allow the installing of python files with invalid syntax
Type: enhancement Stage: needs patch
Components: Distutils2 Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: Arfrever, barry, eric.araujo, michael.foord, tarek
Priority: normal Keywords:

Created on 2010-11-25 15:16 by michael.foord, last changed 2012-05-17 16:39 by Arfrever.

Messages (5)
msg122372 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-11-25 15:16
As discussed with tarek. It shouldn't be up to distutils2 to decide whether or not a Python file that has been included in the package should be installed or not if it is included in the set of files the developer has *asked* to be installed.

Possible use cases include deliberately broken modules for testing or an ast-transformer import hook that works with otherwise-invalid syntax files. (e.g. transforming the with statement to work on Python 2.4)

Allowing for the install of invalid syntax files will require ignoring SyntaxErrors during bytecode compile phase. A --strict option could be provided to allow these to remain an error.
msg138333 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-14 15:42
> A --strict option could be provided to allow these to remain an error.

Or a config option could let you list the files that should not be byte-compiled.
msg138339 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011-06-14 16:02
Config options are for when developers can't make decisions. Given that there are valid use cases please just allow it. A --strict option is fine... (but no-one will use it I suspect)
msg138341 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-14 16:08
> Config options are for when developers can't make decisions.
I don’t understand.  In packaging, a config file is central, as it contains the whole metadata, manifest and command options.

> Given that there are valid use cases please just allow it.
If this was not clear: I agree with the feature request.  Or maybe you meant allowing it by default?
msg138342 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011-06-14 16:12
Yes, allowing it by default. :-)
History
Date User Action Args
2012-05-17 16:39:00Arfreversetnosy: + Arfrever
2012-05-17 02:10:08barrysetnosy: + barry
2011-06-14 16:12:04michael.foordsetmessages: + msg138342
2011-06-14 16:08:16eric.araujosetmessages: + msg138341
2011-06-14 16:02:57michael.foordsetmessages: + msg138339
2011-06-14 15:42:52eric.araujosetstage: needs patch
messages: + msg138333
versions: + Python 3.3
2010-12-14 03:21:07r.david.murraysettype: enhancement
2010-11-25 15:16:54michael.foordcreate