fix(nx-python): remove direct dependency on nx #255
Merged
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.
Current Behavior
@nxlv/python
has a direct dependency onnx
locked to20.1.2
. In workspaces which are not on Nx20.1.2
(either older or newer), this causes there to be multiple versions of Nx in the workspace. Nx does its best to mitigate these sorts of issues but ideally, Nx plugins do not bring in their own version ofnx
.Expected Behavior
The way it should work for Nx plugins is that they all depend on
@nx/devkit
.@nx/devkit
itself has a peer dependency on the proper range of Nx which can be used with that particular version of@nx/devkit
. For example,@nx/devkit@20.1.2
works with Nx 19 - 21. Nx Plugins should inherit thispeerDependency
through it's dependency on@nx/devkit
rather than directly depending onnx
. What this means for workspaces is that all of the plugins used in a workspace should depend on the one main version ofnx
specified by that workspace.So what I've done in this PR is remove the dependency from
@nxlv/python
ontonx
.@nxlv/python
goes from having an explicit dependency onnx@20.1.2
to having apeerDependency
on Nx 19 - 21. ThispeerDependency
will be updated as you update@nxlv/python
's dependency on@nx/devkit
. This solves issues that users using versions of Nx other than20.1.2
may encounter due to having multiple versions of Nx present in their workspace.Please let me know if you have any questions. :)
Related Issue(s)
Fixes #