-
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
Added user site bin for julia-py #312
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 792
💛 - Coveralls |
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.
Thanks. I general I think this is the correct direction. I think it's good to go once we figure out some details (see my inline comment).
src/julia/tools.py
Outdated
stempath = os.path.join(os.path.dirname(executable), "julia-py") | ||
candidates = {os.path.basename(p): p for p in glob.glob(stempath + "*")} | ||
basedirs = {os.path.dirname(executable), | ||
os.path.join(site.USER_BASE, "bin")} |
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.
Why use set? I think we should use a list here in the order of increasing preference (so that the values of candidates
are the one in the most preferred location). Does basedirs = [os.path.dirname(executable), os.path.join(site.USER_BASE, "bin")] + site.PREFIXES
make sense?
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.
Actually, os.path.join(site.USER_BASE, "bin")
may not work in Windows? Is there a pre-defined path we can use?
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.
Thanks for the hint! I've changed the logics according to your remarks. On Windows there seem to be more difficulties anyway (starting with "libjulia" library extension), but this part looks like it should work if the rest does too.
Since I'm using
setup.py develop --user
in my setup,julia-py
binary is installed in~/.local/bin
. Rather than hardcoding the path to be at the same place as thepython
binary, one should look also there. This patch adds this behavior. Do you think one could also usesite.PREFIXES
to replace the default binary path? In that case I will create another patch.