I'm wondering how to handle multiple major versions of a dependency library.
I have an open source library, Foo
, at an early release stage. The library is a wrapper around another open source library, Bar
. Bar
has just launched a new major version. Foo
currently only supports the previous version. As I'm guessing that a lot of people will be very slow to convert from the previous major version of Bar
to the new major version, I'm reluctant to switch to the new version myself.
How is this best handled? As I see it I have these options
- Switch to the new major version, potentially denying people on the old version.
- Keep going with the old version, potentially denying people on the new version.
- Have two different branches, updating both branches for all new features. Not sure how this works with PyPi. Wouldn't I have to release at different version numbers each time?
- Separate the repository into two parts. Don't really want to do this.
The ideal solution for me would be to have the same code base, where I could have some sort of C/C++ macro-like thing where if the version is new
, use new_bar_function
, else use old_bar_function
. When installing the library from PyPi, the already installed version of the major version dictates which version is used. If no version is installed, install the newest.
Would much appreciate some pointers.