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

Have /api return the IPython version #6654

Merged
merged 1 commit into from
Oct 10, 2014
Merged

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Oct 8, 2014

closes #6647

Mostly opening that to discus what we should have in here.

@millejoh would that suite you ?

$ curl http://localhost:8888/api
{"version": [3, 0, 0, "dev"]}

I'm reluctant on displaying more on a non-authenticated response, like os, commit....
and I believe at least this should be available on non-auth user so that at least they know how to authenticate.

@Carreau
Copy link
Member Author

Carreau commented Oct 8, 2014

Note this is IPython version, not API version, but I'm not sure this really matters for now.

@millejoh
Copy link

millejoh commented Oct 8, 2014

That's perfect! Thank you.

John

-----Original Message-----
From: "Matthias Bussonnier" notifications@github.com
Sent: ‎10/‎8/‎2014 10:12 AM
To: "ipython/ipython" ipython@noreply.github.com
Cc: "John Miller" millejoh@mac.com
Subject: [ipython] Have /api return the IPython version (#6654)

closes #6647
Mostly opening that to discus what we should have in here.
@millejoh would that suite you ?
$ curl http://localhost:8888/api
{"version": [3, 0, 0, "dev"]}
I'm reluctant on displaying more on a non-authenticated response, like os, commit....
and I believe at least this should be available on non-auth user so that at least they know how to authenticate.

You can merge this Pull Request by running
git pull https://github.com/Carreau/ipython closes-6647Or view, comment on, or merge it at:
#6654
Commit Summary
Have /api return the IPython version
File Changes
M IPython/html/base/handlers.py (12)
Patch Links:
https://github.com/ipython/ipython/pull/6654.patch
https://github.com/ipython/ipython/pull/6654.diff

Reply to this email directly or view it on GitHub.=

@millejoh
Copy link

millejoh commented Oct 8, 2014

I agree, knowing the ipython version will be sufficient information to implement appropriate logic in EIN.

Thanks again!

John

-----Original Message-----
From: "Matthias Bussonnier" notifications@github.com
Sent: ‎10/‎8/‎2014 10:14 AM
To: "ipython/ipython" ipython@noreply.github.com
Cc: "John Miller" millejoh@mac.com
Subject: Re: [ipython] Have /api return the IPython version (#6654)

Note this is IPython version, not API version, but I'm not sure this really matters for now.

Reply to this email directly or view it on GitHub.=

@json_errors
def get(self):
# not authenticated, so give as few info as possible
self.finish(json.dumps({"version":IPython.version_info}))
Copy link
Member

Choose a reason for hiding this comment

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

This should probably just be IPython.__version__. We aren't using version tuples in any other APIs.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably just be IPython.version. We aren't using version tuples in any other APIs.

But it's an API, it would require frontends to parse or version string, which we always know is sooo reliable. Or worse, people will start comparing strings and will be bitten by "10.0.0" < "9.0.0". And's it's not because we did things wrong elsewhere that we shouldn't do it right here.

Copy link
Member

Choose a reason for hiding this comment

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

But it's an API, it would require frontends to parse or version string

Yup, as all version checks should. We store the IPython version in js in a string, too. Versions are generally stored in strings.

@Carreau
Copy link
Member Author

Carreau commented Oct 9, 2014

Yes, I'm optimistic that we will reach IPython 9.0.0 and skip over it from 8 to 10.

return version as a string, to be consistent with other APIs.

closes ipython#6647
@Carreau
Copy link
Member Author

Carreau commented Oct 10, 2014

Amended.

@damianavila
Copy link
Member

LGTM

minrk added a commit that referenced this pull request Oct 10, 2014
Have /api return the IPython version
@minrk minrk merged commit 4515e35 into ipython:master Oct 10, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Have /api return the IPython version
@Carreau Carreau deleted the closes-6647 branch December 15, 2014 16:50
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.

IPython 3.0 breaks compatibility with emacs-ipython-notebook
5 participants