Issue2148

classification
Title: Support a complete implementation of ctypes via JyNI
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: Arfrever, santa4nt, stefan.richthofer, zyasoft
Priority: high Keywords:

Created on 2014-05-17.20:14:24 by zyasoft, last changed 2016-02-16.15:20:43 by stefan.richthofer.

Messages
msg8426 (view) Author: Jim Baker (zyasoft) Date: 2014-05-17.20:14:24
ctypes was never completed, and a number of bugs have been raised (#1916, #1917). Incomplete is essentially useless for something like ctypes.

I'm proposing we remove ctypes for beta 4 in favor of eventual CFFI support, specifically through the Jiffy project (current vaporware, https://github.com/jythontools/jiffy). The feedback from our PyPy colleagues is that CFFI is the way to go, especially since it has good unit tests and it's a much smaller project.
msg8437 (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) Date: 2014-05-18.09:26:50
Please do not delete ctypes. Some projects might use these parts of ctypes, which are implemented.
msg8439 (view) Author: Santoso Wijaya (santa4nt) Date: 2014-05-18.17:40:15
Why not just print a warning or something when the incomplete module is imported?
msg8446 (view) Author: Jim Baker (zyasoft) Date: 2014-05-20.17:41:33
Arfrever, are you aware of any such packages? It's hard to see how the current ctypes implementation could actually be useful, vs just a trap for the unwary. But if it's all in use, we can keep and remove as part of Jython 3.x, again in favor of CFFI.

Santoso, assuming we keep it, we could emit a DeprecationWarning describing this package as incomplete.
msg8529 (view) Author: Jim Baker (zyasoft) Date: 2014-05-22.01:01:13
This incomplete support of ctypes is an issue for supporting ipython on Jython. It would be ideal if this did not require a workaround on Jython:
https://github.com/ipython/ipython/pull/4226
msg9866 (view) Author: Jim Baker (zyasoft) Date: 2015-04-15.20:47:01
The JyNI project plans to support, using the existing ctypes module from CPython, so this be the best alternative.
msg10013 (view) Author: Jim Baker (zyasoft) Date: 2015-05-04.16:06:47
Stefan Richthofer will be working on this support via JyNI for his GSOC project. In a nutshell, by using the C Extension API support, we can avoid attempting to reimplement ctypes itself. (Rather relevantly, ctypes no longer has a maintainer in CPython 3, as was discussed at the recent language summit.)

I believe this addresses my objections in msg8426 :)
msg10745 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2016-02-16.15:20:42
The recent release of JyNI 2.7-alpha.3 (https://github.com/Stewori/JyNI/releases/tag/v2.7-alpha.3) is a major milestone for this issue. Windows support is still far away, but in case you are working on Linux, OSX or at least some other posix system it is worth a try.

Feedback from users and devs of "projects [that] use these parts of ctypes, which are implemented" is highly encouraged so I can fix remaining ctypes issues with focus on the actual need.
History
Date User Action Args
2016-02-16 15:20:43stefan.richthofersetmessages: + msg10745
2015-05-04 16:06:47zyasoftsetpriority: low -> high
assignee: stefan.richthofer
resolution: accepted
messages: + msg10013
title: Remove incomplete ctypes support -> Support a complete implementation of ctypes via JyNI
2015-04-15 20:47:01zyasoftsetassignee: zyasoft -> (no value)
messages: + msg9866
nosy: + stefan.richthofer
2014-10-05 23:19:24zyasoftsetpriority: normal -> low
2014-05-22 01:01:13zyasoftsetmessages: + msg8529
2014-05-20 17:41:33zyasoftsetmessages: + msg8446
2014-05-18 17:40:15santa4ntsetnosy: + santa4nt
messages: + msg8439
components: + Core
2014-05-18 09:26:50Arfreversetnosy: + Arfrever
messages: + msg8437
2014-05-17 20:17:55zyasoftsetpriority: normal
assignee: zyasoft
versions: + Jython 2.7
2014-05-17 20:14:24zyasoftcreate