-
Notifications
You must be signed in to change notification settings - Fork 12
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
Question regarding version requirements #351
Comments
This versioning scheme was an intentional choice, since in theory pytket 1.y should be backwards-compatible with pytket 1.x when y >= x, but may have bugfixes and improvements, and we don't want to have to make a new release of every extension whenever there is a new pytket release. (Similarly for qiskit.) However, I do realize that it makes reproducibility more difficult, and there are occasionally cases where behaviour changes in ways that we don't realize anyone depends on, or bugs are introduced in new versions. Would it work for you to take a snapshot of installed versions of all python packages as a way to ensure reproducibility? |
Thanks for you quick response, @cqc-alec. Let me give you a bit more of context why this is a problem for us: In our project MQT Bench (https://github.com/cda-tum/mqt-bench), we follow the Scientific Python Development Guide that suggest to mark warnings as error during the CI triggering The problem is now, that the current version management here automatically pulls the latest |
Could you perhaps use a pip constraints file to limit the versions of packages you'd like to install? |
Hi all, Let me quickly chime in here from the MQT maintainer side and add a couple of comments. First of all, I agree that, in principle, if a library truly follows semantic versioning, then version a.b.c should be compatible with any version under the same major version, i.e., a.x.z Now, in practice, and even more so in a young field such as quantum computing, almost no library truly follows semantic versioning. Many developers are very hesitant to increase major versions which leads to breaking changes also being introduced in minor versions (even if these changes are hidden as features). Please correct me if I am wrong, but pull requests such as #349 also give the impression that you might be misinterpreting what Because you stated in one of the comments above that you wouldn't want to release new versions of this plugin for every new release of Qiskit or pytket: you wouldn't have to do that if you were specifying I hope these considerations make sense and you'll consider adopting the proposed change. |
Just some further thoughts: Based on Qiskit's release cycle alone, this would imply 4 new versions per year. In addition, if a new minor version should truly follow SemVer and is fully backward compatible without requiring changes, you can always specify the dependency as e.g. This is also what dependabot could do for you automatically. If you specify |
Hi all,
Just to clarify the changes in the PR you mentioned: The idea is that everything before this PR should have worked with |
In addition to the points raised by @cqc-alec we had issues in the past with to tight version making it impossible to install packages together in the same env. Can you maybe give some more details why it is the best place to tighten the version here in pytket-qiskit and why this can't be on your side? |
That PR updates the version bounds for several packages:
(I'll just ignore the upper cap for numpy 2.0 for now as it is not related to the issue at hand) The fact that these dependency lower bounds were upgraded (based on changes in these dependencies, as you said) indicates to me that the premise of the previous version of the code being compatible with
was not fully true.
Supported version ranges should always be as large as possible. And I can only say that we faced similar problems with too tight version ranges in the past; so I know the feeling. I gave this quite some thought now as this is definitely not an easy thing to decide on in general. Based on these thoughts and also on re-reading the linked article from above, I'd actually not suggest to limit the dependency versions to, e.g.,
Should a problem be discovered with one of the versions, such as for example a @nquetschlich what this means on our side is that situations might occur, where we need to temporarily upper cap the |
The general rule we follow is to require We don't want to allow qiskit 2.0 (or pytket 2.0), since those will almost certainly break stuff, whereas new qiskit 1.x or pytket 1.x releases shouldn't (even though they occasionally do, but we detect those cases on CI as you say). We'll update the pytket lower bound when a new pytket version is released that fixes bugs or adds functionality relevant to the extension. I accept that we may be a little overzealous in updating lower bounds where we're not aware of any need to do so. It does make testing easier, however, since we only need to test with the latest version of a given dependency rather than needing to test with previous versions as well. |
I really really recommend reading through the article linked above (https://iscinumpy.dev/post/bound-version-constraints) for why translating these assumptions into upper version caps is hardly ever a good idea. I'll try to re-collect a couple thoughts here. Updating lower bounds aggressively is not really an issue. Typically, it's rather a good thing to work with modern versions of the respective tools as it also encourages others to not stick to very old versions. However, it is not good to combine high lower bounds with tight upper bounds (as, e.g., for the In general, a package with underconstrained dependencies is always fixable. Users (such as us) can always introduce an upper cap for one of the dependencies once we notice something is going on. While this is a small nuisance, it's fixable. However, an overconstrained system is unfixable as it is simply impossible in the Python ecosystem to remove an upper cap in a library you depend on. So while your assumption might be right that Qiskit 2.0 and pytket 2.0 or qiskit-aer 0.15 might break things, they might as well not. And if they do not, then you overconstrained your package unnecessarily. Again, I am just repeating some arguments from the article above. |
Thanks, this is an interesting article and I will give it some thought. Your suggestion (to remove upper caps) is the opposite of the original suggestion in this issue (which was to introduce stricter upper caps): so, it's a complicated problem to which there may be no really good solution. I'm almost persuaded that we should remove the upper caps altogether, and only add constraints where we know they are necessary. The major downside would be that we'd only know this after the event -- after an update came along that broke something. perhaps for a lot of users. |
Fully agree. It's a difficult question with no "one-fits-all" answer. After posting my initial suggestion (of even tighter bounds), I couldn't help but remember the article from above and how convincingly it argued for explicitly not using upper caps heavily (especially for libraries).
While that can be a nuisance to some users, it is always fixable on the user side by constraining the version if they are affected and until this library here is fixed. Adding upper caps puts quite a bit of pressure on the maintainers of the library here to quickly update the version bounds when new versions of its dependencies come out. Because if not updated quickly, users that want to use this library are still limited to old version of its dependencies (e.g., qiskit and/or pytket) until maintainers officially declare this package compatible and release a new version. I believe the benefits of dropping the upper caps significantly outweigh the potential drawbacks. |
This is true. OK, happy to give this a try. |
Hi there, I have noticed that the qiskit and tket version requirements are in the format of
This has the effect, that for each new release of those two packages of version
1.x.y
are included, e.g., when pytket was upgrade from1.28.0 to 1.29.0
, the requirement ofpytket ~= 1.27
automatically included it (since 1.29.0 satisfies ~= 1.27). Would it possible to switch toby including the patch version as well?
We are heavily using this package as a dependency and this versioning scheme has led to some unexpected changed behavior and makes versioning not so easy for us.
The text was updated successfully, but these errors were encountered: