Skip to content

[feat] Compatibility for Python 3.8.x, 3.9.x #71

@mini-moose

Description

@mini-moose

Problem

Current version of src/config does not support using Python versions 3.8 or 3.9. Two primary drivers of the issue are:

  1. The tomllib library was implemented in version 3.11 onward. It was backported to earlier versions as tomli.
  2. Type hints were added by default in version 3.9 onward. Prior to that it was required to import Typing libraries to enable that function.

Impact

Users working with Python 3.8.x or 3.9.x cannot run the tool.

Steps to Reproduce

  1. Using pyenv, install python versions 3.8.x and 3.9.x.
  2. Create a venv with each of the installed versions.
  3. Follow the steps to run the tool in either virtual environment.
  4. Error occurs when attempting to import tomllib or use the current syntax for type hints.

Expected

The tool should run without error for users of Python version 3.8.x and 3.9.x.

Proposed Fix

In order to bring this into compliance with the Code Standards which require compatibility with Python versions 3.8+:

  • Create try/except in src/config to install the expected version of tomllib/tomli.
  • Explicitly import typing library if run with a compatible version.
  • Wishlist: Add logic to src/config to check that user is running the tool with a compatible version of Python.

Acceptance Criteria

The tool should run as long as the user is running the tool with a version of Python >= 3.8 +.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions