Skip to content

Ensuring library compatibility with CircuitPython version #181

Open
@dhalbert

Description

@dhalbert

In each major version of CircuitPython (major.x.x), we may make incompatible API changes. In each minor version (x.minor.x), we may add additional API functionality. Our current policy to support two major versions of CircuitPython: a stable version and an upcoming release that is in alpha or beta. The libraries have to track CircuitPython as it evolves. How can we do this in an automated way, so that a user is confident they have the latest compatible library version?

Currently we package the same version of a library in all bundles we make, for all versions of CircuitPython. If there are incompatible changes between CircuitPython versions, we add code to each libraries that is affected;:that code does version-checking or failover to support the API differences. As we move the supported version window, we can clean up these work-arounds.

We could instead have different versions of a library for different CircuitPython versions, as necessary. For each version of CircuitPython, we would bundle the latest version of the library that supported that version of CPy. If an incompatible change was necessary, we would release a new library version, but keep the old version for the older bundle. For instance, a library might work for 3.x and 4.x, but not for 5.x without an incompatible change. We'd bundle the latest version for 5.x, and bundle the highest compatible older version for 3.x and 4.x.

To support multiple, we could have multiple branches for the CPy versions, and fetch the version from the appropriate branch. Or, we could track the minimum CPy version in, say __init__.py as a constant, something like __minimum_cpy_version__ = '3.0.0'. The bundle builder would scan the releases of a library to find the latest one for the bundle being built. This minimum version info could be encoded in other ways, such as a suffix to the library version, or a filename.

Once we drop support for a CPy version, we no longer build bundles for that version. We should consider keeping an archive version of the last bundle, for those who cannot upgrade due to older applications or boards we've stopped updating (e.g., ESP8266).

Further comments welcome. This issue was first discussed in the "In the weeds" section of the CIrcuitPython weekly meeting on August 19, 2019: https://www.youtube.com/watch?v=eqIY1M6TvaA.

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