Function pyoxidizerlib::py_packaging::distutils::prepare_hacked_distutils[][src]

pub fn prepare_hacked_distutils(
    logger: &Logger,
    orig_distutils_path: &Path,
    dest_dir: &Path,
    extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>

Prepare a hacked install of distutils to use with Python packaging.

The idea is we use the distutils in the distribution as a base then install our own hacks on top of it to make it perform the functionality that we want. This enables things using it (like setup.py scripts) to invoke our functionality, without requiring them to change anything.

An alternate considered implementation was to “prepend” code to the invoked setup.py or Python process so that the in-process distutils was monkeypatched. This approach felt less robust than modifying distutils itself because a modified distutils will survive multiple process invocations, unlike a monkeypatch. People do weird things in setup.py scripts and we want to support as many as possible.