-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Julia 1.7 #457
Merged
Merged
Support Julia 1.7 #457
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5421684
Update Julia versions in CI
tkf 7ae9698
Ignore when jl_ is not defined
tkf 2c6fbe9
DEBUG: Print on error
tkf e07f2d4
Skip running tess with nightly for now
tkf 9b5782d
Fix completions for 32bit Windows
tkf 57dcad6
Use chdir hack in macOS
tkf 756ca89
Fix indentation
tkf 77785be
Skip sysimage tests in macOS
tkf 74b5854
Revert "DEBUG: Print on error"
tkf fde44f0
More verbose import error if debug=True
tkf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
from .juliainfo import JuliaInfo | ||
from .options import parse_jl_options | ||
from .utils import is_windows | ||
from .utils import is_apple, is_windows | ||
|
||
logger = getLogger("julia") | ||
|
||
|
@@ -31,8 +31,13 @@ | |
|
||
def setup_libjulia(libjulia): | ||
# Store the running interpreter reference so we can start using it via self.call | ||
libjulia.jl_.argtypes = [c_void_p] | ||
libjulia.jl_.restype = None | ||
try: | ||
jl_ = libjulia.jl_ | ||
except AttributeError: | ||
pass | ||
else: | ||
jl_.argtypes = [c_void_p] | ||
jl_.restype = None | ||
|
||
# Set the return types of some of the bridge functions in ctypes terminology | ||
libjulia.jl_eval_string.argtypes = [c_char_p] | ||
|
@@ -211,14 +216,14 @@ def __init__(self, libjulia_path, bindir, sysimage): | |
if sys.version_info >= (2, 7, 13) and sys.version_info < (2, 7, 14): | ||
libjulia_path = libjulia_path.encode("ascii") | ||
|
||
with self._windows_pathhack(): | ||
with self._pathhack(): | ||
self.libjulia = ctypes.PyDLL(libjulia_path, ctypes.RTLD_GLOBAL) | ||
|
||
setup_libjulia(self.libjulia) | ||
|
||
@contextmanager | ||
def _windows_pathhack(self): | ||
if not is_windows: | ||
def _pathhack(self): | ||
if not is_windows and not is_apple: | ||
yield | ||
return | ||
# Using `os.chdir` as a workaround for an error in Windows | ||
|
@@ -228,6 +233,8 @@ def _windows_pathhack(self): | |
# is reported to work by many users: | ||
# https://github.com/JuliaPy/pyjulia/issues/67 | ||
# https://github.com/JuliaPy/pyjulia/pull/367 | ||
# Using this workaround for Julia >= 1.6 in macOS for now: | ||
# https://github.com/JuliaLang/julia/issues/40246 | ||
cwd = os.getcwd() | ||
try: | ||
os.chdir(os.path.dirname(self.libjulia_path)) | ||
Comment on lines
+236
to
240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
@@ -321,7 +328,7 @@ def init_julia(self, options=None): | |
logger.debug("argv[%d] = %r", i, argv[i]) | ||
|
||
logger.debug("calling jl_init_with_image(%s, %s)", jl_init_path, sysimage) | ||
with self._windows_pathhack(): | ||
with self._pathhack(): | ||
self.jl_init_with_image( | ||
jl_init_path.encode("utf-8"), sysimage.encode("utf-8") | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line that this comment, "Store the running interpreter reference...", to has been gone for a long time.