-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensuring library compatibility with CircuitPython version #181
Comments
Would be nice to have a facility to see, on-disk and at runtime, what bundle version is installed and in use. VERSIONS.txt shows the bundle date (and of course all of the individual versions), but I'm not aware of a snapshot where I can see on CIRCUITPY (as a human or as a .py) if I have the 4.x or 5.x bundle for that date installed. I suppose one could copy / parse the parent folder on the target device, |
I finally got some cycles to put my random thoughts, and some brainstorming, down.
|
@sommersoft Thanks for the detailed analysis, which shows up a number of things that weren't obvious. The base issue keeps coming up for people who are confused about which BLE library to get.
Once we create a CPy-specific branch, we have to create branches for previous versions as well. For instance, just having Or we could just create all these branches right away, on every library: it's just a mechanical thing. We would create 1.x, 2.x, 3.x, and 4.x branches. Note #175, "Finding latest release assumes latest tag is on master", which we'll have to deal with.
|
@ntoll Do you have any opinion here wrt CircUp? We discussed this yesterday in the weekly meeting, and felt the option 3 was the easiest, though it goes beyond what semver has in mind for how to use the metadata part of the version string. |
@dhalbert thanks for pinging me about this -- much appreciated. I concur that option 3 is likely the easiest solution and can see how I could easily update Circup to facilitate this convention. 👍 |
Could the other release fields be used at all as a place to store the additional meta data? I'm thinking the "Release Title" and "Release Description" that also get filled out in addition to the tag. |
FWIW, I'd really like to avoid this problem if we can. I'd rather only support BLE with 5.0.0. Dependency tracking is a huge rat hole where tons of time can be spent. (Python is still spending this time.) Instead, I'd rather packages throw friendly exceptions for unsupported versions and always support the newest version. |
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.
The text was updated successfully, but these errors were encountered: