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

Load library descriptor from URL with redirection #248

Closed
hanslovsky opened this issue May 20, 2021 · 4 comments
Closed

Load library descriptor from URL with redirection #248

hanslovsky opened this issue May 20, 2021 · 4 comments

Comments

@hanslovsky
Copy link

I attach a library descriptor as an artifact to a GitHub release. Loading the library descriptor from that release fails

%use jep@url[https://github.com/hanslovsky/jepyter/releases/download/jepyter-0.1.8/jep.json]

with the following error message:

Failed to process '%use jep@url[https://github.com/hanslovsky/jepyter/releases/download/jepyter-0.1.8/jep.json]' command. Error during library deserialization. Library descriptor text:
<html><body>You are being <a href="https://github-releases.githubusercontent.com/365409064/7185a300-b914-11eb-8e3a-879aa22cfb06?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210520%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20210520T024519Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=de25b6a24d8e079662b20b3ad2b7ac5f6dc6e135a1aa95eb956c34c6e6b695f9&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;key_id=0&amp;repo_id=365409064&amp;response-content-disposition=attachment%3B%20filename%3Djep.json&amp;response-content-type=application%2Foctet-stream">redirected</a>.</body></html>

The link redirects. With curl, I can add the -L flag to follow redirection:

~ curl -L https://github.com/hanslovsky/jepyter/releases/download/jepyter-0.1.8/jep.json
{
  "description": "Java Embedded Python.",
  "properties": {
    "jepyter.version": "jepyter-0.1.8",
    "jep.version": "3.9.1"
  },
  "link": "https://github.com/ninia/jep",
  "repositories": [
    "https://jitpack.io"
  ],
  "dependencies": [
    "black.ninia:jep:$jep.version",
    "me.hanslovsky:jepyter:$jepyter.version"
  ]
}

Would it be possible to follow redirection when providing the library descriptor as a URL?

@ileasile
Copy link
Collaborator

I think it's possible to enable redirection by default, without options. Seems pretty easy to do

@ileasile
Copy link
Collaborator

BTW, you may include native library (jep) into your JAR, so it could be used in notebooks without installation

@hanslovsky
Copy link
Author

I think that would be the ideal solution but jep does not include the native library in their jar. Not 100% sure why they do not but I assume it is to be able to support multiple versions of Python (they support python==2.7 and 3.3<=python<=3.9). I can imagine that it could be quite difficult to get it to work consistently across so many different systems, all with probably slightly different versions of libpython. I might try adding libpython to jepyter jar as well but I do not know how Python will handle installation of site-packages if libpython is provided in a jar.

@ileasile
Copy link
Collaborator

Ok, it's up to you.
I've added redirects in this commit: 3e4d12f

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

No branches or pull requests

2 participants