13
13
14
14
# Pipfile format <-> requirements.txt format.
15
15
DEP_PIP_PAIRS = [
16
- ({"django" : ">1.10" }, "django>1.10" ),
17
- ({"Django" : ">1.10" }, "Django>1.10" ),
18
- ({"requests" : {"extras" : ["socks" ], "version" : ">1.10" }}, "requests[socks]>1.10" ),
19
- ({"requests" : {"extras" : ["socks" ], "version" : "==1.10" }}, "requests[socks]==1.10" ),
16
+ ({"django" : ">1.10" }, { "django" : "django >1.10"} ),
17
+ ({"Django" : ">1.10" }, { "Django" : "Django >1.10"} ),
18
+ ({"requests" : {"extras" : ["socks" ], "version" : ">1.10" }}, { "requests" : "requests [socks]>1.10"} ),
19
+ ({"requests" : {"extras" : ["socks" ], "version" : "==1.10" }}, { "requests" : "requests [socks]==1.10"} ),
20
20
(
21
21
{
22
22
"dataclasses-json" : {
25
25
"editable" : True ,
26
26
}
27
27
},
28
- "dataclasses-json@ git+https://github.com/lidatong/dataclasses-json.git@v0.5.7" ,
28
+ { "dataclasses-json" : "dataclasses-json @ git+https://github.com/lidatong/dataclasses-json.git@v0.5.7"} ,
29
29
),
30
30
(
31
31
{"dataclasses-json" : {"git" : "https://github.com/lidatong/dataclasses-json.git" , "ref" : "v0.5.7" }},
32
- "dataclasses-json@ git+https://github.com/lidatong/dataclasses-json.git@v0.5.7" ,
32
+ { "dataclasses-json" : "dataclasses-json @ git+https://github.com/lidatong/dataclasses-json.git@v0.5.7"} ,
33
33
),
34
34
(
35
35
# Extras in url
39
39
"extras" : ["pipenv" ],
40
40
}
41
41
},
42
- "dparse[pipenv] @ https://github.com/oz123/dparse/archive/refs/heads/master.zip" ,
42
+ { "dparse" : "dparse [pipenv] @ https://github.com/oz123/dparse/archive/refs/heads/master.zip"} ,
43
43
),
44
44
(
45
45
{
50
50
"editable" : False ,
51
51
}
52
52
},
53
- "requests[security]@ git+https://github.com/requests/requests.git@main" ,
53
+ { "requests" : "requests [security]@ git+https://github.com/requests/requests.git@main"} ,
54
54
),
55
55
]
56
56
@@ -64,23 +64,23 @@ def mock_unpack(link, source_dir, download_dir, only_download=False, session=Non
64
64
@pytest .mark .parametrize ("deps, expected" , DEP_PIP_PAIRS )
65
65
@pytest .mark .needs_internet
66
66
def test_convert_deps_to_pip (deps , expected ):
67
- assert dependencies .convert_deps_to_pip (deps ) == [ expected ]
67
+ assert dependencies .convert_deps_to_pip (deps ) == expected
68
68
69
69
70
70
@pytest .mark .utils
71
71
@pytest .mark .needs_internet
72
72
def test_convert_deps_to_pip_star_specifier ():
73
73
deps = {"uvicorn" : "*" }
74
- expected = "uvicorn"
75
- assert dependencies .convert_deps_to_pip (deps ) == [ expected ]
74
+ expected = { "uvicorn" : "uvicorn" }
75
+ assert dependencies .convert_deps_to_pip (deps ) == expected
76
76
77
77
78
78
@pytest .mark .utils
79
79
@pytest .mark .needs_internet
80
80
def test_convert_deps_to_pip_extras_no_version ():
81
81
deps = {"uvicorn" : {"extras" : ["standard" ], "version" : "*" }}
82
- expected = "uvicorn[standard]"
83
- assert dependencies .convert_deps_to_pip (deps ) == [ expected ]
82
+ expected = { "uvicorn" : "uvicorn [standard]"}
83
+ assert dependencies .convert_deps_to_pip (deps ) == expected
84
84
85
85
86
86
@pytest .mark .utils
@@ -95,7 +95,7 @@ def test_convert_deps_to_pip_extras_no_version():
95
95
"hash" : "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" ,
96
96
}
97
97
},
98
- "FooProject==1.2 --hash=sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" ,
98
+ { "FooProject" : "FooProject ==1.2 --hash=sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"} ,
99
99
),
100
100
(
101
101
{
@@ -105,7 +105,7 @@ def test_convert_deps_to_pip_extras_no_version():
105
105
"hash" : "sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" ,
106
106
}
107
107
},
108
- "FooProject[stuff]==1.2 --hash=sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" ,
108
+ { "FooProject" : "FooProject [stuff]==1.2 --hash=sha256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"} ,
109
109
),
110
110
(
111
111
{
@@ -115,7 +115,7 @@ def test_convert_deps_to_pip_extras_no_version():
115
115
"extras" : ["standard" ],
116
116
}
117
117
},
118
- " git+https://github.com/encode/uvicorn.git@master#egg=uvicorn[standard]" ,
118
+ { "uvicorn" : " git+https://github.com/encode/uvicorn.git@master#egg=uvicorn[standard]"} ,
119
119
),
120
120
],
121
121
)
@@ -126,8 +126,8 @@ def test_convert_deps_to_pip_one_way(deps, expected):
126
126
@pytest .mark .utils
127
127
def test_convert_deps_to_pip_one_way ():
128
128
deps = {"uvicorn" : {}}
129
- expected = "uvicorn"
130
- assert dependencies .convert_deps_to_pip (deps ) == [ expected . lower ()]
129
+ expected = { "uvicorn" : "uvicorn" }
130
+ assert dependencies .convert_deps_to_pip (deps ) == expected
131
131
132
132
133
133
@pytest .mark .utils
0 commit comments