Skip to content

Commit

Permalink
fix: remove the pdk and projen bins from the virtual envs as we want …
Browse files Browse the repository at this point in the history
…to use npx
  • Loading branch information
agdimech committed Apr 18, 2024
1 parent c5517bc commit 5de01b4
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions packages/monorepo/src/components/nx-configurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,14 @@ export class NxConfigurator extends Component implements INxProjectCore {
["install", "install:ci"].forEach((t) => {
const task = project.tasks.tryFind(t);

// Setup env
const cmd = "poetry env use python$PYTHON_VERSION";
task?.steps[0]?.exec !== cmd && task?.prependExec(cmd);
// Setup env and ensure the projen & pdk bins are removed from the venv as we always want to use the npx variant
[
"rm -f `poetry env info -p`/bin/projen `poetry env info -p`/bin/pdk",
"poetry env use python$PYTHON_VERSION",
].forEach(
(cmd) =>
!task?.steps.find((s) => s.exec === cmd) && task?.prependExec(cmd)
);

const pythonVersion = project.deps.tryGetDependency("python")?.version;
task!.env(
Expand Down
18 changes: 18 additions & 0 deletions packages/monorepo/test/__snapshots__/monorepo.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5de01b4

Please sign in to comment.