[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Daniel Holth dho...@fastmail.fm added the comment: from docs.python.org: platform.python_implementation() Returns a string identifying the Python implementation. Possible return values are: ‘CPython’, ‘IronPython’, ‘Jython’. New in version 2.6. ... and it seems pypy identifies itself as 'PyPy'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Alexis Metaireau ale...@notmyidea.org added the comment: On 29/04/2011 18:20, Daniel Holth wrote: New in version 2.6. Yep that's it. We would need to backport it in the python2 port of packaging (namely distutils2), but it would do the trick. I just started a discussion about that on the fellowship (to know if we can add this to PEP 345). -- Alexis -- title: distutils2 should be able to compile an Extension based on the Python implementation version - distutils2 should be able to compile an Extension based on the Python implementation version ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Éric Araujo mer...@netwok.org added the comment: Alexis is right, the implementation name is not currently available as an environment marker. Maybe another approach could be used: consider all extensions optional on non-CPython platforms? -- versions: +3rd party -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
dholth dho...@fastmail.fm added the comment: Yes, putting implementation-specific environment markers in the Extensions section is the idea (instead of the haphazard and occasionally-applied 'Python code in setup.py appends to a list of extensions' method). An Extension can only be optional when there is equivalent and working Python code. This isn't likely to happen for libraries like PIL where the foreign code provides core functionality instead of a speedup. The reason I submitted this bug is that as Pypy's C API improves it can successfully compile Extensions to its detriment. Unlike Jython which IIRC has no C API, Pypy cannot patch Extension to always fail, but some of those Extensions are slower than the equivalent Python. I think there ought to be a declarative way to mark an extension as a. Required b. Optional and preferred c. Optional, not preferred depending on the Python implementation. For (b) and (c) it would also be quite cool to have a standard flag or runtime mechanism to switch between the C and Python implementation to see which one was really faster (could be done with an import hook?). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Éric Araujo mer...@netwok.org added the comment: The environment markers are specific to PEP 345, that is metadata, which includes dependencies, so that you can depend on something only on a given platform. Your proposal of putting C extensions in another distribution and optionally depend on it should work right now, but is IMO too cumbersome. Why not extend the format of the Extensions section in setup.cfg so that it supports environment markers? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Changes by Jeremy Kloth jeremy.kl...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
Alexis Metaireau ale...@notmyidea.org added the comment: This raises a concern about python specific python implementations dependencies. We probably could extend PEP 345 in order to support things such as 'platform.python_implementation == cpython'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version
New submission from dholth dho...@fastmail.fm: It might be useful to be able to declare optional Extensions that for example won't attempt to compile on Jython or any implementation of Python for which the extension (a) doesn't work or (b) would be slower than the Python fallback. I suppose this could be accomplished without changing anything by packaging the extension separately and using the extant ; plat=win32 style dependency qualifiers? -- assignee: tarek components: Distutils2 messages: 134394 nosy: alexis, dholth, eric.araujo, tarek priority: normal severity: normal status: open title: distutils2 should be able to compile an Extension based on the Python implementation version versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11921 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com