Uploaded image for project: 'Picard Website'
  1. Picard Website
  2. PW-46

Plugin zip files should be generated with .pyc and .pyo files included

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: High High
    • None

      I know that there may be some resistance to including compiled versions (pyc, .pyo) files in downloadable plugins, however PEP 273 https://www.python.org/dev/peps/pep-0273/ states explicitly:

      "When trying to import *.pyc, if it is not available then *.pyo will be used instead. And vice versa when looking for *.pyo. If neither *.pyc nor *.pyo is available, or if the magic numbers are invalid, then *.py will be compiled and used to satisfy the import, but the compiled file will not be saved. Python would normally write it to the same directory as *.py, but surely we don't want to write to the zip file. We could write to the directory of the zip archive, but that would clutter it up, not good if it is /usr/bin for example.

      Failing to write the compiled files will make zip imports very slow, and the user will probably not figure out what is wrong. So it is best to put *.pyc and *.pyo in the archive with the *.py."

      This ticket therefore proposes that when the PICARD-WEBSITE packages up plugins into zip files, it compiles .py files to .pyc and .pyo and includes those files in the zip file.

            Unassigned Unassigned
            sophist Sophist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package