nx release publish ignores dependsOn configuration for custom executors
#33856
Unanswered
bilelomrani1
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behavior
When using
nx release publishwith a custom executor (non-JavaScript ecosystem), thedependsOnconfiguration on thenx-release-publishtarget is completely ignored.Example Configuration
project.json:
{ "name": "my-python-package", "targets": { "build": { "executor": "@my-org/python:build", "outputs": ["{projectRoot}/dist"] }, "nx-release-publish": { "dependsOn": ["build"], "executor": "@my-org/python:publish", "options": { "distPath": "{projectRoot}/dist" } } } }Observed Behavior
The
"build"target is not executed when callingnx release publish.Expected Behavior
The
nx release publishcommand should respectdependsOnconfiguration and execute dependent tasks (likebuild) before runningnx-release-publish, similar to hownx runandnx run-manywork.Motivation
Python (and other non-JS ecosystems) require building AFTER versioning
Unlike JavaScript/npm where
package.jsonis copied separately from build artifacts, Python embeds the version number into the build artifacts themselves:pyproject.toml,setup.py, etc.)The correct flow is:
Setting
dependsOn: ["build"]on thenx-release-publishtarget would be the idiomatic Nx way to express this workflow, but it doesn't work becausenx release publishseems to bypass the task orchestration system.preVersionCommandis not the correct solution here, as it executes before the version bump.Questions
Is this intentional behavior? Was
nx release publishdesigned to bypassdependsOnfor specific reasons?What is the recommended approach for non-JS ecosystems? Should we:
nx release publishentirely and use custom targets withnx run-many -t publish?Would a fix be accepted? If this is a bug rather than by design, would a PR to make
nx release publishrespectdependsOnbe welcome?Beta Was this translation helpful? Give feedback.
All reactions