Skip to content

Commit

Permalink
fix(nx-python): remove deprecated property and replace with `context.…
Browse files Browse the repository at this point in the history
…projectsConfigurations` (#249)
  • Loading branch information
Cammisuli authored Oct 7, 2024
1 parent cee951b commit c920a62
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 138 deletions.
4 changes: 2 additions & 2 deletions packages/nx-python/src/dependency/update-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function updateDependencyTree(context: ExecutorContext) {

updateDependents(
context,
context.workspace,
context.projectsConfigurations,
context.projectName,
rootPyprojectToml,
context.root,
Expand Down Expand Up @@ -79,7 +79,7 @@ export function updateDependents(
}

function getProjectPackageName(context: ExecutorContext, projectName: string) {
const projectConfig = context.workspace.projects[projectName];
const projectConfig = context.projectsConfigurations.projects[projectName];
const projectToml = getProjectTomlPath(projectConfig);
const {
tool: {
Expand Down
48 changes: 16 additions & 32 deletions packages/nx-python/src/executors/add/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ describe('Add Executor', () => {
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -100,8 +99,7 @@ describe('Add Executor', () => {
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -152,8 +150,7 @@ describe('Add Executor', () => {
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -208,8 +205,7 @@ describe('Add Executor', () => {
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -259,8 +255,7 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -306,8 +301,7 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -391,9 +385,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'shared1',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -538,9 +531,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'shared1',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -655,9 +647,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -726,9 +717,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -801,9 +791,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -877,9 +866,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -947,9 +935,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -1021,9 +1008,8 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
projectsConfigurations: {
version: 2,
npmScope: 'nxlv',
projects: {
app: {
root: 'apps/app',
Expand Down Expand Up @@ -1082,8 +1068,7 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down Expand Up @@ -1165,8 +1150,7 @@ version = "1.0.0"
root: '.',
isVerbose: false,
projectName: 'app',
workspace: {
npmScope: 'nxlv',
projectsConfigurations: {
version: 2,
projects: {
app: {
Expand Down
3 changes: 2 additions & 1 deletion packages/nx-python/src/executors/add/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default async function executor(
try {
activateVenv(workspaceRoot);
await checkPoetryExecutable();
const projectConfig = context.workspace.projects[context.projectName];
const projectConfig =
context.projectsConfigurations.projects[context.projectName];
const rootPyprojectToml = existsSync('pyproject.toml');

if (options.local) {
Expand Down
Loading

0 comments on commit c920a62

Please sign in to comment.