-
Notifications
You must be signed in to change notification settings - Fork 547
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
ENH: Redirect github blob URLs to raw.github URLs #118
Conversation
westurner
commented
Nov 16, 2013
- Factored out URI value parsing logic
- Compile REGEXes once
- Doctest
- Removed ambiguous form handling logic
- Global REGEXes - Factored out URI value parsing logic - Doctest
@minrk I see:
If I was to write tests (and a tox.ini) for this application, is there a preference for/against:
|
We are just about to refactor nbviewer entirely (drop flask for tornado, use async, etc.) That WIP also does this redirect. As for tests, a tests subpackage in the nbviewer package would be how we've done things for most projects. |
Given the problems with Python 3 and dictionary ordering, in IPython, we have moved away from doctests, as we have found them to be more trouble than they are worth. |
I actually misread this - we actually should be avoiding GitHub raw URLs, and redirecting those to GitHub API requests, rather than pushing more requests toward them. |
Aren't the same problems inherent to unittest ordering? (and |
So there will be a new dependency on teh tornado web server?
I may be able to find the time to help with writing tests, given a link to a branch/repo.
Why? |
Probably yes, Flask is blocking which is annoying for a service like nbviewer where you cannot rely on time of remote to respond.
Raw github url are not supposed to be un-changing, changes in github API are planed. Also it help github know why their url is fetched by someone or a remote service, and make optimisation based on that. |
asyncio (tulip - tulip.http)
Tornado |
Are you suggesting that raw github links are going away? Is there a link describing this roadmap? So the GitHub API is less stable than the HTTP API, and that's why it is needed to use the API?
They need more than a user agent string to serve comperssed plaintext over HTTPS?
Good point. So there are different URL routes in this new version of nbviewer? Fate of this pull request That's great that this functionality is in the new version. As it is, the live version of nbviewer does not support this functionality (and recompiles regexes on every view invocation). Would you like me to:
b) just drop this patch and close the pull request c) other |
Actually, just because GitHub asked people to stop treating raw.github.com as a CDN, and that is precisely what we are doing. I don't think there is a great risk of raw URLs being unstable.
I think we can merge this as-is, actually. It's strictly an improvement over the status quo. +1 to merge, @Carreau? |
Current state of my tornado fiddling is at #120 now. |
Yes +1 to merge as it is strictly an improvement. will look at #120 too. |
ENH: Redirect github blob URLs to raw.github URLs