Skip to content

Commit

Permalink
fix: [SUP-2395] package missing error (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusArdelean authored Jan 29, 2024
1 parent 393f119 commit 80c5f15
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
5 changes: 3 additions & 2 deletions pysrc/pip_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_tree_of_packages_dependencies(

tree = utils.sorted_tree(dist_tree)
nodes = tree.keys()
key_tree = dict((k.key, v) for k, v in tree.items())
key_tree = dict((canonicalize_package_name(k.key), v) for k, v in tree.items())

lowercase_pkgs_names = [p.name.lower() for p in top_level_requirements]
tlr_by_key = dict((tlr.name.lower(), tlr) for tlr in top_level_requirements)
Expand All @@ -57,7 +57,8 @@ def create_tree_of_packages_dependencies(
(p.project_name and p.project_name.lower()) in lowercase_pkgs_names]

def create_children_recursive(root_package, key_tree, ancestors, all_packages_map):
root_name = root_package[NAME].lower()
root_name = canonicalize_package_name(root_package[NAME])

if root_name not in key_tree:
msg = 'Required packages missing: ' + root_name
if allow_missing:
Expand Down
33 changes: 27 additions & 6 deletions test/system/inspect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('inspect', () => {
{
pkg: {
name: 'markupsafe',
version: '2.1.3',
version: '2.1.4',
},
directDeps: ['jinja2'],
},
Expand All @@ -131,7 +131,7 @@ describe('inspect', () => {
{
pkg: {
name: 'markupsafe',
version: '2.1.3',
version: '2.1.4',
},
directDeps: ['jinja2'],
},
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('inspect', () => {
{
pkg: {
name: 's3transfer',
version: '0.9.0',
version: '0.10.0',
},
directDeps: ['awss'],
},
Expand All @@ -173,7 +173,7 @@ describe('inspect', () => {
{
pkg: {
name: 'markupsafe',
version: '2.1.3',
version: '2.1.4',
},
directDeps: ['jinja2'],
},
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('inspect', () => {
{
pkg: {
name: 'jsonschema',
version: '4.20.0',
version: '4.21.1',
},
directDeps: ['openapi-spec-validator'],
},
Expand Down Expand Up @@ -235,6 +235,27 @@ describe('inspect', () => {
},
],
},
{
workspace: 'pip-app-deps-canonicalization',
uninstallPackages: [],
pluginOpts: {},
expected: [
{
pkg: {
name: 'zope.interface',
version: '5.4.0',
},
directDeps: ['zope.interface'],
},
{
pkg: {
name: 'twisted',
version: '23.10.0',
},
directDeps: ['twisted'],
},
],
},
])(
'should get a valid dependency graph for workspace = $workspace',
async ({ workspace, uninstallPackages, pluginOpts, expected }) => {
Expand Down Expand Up @@ -381,7 +402,7 @@ describe('inspect', () => {
{
pkg: {
name: 'markupsafe',
version: '2.1.3',
version: '2.1.4',
},
directDeps: ['jinja2'],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zope.interface==5.4.0
twisted==23.10.0

0 comments on commit 80c5f15

Please sign in to comment.