-
Notifications
You must be signed in to change notification settings - Fork 3
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
Semantic versioning usability in OpenFisca extension #10
Comments
To me, it is the set of all its exposed parameters and variables, and all of its transitively exposed API surface (i.e. all helpers it includes and exposes, including Core-forwarded ones). If that theoretical definition is agreed upon, then the referenced 18.4.2 example should have been a breaking change.
To prevent conflicts, I would expect the Core dependency to be a transitive dependency from the Country package. The main interest I see in making the Core dependency explicit would be to know immediately if a major Country upgrade implies a Core upgrade, without reading the changelog. |
Thanks @MattiSG for your answer. What about OpenFisca-France 20.7.0
@fpagnoux did you change the syntax in OpenFisca-France because you had to (following the upgrade to Core v22) or because it was nicer? Great thanks ! |
Because I had, the previous trick was not compatible with the new version of Core.
So far, the second aspect has not entirely been taken into account, as we mainly focused on web API re-users. However, if we were to take the definition literally, this probably means than every core breaking change would also be a breaking change for France:
While frequent major versions publishing is not an issue per say (we don't do romantic versioning), two questions will arise:
|
Just to clarify something about this example:
So (as of today) providing both dependencies is not enough for guaranteeing that the installation works. |
The solution would be :
|
Fair point. That doesn't make a lot of sense either: the Country package might very well absorb the breaking change without any change to reusers, and the fact that extensions are in a weird situation where they depend both on Core functions and Country formulas is quite specific. It seems to me the question is now: can we consider a Country exposes an API surface of its own that can be considered different than the Core? This one is really tricky. I would think that the only API surface exposed by the country package should be its formulas and parameters. Is this currently the case? What else is exposed, including transitively? If the above was ensured, that would imply all helpers should be imported by extensions straight from the Core, not from the Country package. This way:
What I understand from the original post and #10 (comment), though, is that Pip shits its pants and “ends up installing 2 incompatible librairies”. If really the issue is only with the dependency solving in Pip, as @guillett pointed out (and that the current documentation + practice in OpenFisca is consistent and fits the criteria I described above), then the best is probably to just add a workaround (pointer: zazo) for the time until Pip fixes this issue, as seems to be underway, hopefully landing in a couple months. |
In the extension template, all helpers are directly imported from core. For a web API user, the variables and parameters signatures, and the web API itself, constitute the surface API. A few example of breaking changes:
For someone who uses OpenFisca in Python, much more is transitively exposed. For instance, let's considering this snippet: from openfisca_france import CountryTaxBenefitSystem
tax_benefit_system = CountryTaxBenefitSystem()
print(tax_benefit_system.get_variable('salaire_net').value_type) If the So far, the choice was to optimize the France version number for the first kind of users. The second kind, like extensions developpers, usually control both their core and france dependencies. |
@guillett what would solve the issue for you? Can we just document this understanding of what is the API surface in each relevant module? Or do you want support to try out |
Pipenv could be interesting to dig to. We don't really care about the whole lockfile thing, but they claim to have a real dependency resolver, and they are packed by the Python Software Foundation. |
Closing as stale. I think we're overdue a discussion about how we define the "public API" of the various parts of OpenFisca for the purposes of Semver, and this issue is not the best venue for this discussion. |
How to leverage semantic versioning without a proper dependency solver ?
As an extension developer, I struggle to manage version constraints.
To me it looks like, currently, an extension developer needs to specify the exact country package version (at least on OpenFisca-France) because event a patch update tolerance can lead to incompatibility issues.
Here is the experiment I have done (I uses French packages to illustrate my difficulties).
OpenFisca-France Changelog
I created a package to test a way to manage version constraints.
I was hoping that the following settings would be correct and usable.
However, it is not the case as shown by the runs on CircleCI.
Extract from pip list
The error, running
! openfisca-run-test test.yaml
Given the recent discussion on Slack about this (an important topic), I thought switching to GitHub is appropriate.
WDYT ? @MattiSG , @fpagnoux, @Morendil
The text was updated successfully, but these errors were encountered: