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

No auto install spinedb api #60

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 6 additions & 25 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
using PyCall

run(`$(PyCall.pyprogramname) -m pip install --user 'git+https://github.com/Spine-project/Spine-Database-API'`)

try
pyimport("spinedb_api")
catch err
if err isa PyCall.PyError
if get(ENV, "CI", nothing) == "true"
run(`$(PyCall.pyprogramname) -m pip install --user 'git+https://github.com/Spine-project/Spine-Database-API'`)
else
error(
"""
The required Python package `spinedb_api` could not be found in the current Python environment

$(PyCall.pyprogramname)

You can fix this in two different ways:

A. Install `spinedb_api` in the current Python environment; open a terminal (command prompt on Windows) and run

$(PyCall.pyprogramname) -m pip install --user 'git+https://github.com/Spine-project/Spine-Database-API'

B. Switch to another Python environment that has `spinedb_api` installed; from Julia, run

ENV["PYTHON"] = "... path of the python executable ..."
Pkg.build("PyCall")
error(
"""
The required Python package `spinedb_api` could not be found in the current Python environment

And restart Julia.
"""
)
end
$(PyCall.pyprogramname)
"""
)
else
rethrow()
end
Expand Down