File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fixed sync failure on gems with colons in dependency specs (e.g., rails).
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ async def read_info(relative_path, versions_info):
157157 (item .split (":" , maxsplit = 1 ) for item in dependencies .split ("," ))
158158 )
159159 for stmt in back .split ("," ):
160- key , value = stmt .split (":" )
160+ key , value = stmt .split (":" , 1 )
161161 if key == "checksum" :
162162 gem_info ["checksum" ] = value
163163 elif key == "ruby" :
Original file line number Diff line number Diff line change 1- from pulp_gem .specs import ruby_ver_cmp , ruby_ver_includes
1+ import asyncio
2+
3+ from pulp_gem .specs import read_info , ruby_ver_cmp , ruby_ver_includes
24
35
46def test_version_cmp ():
@@ -20,3 +22,21 @@ def test_version_includes():
2022 assert ruby_ver_includes (">= 1&< 3" , "1.5.a0" )
2123 assert ruby_ver_includes (">= 1&< 3" , "3.0.0a5" )
2224 assert not ruby_ver_includes (">= 1&< 3" , "3.0.1a5" )
25+
26+
27+ def test_read_info_colon_in_value (tmp_path ):
28+ info_file = tmp_path / "info"
29+ info_file .write_text (
30+ "---\n 7.0.1 activesupport:= 7.0.1|checksum:abc123,ruby:>= 2.7.0,rubygems:>= 1.8.11\n "
31+ )
32+ versions_info = {"7.0.1" : {"version" : "7.0.1" , "platform" : "ruby" , "prerelease" : False }}
33+
34+ async def _collect ():
35+ return [info async for info in read_info (str (info_file ), versions_info )]
36+
37+ results = asyncio .run (_collect ())
38+ assert len (results ) == 1
39+ assert results [0 ]["checksum" ] == "abc123"
40+ assert results [0 ]["required_ruby_version" ] == ">= 2.7.0"
41+ assert results [0 ]["required_rubygems_version" ] == ">= 1.8.11"
42+ assert results [0 ]["dependencies" ] == {"activesupport" : "= 7.0.1" }
You can’t perform that action at this time.
0 commit comments