File tree 2 files changed +45
-3
lines changed
2 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
4
4
wheel_file_re = re .compile (
5
- r"""^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
6
- ((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
7
- \.whl|\.dist-info)$""" ,
5
+ r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))"
6
+ r"(-(?P<build>\d.*?))?"
7
+ r"-(?P<pyver>.+?)"
8
+ r"-(?P<abi>.+?)"
9
+ r"-(?P<plat>.+?)"
10
+ r"\.whl|\.dist-info$" ,
8
11
re .VERBOSE ,
9
12
)
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+ from poetry .utils import patterns
4
+
5
+
6
+ @pytest .mark .parametrize (
7
+ ["filename" , "expected" ],
8
+ [
9
+ (
10
+ "markdown_captions-2-py3-none-any.whl" ,
11
+ {
12
+ "namever" : "markdown_captions-2" ,
13
+ "name" : "markdown_captions" ,
14
+ "ver" : "2" ,
15
+ "build" : None ,
16
+ "pyver" : "py3" ,
17
+ "abi" : "none" ,
18
+ "plat" : "any" ,
19
+ },
20
+ ),
21
+ (
22
+ "SQLAlchemy-1.3.20-cp27-cp27mu-manylinux2010_x86_64.whl" ,
23
+ {
24
+ "namever" : "SQLAlchemy-1.3.20" ,
25
+ "name" : "SQLAlchemy" ,
26
+ "ver" : "1.3.20" ,
27
+ "build" : None ,
28
+ "pyver" : "cp27" ,
29
+ "abi" : "cp27mu" ,
30
+ "plat" : "manylinux2010_x86_64" ,
31
+ },
32
+ ),
33
+ ],
34
+ )
35
+ def test_wheel_file_re (filename , expected ):
36
+ match = patterns .wheel_file_re .match (filename )
37
+ groups = match .groupdict ()
38
+
39
+ assert groups == expected
You can’t perform that action at this time.
0 commit comments