[Cython] finding the Cython version (was: Cython 0.21 released)

2014-09-11 Thread Stefan Behnel
Alex K schrieb am 11.09.2014 um 13:49:
> tables 3.0.0 (maybe later version too) fails to install with `pip install 
> tables==3.0.0` due to changes in naming. PyTables's build script expects 
> Cython.Compiler.Main.Version, and gives an error when it doesn't find it. 
> Cython 0.21 provides Cython.Compiler.Main.version.

The right way to check for the Cython version is

Cython.__version__

as with most Python packages. For backwards compatibility with old Cython
versions that didn't have it yet, you can use

Cython.Compiler.Version.version

Relying on a re-exported import like "Cython.Compiler.Main.Version" is like
asking for "os.sys" to work because the "os" module happens to do "import sys".

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] [cython-users] finding the Cython version (was: Cython 0.21 released)

2014-09-11 Thread Yury V. Zaytsev
On Thu, 2014-09-11 at 14:02 +0200, Stefan Behnel wrote:
> The right way to check for the Cython version is
> 
> Cython.__version__
> 
> as with most Python packages. 

Hi Stefan,

I've just send a pull request to PyTables to fix this:

https://github.com/PyTables/PyTables/pull/387

I would appreciate if you could chime in and vet it in the case that it
looks sane to you.

Thanks,

-- 
Sincerely yours,
Yury V. Zaytsev


___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] finding the Cython version

2014-09-11 Thread Stefan Behnel
Alex K schrieb am 11.09.2014 um 14:28:
> I am a user that can not install tables 3.0.0 with cython 0.21. Tables can 
> be installed with cython up to 0.20.2. Can you please consider to add 
> Cython.Compiler.Main.Version back so that users of old tables could still 
> use latest cython?

Normally, users should not have to use (or have) Cython themselves when
they want to install a Cython implemented package. Instead, the package
should ship the generated C sources and do a normal extension module build
by default, without running Cython at all. That avoids a build dependency
and makes sure that users really get exactly what the code maintainers
wanted to release and what they have properly tested before doing so.

That being said, we try to keep things working for users, unless there's an
actual reason to break something. I've definitely seen way worse
compatibility hacks than an unused import.

https://github.com/cython/cython/commit/43342ab90704f5f850733544288485048160003d

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel