-
Notifications
You must be signed in to change notification settings - Fork 26
Description
A typical use case for capnpy is the following chains of requirements (lib, app are Python packages):
capnpy (from app)
capnpy (from lib->app)
i.e. lib contains a .capnproto schema (and so has capnpy as a compile-time requirement) and app makes use of the compiled schema provided by lib (and so has both capnpy and lib as run-time requirements).
Schema compilation can be slow, so it is desirable to publish a wheel for lib. If so, then compile-time != run-time in general, and the versions of capnpy used by lib and app may be different, but util.check_version insists that these versions be identical. This means that new releases of capnpy will break the existing wheel(s) for lib, and require a new versions to be built and published with the latest capnpy.
Pinning the capnpy version in lib unfortunately is not a solution, as pip is too dumb to notice the conflict; it first installs the unconstrained version requested by app, and later happily reports "Requirement already satisfied" when being asked to install the pinned version required by lib. A possible workaround would be to omit capnpy from the requirements of app altogether, and rely on the lib requirement to bring in the pinned version, but this seems like bad practice.
Possible solutions I can see:
-
Provide compatibility (between minor releases), such that
appandlibcan both specifycapnpy<N+1.0.0. This really just reduces the frequency of breakages, but may be good enough. -
Bundle the "incompatible" parts of the
capnpyrun-time library into wheels at compile-time. I have no idea how hard this would be!