Skip to content

Commit 80c5f15

Browse files
fix: [SUP-2395] package missing error (#231)
1 parent 393f119 commit 80c5f15

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

pysrc/pip_resolve.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def create_tree_of_packages_dependencies(
4747

4848
tree = utils.sorted_tree(dist_tree)
4949
nodes = tree.keys()
50-
key_tree = dict((k.key, v) for k, v in tree.items())
50+
key_tree = dict((canonicalize_package_name(k.key), v) for k, v in tree.items())
5151

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

5959
def create_children_recursive(root_package, key_tree, ancestors, all_packages_map):
60-
root_name = root_package[NAME].lower()
60+
root_name = canonicalize_package_name(root_package[NAME])
61+
6162
if root_name not in key_tree:
6263
msg = 'Required packages missing: ' + root_name
6364
if allow_missing:

test/system/inspect.spec.ts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('inspect', () => {
117117
{
118118
pkg: {
119119
name: 'markupsafe',
120-
version: '2.1.3',
120+
version: '2.1.4',
121121
},
122122
directDeps: ['jinja2'],
123123
},
@@ -131,7 +131,7 @@ describe('inspect', () => {
131131
{
132132
pkg: {
133133
name: 'markupsafe',
134-
version: '2.1.3',
134+
version: '2.1.4',
135135
},
136136
directDeps: ['jinja2'],
137137
},
@@ -159,7 +159,7 @@ describe('inspect', () => {
159159
{
160160
pkg: {
161161
name: 's3transfer',
162-
version: '0.9.0',
162+
version: '0.10.0',
163163
},
164164
directDeps: ['awss'],
165165
},
@@ -173,7 +173,7 @@ describe('inspect', () => {
173173
{
174174
pkg: {
175175
name: 'markupsafe',
176-
version: '2.1.3',
176+
version: '2.1.4',
177177
},
178178
directDeps: ['jinja2'],
179179
},
@@ -201,7 +201,7 @@ describe('inspect', () => {
201201
{
202202
pkg: {
203203
name: 'jsonschema',
204-
version: '4.20.0',
204+
version: '4.21.1',
205205
},
206206
directDeps: ['openapi-spec-validator'],
207207
},
@@ -235,6 +235,27 @@ describe('inspect', () => {
235235
},
236236
],
237237
},
238+
{
239+
workspace: 'pip-app-deps-canonicalization',
240+
uninstallPackages: [],
241+
pluginOpts: {},
242+
expected: [
243+
{
244+
pkg: {
245+
name: 'zope.interface',
246+
version: '5.4.0',
247+
},
248+
directDeps: ['zope.interface'],
249+
},
250+
{
251+
pkg: {
252+
name: 'twisted',
253+
version: '23.10.0',
254+
},
255+
directDeps: ['twisted'],
256+
},
257+
],
258+
},
238259
])(
239260
'should get a valid dependency graph for workspace = $workspace',
240261
async ({ workspace, uninstallPackages, pluginOpts, expected }) => {
@@ -381,7 +402,7 @@ describe('inspect', () => {
381402
{
382403
pkg: {
383404
name: 'markupsafe',
384-
version: '2.1.3',
405+
version: '2.1.4',
385406
},
386407
directDeps: ['jinja2'],
387408
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
zope.interface==5.4.0
2+
twisted==23.10.0

0 commit comments

Comments
 (0)