28
28
from commoncode import fileutils
29
29
from commoncode .hash import multi_checksums
30
30
from commoncode .text import python_safe_name
31
- from packaging import tags as packaging_tags
32
- from packaging import version as packaging_version
31
+ from packvers import tags as packaging_tags
32
+ from packvers import version as packaging_version
33
33
34
34
import utils_pip_compatibility_tags
35
35
115
115
TRACE_ULTRA_DEEP = False
116
116
117
117
# Supported environments
118
- PYTHON_VERSIONS = "36" , " 37" , "38" , "39" , "310"
118
+ PYTHON_VERSIONS = "37" , "38" , "39" , "310"
119
119
120
120
PYTHON_DOT_VERSIONS_BY_VER = {
121
- "36" : "3.6" ,
122
121
"37" : "3.7" ,
123
122
"38" : "3.8" ,
124
123
"39" : "3.9" ,
@@ -134,7 +133,6 @@ def get_python_dot_version(version):
134
133
135
134
136
135
ABIS_BY_PYTHON_VERSION = {
137
- "36" : ["cp36" , "cp36m" , "abi3" ],
138
136
"37" : ["cp37" , "cp37m" , "abi3" ],
139
137
"38" : ["cp38" , "cp38m" , "abi3" ],
140
138
"39" : ["cp39" , "cp39m" , "abi3" ],
@@ -912,7 +910,7 @@ def load_pkginfo_data(self, dest_dir=THIRDPARTY_DIR):
912
910
declared_license = [raw_data ["License" ]] + [
913
911
c for c in classifiers if c .startswith ("License" )
914
912
]
915
- license_expression = compute_normalized_license_expression (declared_license )
913
+ license_expression = get_license_expression (declared_license )
916
914
other_classifiers = [c for c in classifiers if not c .startswith ("License" )]
917
915
918
916
holder = raw_data ["Author" ]
@@ -1337,10 +1335,10 @@ def package_from_dists(cls, dists):
1337
1335
1338
1336
For example:
1339
1337
>>> w1 = Wheel(name='bitarray', version='0.8.1', build='',
1340
- ... python_versions=['cp36 '], abis=['cp36m '],
1338
+ ... python_versions=['cp38 '], abis=['cp38m '],
1341
1339
... platforms=['linux_x86_64'])
1342
1340
>>> w2 = Wheel(name='bitarray', version='0.8.1', build='',
1343
- ... python_versions=['cp36 '], abis=['cp36m '],
1341
+ ... python_versions=['cp38 '], abis=['cp38m '],
1344
1342
... platforms=['macosx_10_9_x86_64', 'macosx_10_10_x86_64'])
1345
1343
>>> sd = Sdist(name='bitarray', version='0.8.1')
1346
1344
>>> package = PypiPackage.package_from_dists(dists=[w1, w2, sd])
@@ -2274,16 +2272,16 @@ def find_problems(
2274
2272
check_about (dest_dir = dest_dir )
2275
2273
2276
2274
2277
- def compute_normalized_license_expression (declared_licenses ):
2275
+ def get_license_expression (declared_licenses ):
2278
2276
"""
2279
2277
Return a normalized license expression or None.
2280
2278
"""
2281
2279
if not declared_licenses :
2282
2280
return
2283
2281
try :
2284
- from packagedcode import pypi
2282
+ from packagedcode . licensing import get_only_expression_from_extracted_license
2285
2283
2286
- return pypi . compute_normalized_license (declared_licenses )
2284
+ return get_only_expression_from_extracted_license (declared_licenses )
2287
2285
except ImportError :
2288
2286
# Scancode is not installed, clean and join all the licenses
2289
2287
lics = [python_safe_name (l ).lower () for l in declared_licenses ]
0 commit comments