See the revision in the installed module

0 views
Skip to first unread message

Friedrich Hagedorn

unread,
Apr 17, 2008, 6:08:06 AM4/17/08
to sy...@googlegroups.com
Hello,

is there a variable to see the revision in the installed sympy module?

May be

[~] % isympy
Python 2.5.1 console for SymPy 0.5.13-hg

These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols('xyz')
>>> k, m, n = symbols('kmn', integer=True)
>>> f = Function("f")

Documentation can be found at http://sympy.org/

In [1]: sympy.rev

--> cb530fab81c4

So I could see on what revision I work with sympy.

By,

Friedrich

Ondrej Certik

unread,
Apr 17, 2008, 9:28:10 AM4/17/08
to sy...@googlegroups.com

Right. Well, the problem is that it's difficult to embed this into the
sources, because once you save it to sources, you change the hash. :)

You can use:

$ hg parents
changeset: 1952:90caafd36b5a
tag: tip
user: Mateusz Paprocki <mat...@gmail.com>
date: Mon Apr 14 10:01:47 2008 +0200
summary: Implemented more efficient Buchberger algorithm

to get the revision. And if you use releases, use:

$ hg tags
tip 1952:90caafd36b5a
sympy-0.5.13 1863:8c19f52ad1cd
sympy-0.5.12 1735:cce944aebc40
sympy-0.5.11 1636:7d61e7bcfed9
sympy-0.5.10 1627:beabd2bcdec2
sympy-0.5.9 1585:4a8f0d11e6ee
sympy-0.5.8 1559:b548987ff8b6
sympy-0.5.7 1517:16b03611b402
sympy-0.5.6 1504:5fb2967dad8b
sympy-0.5.5 1496:0e440111e2d5
sympy-0.5.4 1446:37c086eb4027
sympy-0.5.3 1197:8e5128d9e08e
sympy-0.5.0 1091:0097ca10a4e9
sympy-0.4.3 934:616bcbdca3bc
sympy-0.4.1 767:d6a8b9912008

this gives you the revisions of all releases (this doesn't change).

Ondrej

Friedrich Hagedorn

unread,
Apr 17, 2008, 9:40:27 AM4/17/08
to sy...@googlegroups.com
On Thu, Apr 17, 2008 at 03:28:10PM +0200, Ondrej Certik wrote:
>
> On Thu, Apr 17, 2008 at 12:08 PM, Friedrich Hagedorn <fried...@gmx.de> wrote:
> >
> > Hello,
> >
> > is there a variable to see the revision in the installed sympy module?
> >
> > May be
> >
> > [~] % isympy
> > Python 2.5.1 console for SymPy 0.5.13-hg
^^^^^^^^^
This one I know. But I thought I can get a more accurate information
of revision.

> >
> > These commands were executed:
> > >>> from __future__ import division
> > >>> from sympy import *
> > >>> x, y, z = symbols('xyz')
> > >>> k, m, n = symbols('kmn', integer=True)
> > >>> f = Function("f")
> >
> > Documentation can be found at http://sympy.org/
> >
> > In [1]: sympy.rev
> >
> > --> cb530fab81c4
> >
> > So I could see on what revision I work with sympy.
>
> Right. Well, the problem is that it's difficult to embed this into the
> sources, because once you save it to sources, you change the hash. :)

Just an idea. One could create such variale with the

python setup.py install

process. I

hg pull

on my sympy-clone to look whats new and when I decide to upgrade then I
run the setup.py. But in the meantime I do sometimes

hg up ???

in my hg-clone. So I forget the installed revision. And when I say
"That dont work" I want to see what revision I have installed.

But this is may be a minor problem.

By,

Friedrich

Kirill Smelkov

unread,
Apr 17, 2008, 9:55:50 AM4/17/08
to sy...@googlegroups.com

This makes a lot of sense. We could get the idea how it could be done
from Mercurial itself:

http://selenic.com/repo/index.cgi/hg/file/tip/mercurial/version.py

Friedrich, are you interested in doing this?
Patches welcome!

--
Всего хорошего, Кирилл.

Abderrahim Kitouni

unread,
Apr 17, 2008, 10:04:18 AM4/17/08
to sy...@googlegroups.com
Hi,

On Thu, 17 Apr 2008 12:08:06 +0200
Friedrich Hagedorn <fried...@gmx.de> wrote:
>
> Hello,
>
> is there a variable to see the revision in the installed sympy module?
>
> May be
>

[...]


>
> In [1]: sympy.rev
>
> --> cb530fab81c4

I think we can do something like this using mercurial's keyword extension [1]
but I haven't tried it.

> So I could see on what revision I work with sympy.
>
> By,
>
> Friedrich

[1] http://www.selenic.com/mercurial/wiki/index.cgi/KeywordExtension

Abderrahim

Ondrej Certik

unread,
Apr 17, 2008, 10:08:48 AM4/17/08
to sy...@googlegroups.com
On Thu, Apr 17, 2008 at 3:40 PM, Friedrich Hagedorn <fried...@gmx.de> wrote:
>
> On Thu, Apr 17, 2008 at 03:28:10PM +0200, Ondrej Certik wrote:
> >
> > On Thu, Apr 17, 2008 at 12:08 PM, Friedrich Hagedorn <fried...@gmx.de> wrote:
> > >
> > > Hello,
> > >
> > > is there a variable to see the revision in the installed sympy module?
> > >
> > > May be
> > >
> > > [~] % isympy
> > > Python 2.5.1 console for SymPy 0.5.13-hg
> ^^^^^^^^^
> This one I know. But I thought I can get a more accurate information
> of revision.

Oops, sorry. Right. One solution is the setup.py, the other is to get
this information from Mercurial directly if you use sympy from the
tree (i.e. not installing it, which is what I prefer). Actually we can
do both. Yep, I am for it.

Ondrej

Friedrich Hagedorn

unread,
Apr 25, 2008, 7:46:59 PM4/25/08
to sy...@googlegroups.com

I have sent the patch to sympy-patches.

By,
Friedrich

Reply all
Reply to author
Forward
0 new messages