diff options
| author | Christian Tismer <tismer@stackless.com> | 2021-12-20 12:24:24 +0100 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2021-12-20 14:31:06 +0100 |
| commit | 6787535fcd57f1363ad8ecdf8b6855e83d6c98d9 (patch) | |
| tree | d1894bd2f92128dca55aec09d5f83f9b6c2e21ea /build_scripts/setup_runner.py | |
| parent | 68fc31e0304c3cdf33aef5ad3e13786362496c59 (diff) | |
setup.py: Prevent creation of byte-compiled files
Byte-compiled files (.pyc or .pyo) are generated by
default when a module gets imported.
The "setup install" command has additionally the effect
of pre-compiling all Python files for the installation.
This is much less relevant than when this behavior was
implemented (was in Python 1.4, already in 1996).
We don't want this behavior that clutters example directories
and does not make much sense when the Limited API is used.
The compiled files will still be created on import.
But be aware of possible side effects because files may
be written on a read-only installation.
[ChangeLog][PySide6] The byte-compiling of example files is
now suppressed to save space and clutter.
Task-number: PYSIDE-1746
Change-Id: I811431030517c251f32bcadc4c98fb646b68eafa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts/setup_runner.py')
| -rw-r--r-- | build_scripts/setup_runner.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/build_scripts/setup_runner.py b/build_scripts/setup_runner.py index 5e0b2b486..f77b9d1fe 100644 --- a/build_scripts/setup_runner.py +++ b/build_scripts/setup_runner.py @@ -107,6 +107,10 @@ class SetupRunner(object): will run setuptools.setup(). """ + # PYSIDE-1746: We prevent the generation of .pyc/.pyo files during installation. + # These files are generated anyway on their import. + sys.dont_write_bytecode = True + # Prepare initial config. config.init_config(build_type=OPTION["BUILD_TYPE"], internal_build_type=OPTION["INTERNAL_BUILD_TYPE"], |
