Skip to content

There's more than one way to get the default Python version #1243

Closed
@minrk

Description

@minrk

Proposed change

Make sure there's only one path to a 'default' python version when Python is unspecified.

Currently CondaBuildPack allows python_version to be an empty string, while PythonBuildPack does not.

Alternative options

Leave it as-is, which means more work to update the default Python version (missed in #1219, suggesting it's a problem).

Who would use this feature?

Maintainers updating the default Python version, users trying to understand how a default Python is chosen

How much effort will adding it take?

Not too much, I think. It should mostly involve ensuring a Python version is set to a default value, rather than allowing it to be an empty string. It should be:

  1. remove the environment.lock that lacks a Python version, and
  2. whenever python_version would be empty, follow major_pythons.get["3"], as is done here, but not currently in every case
  3. assert/assume that python_version is never empty once resolved

this will allow us to assume/ensure that python_version is never empty.

Who can do this work?

Anyone who wants to read through the Python logic of the base conda buildpack and freeze.py.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions