Skip to content

Simplify logic in PythonConfig.InstructionsForPhase()

Ahmon Dancy requested to merge main-If96a81c08a71c74659e41849f7cad058a6b0b362 into main

The diff looks big, but the logical changes are small and were done in
this order:

  1. Check right away if version or requirements are not specified.
    Those two are required to activate the Python builder. Old commit
    messages indicate that this was always the intended behavior.[0]

  2. In code after the initial check, replaced all "pc.Requirements != nil"
    with "true" since we know that it is definitely true.

  3. Removed any resulting 'if true' or 'if true || ...' expressions and
    de-indented their bodies.

This makes it much easier to understand the flow through this method,
especially the pc.usePoetry() conditionals.

[0] This did affect a test case, which I updated. I believe the new
behavior is more correct.


Related MRs:

Edited by Ahmon Dancy

Merge request reports