[Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Lisandro Dalcin
After getting AppVeyor to work, I noticed that Python 3 wheels do
include __pycache__ directory. This also happens with in OS X as well
as Linux.

I think the root of the issue resides in setup.py, in the build_ext
command class workaround that seems to be a legacy thing from the time
Cython required 2to3. BTW, in setup.py, compile_cython_modules()
follows quite a different path in Python 2 versus 3.

Unless some of you believe we should keep things that way, I'll try to
fix setup.py to be as much independent as possible of the major Python
version.

-- 
Lisandro Dalcin

Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Stefan Behnel
Lisandro Dalcin schrieb am 02.10.2015 um 12:11:
> After getting AppVeyor to work, I noticed that Python 3 wheels do
> include __pycache__ directory. This also happens with in OS X as well
> as Linux.
> 
> I think the root of the issue resides in setup.py, in the build_ext
> command class workaround that seems to be a legacy thing from the time
> Cython required 2to3. BTW, in setup.py, compile_cython_modules()
> follows quite a different path in Python 2 versus 3.

I already applied a change in master, would be worth seeing if that has an
effect here, too. There is certainly more that can be done. As you said,
this is legacy code (of a not so old legacy, though).


> Unless some of you believe we should keep things that way, I'll try to
> fix setup.py to be as much independent as possible of the major Python
> version.

Please do. :)

Stefan

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


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Stefan Behnel
Stefan Behnel schrieb am 02.10.2015 um 13:26:
> Lisandro Dalcin schrieb am 02.10.2015 um 12:11:
>> After getting AppVeyor to work, I noticed that Python 3 wheels do
>> include __pycache__ directory. This also happens with in OS X as well
>> as Linux.
>>
>> I think the root of the issue resides in setup.py, in the build_ext
>> command class workaround that seems to be a legacy thing from the time
>> Cython required 2to3. BTW, in setup.py, compile_cython_modules()
>> follows quite a different path in Python 2 versus 3.
> 
> I already applied a change in master, would be worth seeing if that has an
> effect here, too. There is certainly more that can be done. As you said,
> this is legacy code (of a not so old legacy, though).
> 
> 
>> Unless some of you believe we should keep things that way, I'll try to
>> fix setup.py to be as much independent as possible of the major Python
>> version.

Ah - note that Python 3.2 still uses the unicode fixer of 2to3, so the code
is not entirely legacy. Would be nice if it could be moved out of the way,
though. Especially since it will eventually disappear entirely.

Stefan

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


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Lisandro Dalcin
On 2 October 2015 at 14:30, Stefan Behnel  wrote:
> Ah - note that Python 3.2 still uses the unicode fixer of 2to3, so the code
> is not entirely legacy. Would be nice if it could be moved out of the way,
> though. Especially since it will eventually disappear entirely.

Yes, I'm aware of this. I'll push a fix in branch 0.23.x (I'm doing my
tests in OS X), then see what happens with the AppVeyor builds.


-- 
Lisandro Dalcin

Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Lisandro Dalcin
On 2 October 2015 at 15:07, Lisandro Dalcin  wrote:
> On 2 October 2015 at 14:30, Stefan Behnel  wrote:
>> Ah - note that Python 3.2 still uses the unicode fixer of 2to3, so the code
>> is not entirely legacy. Would be nice if it could be moved out of the way,
>> though. Especially since it will eventually disappear entirely.
>
> Yes, I'm aware of this. I'll push a fix in branch 0.23.x (I'm doing my
> tests in OS X), then see what happens with the AppVeyor builds.
>

AppVeyor builds succeeded:
https://ci.appveyor.com/project/cython/cython/build/0.23.x-4

The Python 3 wheels no longer have *.pyc files, so I'm confident this
is fixed for other platforms as well.

Stefan, could you manage to merge branch 0.23.x into master?

PS: At some point, we should try to really run the testsuite in AppVeyor.


-- 
Lisandro Dalcin

Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Stefan Behnel
Lisandro Dalcin schrieb am 02.10.2015 um 15:18:
> On 2 October 2015 at 15:07, Lisandro Dalcin wrote:
>> On 2 October 2015 at 14:30, Stefan Behnel wrote:
>>> Ah - note that Python 3.2 still uses the unicode fixer of 2to3, so the code
>>> is not entirely legacy. Would be nice if it could be moved out of the way,
>>> though. Especially since it will eventually disappear entirely.
>>
>> Yes, I'm aware of this. I'll push a fix in branch 0.23.x (I'm doing my
>> tests in OS X), then see what happens with the AppVeyor builds.
> 
> AppVeyor builds succeeded:
> https://ci.appveyor.com/project/cython/cython/build/0.23.x-4
> 
> The Python 3 wheels no longer have *.pyc files, so I'm confident this
> is fixed for other platforms as well.
> 
> Stefan, could you manage to merge branch 0.23.x into master?

Done, thanks! github just told me that my merge landed as commit 1. :)

I also changed a couple of minor things:

https://github.com/cython/cython/commit/64da2480e88d8cd3eec2b9a5d2922307623c3cd5

I guess the

   # XXX hack for '*.pyx ' sources

referred to the setuptools quirk that stubbornly replaces .pyx by .c?


> PS: At some point, we should try to really run the testsuite in AppVeyor.

What's not working there?

Stefan

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


Re: [Cython] Python 3 wheels including bytecode files.

2015-10-02 Thread Lisandro Dalcin
On 2 October 2015 at 17:01, Stefan Behnel  wrote:
> Lisandro Dalcin schrieb am 02.10.2015 um 15:18:
>> On 2 October 2015 at 15:07, Lisandro Dalcin wrote:
>>> On 2 October 2015 at 14:30, Stefan Behnel wrote:
 Ah - note that Python 3.2 still uses the unicode fixer of 2to3, so the code
 is not entirely legacy. Would be nice if it could be moved out of the way,
 though. Especially since it will eventually disappear entirely.
>>>
>>> Yes, I'm aware of this. I'll push a fix in branch 0.23.x (I'm doing my
>>> tests in OS X), then see what happens with the AppVeyor builds.
>>
>> AppVeyor builds succeeded:
>> https://ci.appveyor.com/project/cython/cython/build/0.23.x-4
>>
>> The Python 3 wheels no longer have *.pyc files, so I'm confident this
>> is fixed for other platforms as well.
>>
>> Stefan, could you manage to merge branch 0.23.x into master?
>
> Done, thanks! github just told me that my merge landed as commit 1. :)
>
> I also changed a couple of minor things:
>
> https://github.com/cython/cython/commit/64da2480e88d8cd3eec2b9a5d2922307623c3cd5
>

I don't like your change. Before, the self-cythonization was triggeres
when you actually needed to compile the extensions, now a simple
"setup.py --version" will do.

Try yourself:

$ git clean -dxf
$ python setup.py --version



> I guess the
>
># XXX hack for '*.pyx ' sources
>
> referred to the setuptools quirk that stubbornly replaces .pyx by .c?
>

Yes, indeed.

>
>> PS: At some point, we should try to really run the testsuite in AppVeyor.
>
> What's not working there?
>

Right now, the "test" step in AppVeyor invokes "python setup.py test",
which basically does nothing. I mean, you should run "python
runtests.py" intead.
https://github.com/cython/cython/blob/0.23.x/appveyor.yml#L73

-- 
Lisandro Dalcin

Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel