twisted / ampoule

Process pool for Twisted, using AMP
Other
12 stars 19 forks source link

don't attempt to "correct" PYTHONPATH configuration for subprocesses unless asked #33

Open glyph opened 4 years ago

glyph commented 4 years ago

When Ampoule was first written, it was common practice for applications to do weird, potentially non-replicable startup nonsense to get sys.path to be correct and include all of one's sources. Since virtualenv, venv, and pip have taken over the Python developer-setup space, it's much more likely that your Python's path and dependency configuration is correct if you just don't mess with it.

Setting PYTHONPATH to point at the standard dist dirs can also have weird and unintended side-effects. For example, any shadowing of stdlib modules (enum34, for example) might create inscrutable breakages when .pth files try to import things (like coverage).

24 is another symptom of this monkeying around with sys.path.

Let's leave the environment untouched, and provide a hook to tweak it in the now-unusual case where something has broken.

graingert commented 4 years ago

@glyph there's already a hook - the user can pass env={"PYTHONPATH": ...}

glyph commented 4 years ago

@graingert fair enough! that does seem sufficient.