-
Notifications
You must be signed in to change notification settings - Fork 585
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
Replacing semantic version
with Version
#5754
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5754 +/- ##
==========================================
- Coverage 99.67% 99.67% -0.01%
==========================================
Files 416 416
Lines 38686 38393 -293
==========================================
- Hits 38562 38268 -294
- Misses 124 125 +1 ☔ View full report in Codecov by Sentry. |
…o bugfix-PauliRot_torch_interface
albi3ro
approved these changes
May 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lillian542
approved these changes
May 29, 2024
PietropaoloFrisoni
added a commit
that referenced
this pull request
May 31, 2024
**Context:** In #5754, we forgot to add `packaging` as a new hard requirement for PennyLane. Some developers experienced troubles when importing PL. **Description of the Change:** We included `packaging` in the relevant contexts as a new required package. **Benefits:** The user would not experience trouble importing PennyLane if `packaging` is not installed on his/her system. **Possible Drawbacks:** None that I can think of, except possible issues with external plugins for incompatibilities between the previous workflow of `semantic_version` and the new one of `packaging` (in which case, we can quickly restore the previous `semantic_version` usage where it occurs). **Related GitHub Issues:** None. **Related Shortcut Stories:** [sc-64576].
PietropaoloFrisoni
added a commit
that referenced
this pull request
Jun 9, 2024
**Context:** After #5769 and #5754, we can potentially replace all the occurrences of the `semantic_version` package with `packaging` in the PennyLane source code, and remove `semantic_version` from the required Python packages. **Description of the Change:** As stated above, we replace the remaining occurrences of `semantic_version` with `packaging` and remove `semantic_version` from the required packages in PennyLane. **Benefits:** One package less to keep track of in the dependencies. **Possible Drawbacks:** None that I can think of, providing that there are no incompatibilities with the previous workflow (in which case, we can always revert this PR) **Related GitHub Issues:** None. **Related ShortCut Stories:** [sc-64659]
PietropaoloFrisoni
added a commit
that referenced
this pull request
Aug 1, 2024
**Context:** After #5769 and #5754, we can potentially replace all the occurrences of the `semantic_version` package with `packaging` in the PennyLane source code, and remove `semantic_version` from the required Python packages. A similar attempt was performed in #5782, but it was reverted due to some errors in the plugin-matrix tests. **Description of the Change:** We replace the remaining occurrences of `semantic_version` with `packaging` and remove `semantic_version` from the required packages in PennyLane. With respect to #5782, now the plugins can be correctly instantiated as: ``` dev = qml.device("qiskit.aer", wires=2) dev = qml.device("cirq.simulator", wires=1) ``` etc. Specifically, the reason was the usage of `packaging` to replace `semantic_version`in the `pennylane/__init__.py` file. There was an incompatibility between the workflow of the two packages. Right now, the replacement has been performed to maintain the workflow. For example, ``` from packaging.specifiers import SpecifierSet, Specifier from packaging.version import Version pennylane_requires = ">=0.37.0" version = "0.38.0.dev0" >>> Version(version) in SpecifierSet(pennylane_requires) False >>> Version(version) in SpecifierSet(pennylane_requires, prereleases=True) True ``` **Benefits:** One package less to keep track of in the dependencies. **Possible Drawbacks:** Errors in the plugin-text matrix. If they happen, we'll react as quickly as possible. **Related GitHub Issues:** None. **Related Shortcut Stories** [sc-64659]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: This bug is related to the fact that
semantic_version
cannot handle a string ending with.post4
. Without installing a differentpytorch
version, it can simply be reproduced as follows.This is the code snippet to reproduce the error
which is fixed by:
Description of the Change: We replace
semantic_version
withVersion
, which can handle such a string.Benefits: The bug does not arise if the user has a
torch
installation ending with.post4
Possible Drawbacks: None that I can think of.
Related GitHub Issues: #5689
Related Shortcut Stories [sc-63356]