Skip to content

Commit 0969712

Browse files
authored
Merge pull request #2526 from nexB/2524-pypi
Improve pypi and windows processing #2524 Fix support for Windows PE DLLs and exe that was disabled. Signed-off-by: Philippe Ombredanne <[email protected]>
2 parents f2b5328 + 3b40d7f commit 0969712

File tree

307 files changed

+12449
-1612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+12449
-1612
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/thirdparty
99

1010
# virtualenv and other misc bits
11-
*.egg-info
11+
/src/*.egg-info
1212
/dist
1313
/build
1414
/bin

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ click==6.7
1010
colorama==0.4.4
1111
commoncode==21.1.21
1212
debian-inspector==0.9.10
13-
dparse2==0.5.0.4
13+
dparse==0.5.1
1414
extractcode==21.2.24
1515
extractcode-7z==16.5.210223
1616
extractcode-libarchive==3.5.1.210223
@@ -40,7 +40,7 @@ patch==1.16
4040
pdfminer.six==20181108
4141
pefile==2019.4.18
4242
pip==20.3.3
43-
pkginfo==1.5.0.1
43+
pkginfo==1.7.0
4444
pluggy==0.12.0
4545
plugincode==21.1.21
4646
ply==3.9
@@ -72,4 +72,4 @@ wcwidth==0.1.7
7272
webencodings==0.5
7373
wheel==0.36.2
7474
xmltodict==0.11.0
75-
zipp==0.5.1
75+
zipp==3.4.1

setup-mini.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ install_requires =
6161
colorama >= 0.3.9
6262
commoncode >= 21.1.21
6363
debian-inspector >= 0.9.10
64-
dparse2
64+
dparse >= 0.5.1
6565
fasteners
6666
fingerprints >= 0.6.0
6767
ftfy < 5.0.0
6868
gemfileparser >= 0.7.0
6969
html5lib
70+
importlib_metadata; python_version < "3.9"
7071
intbitset >= 2.3.0, < 3.0
7172
jaraco.functools
7273
javaproperties >= 0.5
@@ -77,6 +78,7 @@ install_requires =
7778
MarkupSafe >= 0.23
7879
nltk >= 3.2, !=3.6, < 4.0
7980
packageurl_python >= 0.7.0
81+
packaging
8082
pdfminer.six >= 20170720
8183
pefile >= 2018.8.8
8284
pkginfo >= 1.5.0.1
@@ -95,6 +97,7 @@ install_requires =
9597
typing >=3.6, < 3.7; python_version < "3.7"
9698
urlpy
9799
xmltodict >= 0.11.0
100+
zipp >= 3.0.0; python_version < "3.9"
98101
typecode >= 21.2.24
99102

100103

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ install_requires =
6161
colorama >= 0.3.9
6262
commoncode >= 21.1.21
6363
debian-inspector >= 0.9.10
64-
dparse2
64+
dparse >= 0.5.1
6565
fasteners
6666
fingerprints >= 0.6.0
6767
ftfy < 5.0.0
6868
gemfileparser >= 0.7.0
6969
html5lib
70+
importlib_metadata; python_version < "3.9"
7071
intbitset >= 2.3.0, < 3.0
7172
jaraco.functools
7273
javaproperties >= 0.5
@@ -77,6 +78,7 @@ install_requires =
7778
MarkupSafe >= 0.23
7879
nltk >= 3.2, !=3.6, < 4.0
7980
packageurl_python >= 0.7.0
81+
packaging
8082
pdfminer.six >= 20170720
8183
pefile >= 2018.8.8
8284
pkginfo >= 1.5.0.1
@@ -95,6 +97,7 @@ install_requires =
9597
typing >=3.6, < 3.7; python_version < "3.7"
9698
urlpy
9799
xmltodict >= 0.11.0
100+
zipp >= 3.0.0; python_version < "3.9"
98101
extractcode[full] >= 21.2.24
99102
typecode[full] >= 21.2.24
100103

src/packagedcode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from packagedcode import rubygems
3131
from packagedcode import win_pe
3232

33-
3433
# Note: the order matters: from the most to the least specific
3534
# Package classes MUST be added to this list to be active
3635
PACKAGE_TYPES = [
@@ -89,6 +88,7 @@
8988
if len(PACKAGES_BY_TYPE) != len(PACKAGE_TYPES):
9089
seen_types = {}
9190
for pt in PACKAGE_TYPES:
91+
assert pt.default_type
9292
seen = seen_types.get(pt.default_type)
9393
if seen:
9494
msg = ('Invalid duplicated packagedcode.Package types: '

src/packagedcode/models.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,12 @@ def to_dict(self, _detailed=False, **kwargs):
603603

604604
def compute_normalized_license(declared_license):
605605
"""
606-
Return a normalized license_expression string using the declared_license
607-
field. Return 'unknown' if there is a declared license but it cannot be
608-
detected (including on errors) and return None if there is no declared
609-
license.
606+
Return a normalized license_expression string from the ``declared_license``.
607+
Return 'unknown' if there is a declared license but it cannot be detected
608+
(including on errors) and return None if there is no declared license.
610609
"""
611610

612-
if not declared_license or not declared_license.strip():
611+
if not declared_license:
613612
return
614613

615614
from packagedcode import licensing

0 commit comments

Comments
 (0)