However, I can't find a way to see the version from python.
In [4]: import cython
In [5]: cython.__version__
AttributeError: 'module' object has no attribute '__version__'
It looks like there is a __version__ in the __init__.py, but that
doen'st appear to be hoe it's getting imported, rather the
higher-level cyton.py is gettign imported, which then imports
Cython.Shadow:
In [6]: cython.__file__
Out[6]: '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packa ges/cython.py'
I find this all a bit confusing -- but maybe __version__ should be
defined in Cython.Shadow.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
On Wed, Oct 3, 2012 at 10:50 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
> Folks,
> running:
> $cython --version
> gives me the version of the cyton script.
> However, I can't find a way to see the version from python.
> In [4]: import cython
> In [5]: cython.__version__
> AttributeError: 'module' object has no attribute '__version__'
> It looks like there is a __version__ in the __init__.py, but that
> doen'st appear to be hoe it's getting imported, rather the
> higher-level cyton.py is gettign imported, which then imports
> Cython.Shadow:
> In [6]: cython.__file__
> Out[6]: '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packa ges/cython.py'
> I find this all a bit confusing -- but maybe __version__ should be
> defined in Cython.Shadow.
Yeah, this is a bit confusing. +1 to adding it to Shadow (which could
be resolved at compile time as well). Also, you could try importing
Cython instead of cython.
On Wed, Oct 3, 2012 at 10:55 AM, Robert Bradshaw <rober...@gmail.com> wrote:
> On Wed, Oct 3, 2012 at 10:50 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
>> I find this all a bit confusing -- but maybe __version__ should be
>> defined in Cython.Shadow.
> Yeah, this is a bit confusing. +1 to adding it to Shadow (which could
> be resolved at compile time as well). Also, you could try importing
> Cython instead of cython.
yup -- that gets me the version, but shy does the cython.py wierd
import thing exist anyway? Presumably there is a reason.
Also, I think it's a bad a idea to have a package module with an
upper-case name (particularly one mirroring a lower-case name) --
there are case-insensitive file systems out there (what does this do
on Windows?)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
On Wed, Oct 3, 2012 at 11:05 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
> On Wed, Oct 3, 2012 at 10:55 AM, Robert Bradshaw <rober...@gmail.com> wrote:
>> On Wed, Oct 3, 2012 at 10:50 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
>>> I find this all a bit confusing -- but maybe __version__ should be
>>> defined in Cython.Shadow.
>> Yeah, this is a bit confusing. +1 to adding it to Shadow (which could
>> be resolved at compile time as well). Also, you could try importing
>> Cython instead of cython.
> yup -- that gets me the version, but shy does the cython.py wierd
> import thing exist anyway? Presumably there is a reason.
> Also, I think it's a bad a idea to have a package module with an
> upper-case name (particularly one mirroring a lower-case name) --
On Wed, Oct 3, 2012 at 11:13 AM, Robert Bradshaw <rober...@gmail.com> wrote:
> With the exception of __version__, importing either one should have
> the same effect.
so we really shold move __version__ to Cython.Shadow
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
> On Wed, Oct 3, 2012 at 10:55 AM, Robert Bradshaw <rober...@gmail.com> wrote:
>> On Wed, Oct 3, 2012 at 10:50 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
>>> I find this all a bit confusing -- but maybe __version__ should be
>>> defined in Cython.Shadow.
>> Yeah, this is a bit confusing. +1 to adding it to Shadow (which could
>> be resolved at compile time as well).
Yes, I think it makes sense to have it in Shadow.
>> Also, you could try importing Cython instead of cython.
> yup -- that gets me the version, but shy does the cython.py wierd
> import thing exist anyway? Presumably there is a reason.
It's two things: the main program entry point and the "magic" namespace
that holds all the nice Cython language goodies (that's the part in
Shadow.py).
> Also, I think it's a bad a idea to have a package module with an
> upper-case name (particularly one mirroring a lower-case name) --
> there are case-insensitive file systems out there (what does this do
> on Windows?)
Nothing special on Windows here. The package name is "Cython" and the
name of the module file is "cython.py". Module names are always case
sensitive in Python. The "Cython" package is an entirely different thing
than the "cython" namespace module.
On Wed, Oct 3, 2012 at 11:20 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
> On Wed, Oct 3, 2012 at 11:13 AM, Robert Bradshaw <rober...@gmail.com> wrote:
>> With the exception of __version__, importing either one should have
>> the same effect.