Skip to content

Commit

Permalink
fix: update uv provider to resolve lock from project when root lock i…
Browse files Browse the repository at this point in the history
…s not available
  • Loading branch information
lucasvieirasilva committed Jan 22, 2025
1 parent ec0af4d commit 9282ad9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/nx-python/src/provider/uv/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ export class UVProvider implements IProvider {
? readPyprojectToml<UVPyprojectToml>(this.tree, pyprojectTomlPath)
: getPyprojectData<UVPyprojectToml>(pyprojectTomlPath);

const data = this.rootLockfile.package[projectData.project.name];
console.log('data', data);
const lockData = this.isWorkspace
? this.rootLockfile
: getUvLockfile(joinPathFragments(projectRoot, 'uv.lock'), this.tree);

const data = lockData.package[projectData.project.name];
const group = data?.dependencies?.find(
(item) => item.name === dependencyName,
)
Expand All @@ -106,8 +108,8 @@ export class UVProvider implements IProvider {
)?.[0];

return {
name: this.rootLockfile.package[dependencyName].name,
version: this.rootLockfile.package[dependencyName].version,
name: lockData.package[dependencyName].name,
version: lockData.package[dependencyName].version,
group,
};
}
Expand Down

0 comments on commit 9282ad9

Please sign in to comment.