Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #60 from deajan/master
Browse files Browse the repository at this point in the history
Fix hinted compilation did drop all packages
  • Loading branch information
deajan authored Mar 30, 2021
2 parents d0ad628 + c6ecc1f commit cdcd0f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions hinted-compilation/hinted-mods.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2019-2020, Jorj McKie, mailto:<[email protected]>
# Copyright 2019-2020, Orsiris de Jong, mailto:<[email protected]>
# Copyright 2019-2021, Orsiris de Jong, mailto:<[email protected]>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
Expand Down Expand Up @@ -86,11 +86,12 @@ def get_checklist(full_name):
"""
if not full_name: # guard against nonsense
return []
checklist = [full_name] # full name is always looked up first
checklist = [full_name.asString(), full_name.asString() + '.*'] # full name is always looked up first
m0 = ""
while True: # generate *-import names
pkg, full_name = full_name.splitPackageName()
if not pkg: break
if not pkg:
break
m = pkg.asString()
m0 += "." + m if m0 else m
checklist.append(m0 + ".*")
Expand Down Expand Up @@ -374,7 +375,7 @@ def onModuleEncounter(self, module_filename, module_name, module_kind):
self.info(ignore_msg)
return False, "dropped by plugin " + plugin.plugin_name

if full_name == "cv2":
if full_name.asString() == "cv2":
return True, "needed by OpenCV"

if str(full_name.getTopLevelPackageName()).startswith("pywin"):
Expand All @@ -385,7 +386,7 @@ def onModuleEncounter(self, module_filename, module_name, module_kind):
if m in checklist:
return True, "module is hinted to" # ok

if check_dependents(full_name, self.import_files) is True:
if check_dependents(full_name.asString(), self.import_files) is True:
return True, "parent of recursed-to module"

# next we ask if implicit imports knows our candidate
Expand Down
6 changes: 3 additions & 3 deletions hinted-compilation/nuitka-hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# Copyright 2019-2020, Jorj McKie, mailto:<[email protected]>
# Copyright 2019-2020, Orsiris de Jong, mailto:<[email protected]>
# Copyright 2019-2021, Orsiris de Jong, mailto:<[email protected]>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
Expand Down Expand Up @@ -44,8 +44,8 @@

# TODO: Provide a comparison/check method in the nuitka.Version module, maybe for 0.6.10

if not nuitka_version >= (0,6,9):
sys.exit("This needs Nuitka version 0.6.9 or higher, this is %s" % getNuitkaVersion())
if not nuitka_version >= (0,6,11):
sys.exit("This needs Nuitka version 0.6.11 or higher, this is %s" % getNuitkaVersion())

python_version = sys.version.split()[0]
this_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down

0 comments on commit cdcd0f1

Please sign in to comment.