File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 13
13
from .project_name import get_project_name
14
14
from .req_file_parser import OptionsLine , parse as parse_req_file
15
15
from .req_merge import prepare_frozen_reqs_for_upgrade
16
- from .req_parser import get_req_names
16
+ from .req_parser import get_req_name , get_req_names
17
17
from .utils import (
18
18
HttpFetcher ,
19
19
get_temp_path_in_dir ,
28
28
)
29
29
30
30
31
+ def _req_line_sort_key (req_line : str ) -> str :
32
+ req_name = get_req_name (req_line )
33
+ if req_name is None :
34
+ return req_line
35
+ return req_name
36
+
37
+
31
38
def sync (
32
39
python : str ,
33
40
upgrade_all : bool ,
@@ -78,8 +85,9 @@ def sync(
78
85
):
79
86
if isinstance (parsed_req_line , OptionsLine ):
80
87
print (parsed_req_line .raw_line , file = f )
81
- # output frozen dependencies of project
82
- for req_line in frozen_reqs :
88
+ # output frozen dependencies of project,
89
+ # sorted by canonical requirement name
90
+ for req_line in sorted (frozen_reqs , key = _req_line_sort_key ):
83
91
print (normalize_req_line (req_line ), file = f )
84
92
# uninstall unneeded dependencies, if asked to do so
85
93
unneeded_req_names = sorted (
You can’t perform that action at this time.
0 commit comments