Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krystophny
Copy link

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 the python binary, one should look also there. This patch adds this behavior. Do you think one could also use site.PREFIXES to replace the default binary path? In that case I will create another patch.

@coveralls
Copy link

coveralls commented Jul 30, 2019

Pull Request Test Coverage Report for Build 792

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 85.007%

Totals Coverage Status
Change from base Build 790: 0.02%
Covered Lines: 1701
Relevant Lines: 2001

💛 - Coveralls

Copy link
Member

@tkf tkf left a 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).

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")}
Copy link
Member

@tkf tkf Jul 31, 2019

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?

Copy link
Member

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?

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants