Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Restores the ability to compile the python files into .pyo/.pyc (for both versions of python) #1601

Merged
merged 8 commits into from
Jan 27, 2019

Commits on Jan 27, 2019

  1. Add ability to get hostpython and python version when creating our di…

    …stribution files
    
    Because this will allows us to restore the ability to compile python code to .pyo/.pyc (python2/python3)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    327dabd View commit details
    Browse the repository at this point in the history
  2. Blacklist files depending on python version

    Because the compilation to .pyo extension only exists for python2. Since python >= 3.5 the extension for the compiled files is .pyc.
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    42f89d2 View commit details
    Browse the repository at this point in the history
  3. Fix python3's compileall command for build.py file

    Because as of Python 3.5, the .pyo filename extension is no longer used, see:
      - `PEP 488 -- Elimination of PYO files` (https://www.python.org/dev/peps/pep-0488/)
      - `PEP 3147 -- PYC Repository Directories` as to why a separate directory is used (https://www.python.org/dev/peps/pep-3147/)
    
    Also moves comment to the right place
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    d6a927c View commit details
    Browse the repository at this point in the history
  4. Add ability of compile our python installation files into (.pyc/.pyo)…

    … depending on our python version
    
    Because this way the initialization of our apk it will be faster. We must use the .pyc extension for our python 3 because as of Python 3.5, the .pyo filename extension is no longer used and has been removed. Notice that the command to compile the files for python 3 is slightly different (`-b` option added). This is done that way because otherwise our compiled files would be put in `__pycache__` folder and this option makes that the compiled files gets putted in the same directory than the compiled file.
    
    See also:
      - `PEP 488 -- Elimination of PYO files` (https://www.python.org/dev/peps/pep-0488/)
      - `PEP 3147 -- PYC Repository Directories` as to why a separate directory is used (https://www.python.org/dev/peps/pep-3147/)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    b601a89 View commit details
    Browse the repository at this point in the history
  5. Fix error when copying the generated library libpythonX.so

    Because since the introduction of the ability to compile our python installation files, the copy command fails (because of the relative path and the fact that the compile command, recently introduced, probably changes the environment path, so when we try to copy the library the target directory is not found)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    3fee46e View commit details
    Browse the repository at this point in the history
  6. Fix extension for compiled python files for start.c (.pyo/.pyc)

    Because as of Python 3.5, the .pyo filename extension is no longer used
    
    See also: `PEP 488 -- Elimination of PYO files` (https://www.python.org/dev/peps/pep-0488/)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    8d148cf View commit details
    Browse the repository at this point in the history
  7. Add ability to get the entry point dynamically for our PythonActivity…

    ….java files
    
    Because as of Python 3.5, the .pyo filename extension is no longer used and has been eliminated in favour of .pyc, and we recently restored the capacity to compile our python installation files, so we must update this files in order to make it work the compiled files for both versions of python
    
    Note: this changes affects all bootstraps excepts pygame, because the pygame bootstrap can only be used with python2legacy and the extension of the compiled files are already set to .pyc...which is fine for now...because we cannot use the pygame bootstrap with python3
    
    See also: `PEP 488 -- Elimination of PYO files` (https://www.python.org/dev/peps/pep-0488/)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    2b03069 View commit details
    Browse the repository at this point in the history
  8. Enables compiled python files for non sdl2 bootstraps (webview and se…

    …rvice_only)
    
    Or we will not be able to use our apk because we will not have the necessary compiled files (.pyc/.pyo)
    opacam committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    6d8800d View commit details
    Browse the repository at this point in the history