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

Fix scriptdir/bindir #9

Merged
merged 1 commit into from
Sep 21, 2015
Merged

Fix scriptdir/bindir #9

merged 1 commit into from
Sep 21, 2015

Conversation

dhoegh
Copy link
Contributor

@dhoegh dhoegh commented Sep 20, 2015

When I tried to update JuliaLang/IJulia.jl#357 to use the bindir and scriptdir function I found that the function pointed to the wrong scripts/bins. The scripts within the pkgs cannot be used because they cannot find the python interpreter. On Linux the Ipython script in deps/usr/bin works as intended and it looks like:

#!/home/hoegh/anaconda3/bin/python3
if __name__ == '__main__':
    import sys
    from IPython import start_ipython

    sys.exit(start_ipython())

the equivalent script in deps/usr/bin/pkgs/ipython-3.1.0-py34_0/bin do not work because it cannot find the python interpreter referenced in the first line.

#!/opt/anaconda1anaconda2anaconda3/bin/python3
if __name__ == '__main__':
    import sys
    from IPython import start_ipython

    sys.exit(start_ipython())

The case is the same on windows where executables inside deps\usr\pkgs do not work, while the equivalent executable in deps\usr\Scripts work. Therefore this PR update's to use the global bin directory on Linux and Scripts directory windows in deps/usr/. As bindir/scriptdir is not package dependent anymore I have made them constants and capitalized.


Conda.add("jupyter=4.0.0")
@test v"4.0.0"==run(`$(joinpath(Conda.SCRIPTDIR, "jypyter")) kernelspec --version`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old equivalent to this would be @test v"4.0.0"==run($(joinpath(Conda.scriptsdir(), "jypyter")) kernelspec --version) which would fail because the script do not work.


Conda.add("jupyter=1.0.0")
@test v"4.0.0" == convert(VersionNumber, chomp(readall(`$(joinpath(Conda.SCRIPTDIR, "jupyter")) kernelspec --version`)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old equivalent to this was @test v"4.0.0" == convert(VersionNumber, chomp(readall($(joinpath(Conda.scriptsdir("jupyter"), "jupyter")) kernelspec --version))) which would fail because the script did not work.

…The scripts within the pkgs cannot be used because they cannot find the python interpreter.

Conda.add("jupyter=1.0.0")
@test v"4.0.0" == convert(VersionNumber, chomp(readall(`$(joinpath(Conda.SCRIPTDIR, "jupyter-kernelspec")) --version`)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old equivalent to this was @test v"4.0.0" == convert(VersionNumber, chomp(readall($(joinpath(Conda.scriptsdir("jupyter"), "jupyter-kernelspec")) --version))) which would fail because the script did not work.

@Luthaf
Copy link
Contributor

Luthaf commented Sep 20, 2015

Thank you for that, it is nice of you !

Can you just update the documentation, and squash your commits ?

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 20, 2015

I have change the documentation to match. Are there any further changes to the documentation you see necerssary?

@Luthaf
Copy link
Contributor

Luthaf commented Sep 21, 2015

Are there any further changes to the documentation you see necerssary?

No, sorry, I was tired ... Thank you again !

Luthaf added a commit that referenced this pull request Sep 21, 2015
@Luthaf Luthaf merged commit 8574e6b into JuliaPy:master Sep 21, 2015
@dhoegh dhoegh deleted the fix_bindir branch September 23, 2015 19:27
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.

2 participants