Skip to content

Hardcode python3 version for compat == 5?  #217

@serhii-karelov

Description

@serhii-karelov

I've noticed that we dynamically determine python3 version when virtualenv is being created (reference).

def get_python_version(compat):
    """Return the version of Python that an app will use.
    Based on the compat level.
    """
    if compat < 5:
        return '2.7'
    if sys.version_info.major == 3:
        return sysconfig.get_python_version()
    return subprocess.check_output((
        'python3', '-c',
        'import sysconfig; print(sysconfig.get_python_version())'
    )).strip()

In newer versions of Ubuntu python3.6 is the default and environment with incompatible interpreter can be created.

What do you think about hardcoding python3 version and display error message when there is no interpreter with required version on developer's machine?

@yola/service-engineering @yola/operations-engineering

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