Skip to content

Commit

Permalink
fix: update getProvider calls to include context parameter in executors
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvieirasilva committed Jan 9, 2025
1 parent 9c2cf5b commit 5ae2025
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/flake8/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export default async function executor(
}

const lintingArgs = ['flake8', '--output-file', absPath];
const provider = await getProvider(workspaceRoot);
const provider = await getProvider(
workspaceRoot,
undefined,
undefined,
context,
);
await provider.run(lintingArgs, workspaceRoot, {
cwd,
log: false,
Expand Down
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/publish/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export default async function executor(
process.chdir(workspaceRoot);

try {
const provider = await getProvider(workspaceRoot, logger);
const provider = await getProvider(
workspaceRoot,
logger,
undefined,
context,
);
await provider.publish(options, context);

return {
Expand Down
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/ruff-check/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export default async function executor(
.concat(options.lintFilePatterns)
.concat(options.__unparsed__);

const provider = await getProvider(workspaceRoot);
const provider = await getProvider(
workspaceRoot,
undefined,
undefined,
context,
);
await provider.run(commandArgs, workspaceRoot, {
cwd: projectConfig.root,
log: false,
Expand Down
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/sls-deploy/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export default async function executor(
) {
const workspaceRoot = context.root;
process.chdir(workspaceRoot);
const provider = await getProvider(workspaceRoot);
const provider = await getProvider(
workspaceRoot,
undefined,
undefined,
context,
);
provider.activateVenv(workspaceRoot);

const projectConfig =
Expand Down
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/sls-package/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export default async function executor(
) {
const workspaceRoot = context.root;
process.chdir(workspaceRoot);
const provider = await getProvider(workspaceRoot);
const provider = await getProvider(
workspaceRoot,
undefined,
undefined,
context,
);
provider.activateVenv(workspaceRoot);

const projectConfig =
Expand Down
7 changes: 6 additions & 1 deletion packages/nx-python/src/executors/tox/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export default async function executor(
process.chdir(workspaceRoot);
logger.setOptions(options);
try {
const provider = await getProvider(workspaceRoot);
const provider = await getProvider(
workspaceRoot,
undefined,
undefined,
context,
);
await provider.checkPrerequisites();

const projectConfig =
Expand Down

0 comments on commit 5ae2025

Please sign in to comment.