Skip to content

Conversation

@matthew-brett
Copy link
Contributor

Discover Tcl / Tk functions at run-time by looking in libs loaded by
Tkinter Python module.

Use header excerpts from Tcl / Tk so we don't need an installed Tcl / Tk
to build.

Discover Tcl / Tk functions at run-time by looking in libs loaded by
Tkinter Python module.

Use header excerpts from Tcl / Tk so we don't need an installed Tcl / Tk
to build.
@matthew-brett
Copy link
Contributor Author

I've tested on OSX Python 2, 3; Linux Python 2, 3 and Windows Python 2.

@coveralls
Copy link

coveralls commented May 27, 2016

Coverage Status

Changes Unknown when pulling 659e294 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@matthew-brett
Copy link
Contributor Author

pypy builds failing - any suggestions what to do about these?

Make sure that tkinter package is loaded before checking for symbols in
process (Windows).
@coveralls
Copy link

coveralls commented May 28, 2016

Coverage Status

Changes Unknown when pulling 6968c0c on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 746dd52 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@matthew-brett
Copy link
Contributor Author

I looked for a while, but I can't see any reasonable way of locating the built tkinter interface .so file on pypy3. The .so file results from a cffi build, and the library is available via a cffi interface in tikinter.tklib, but I can't see any way to get to the library .so filename or the pointer to the handle.

So, unless someone has a good idea, I think this approach doesn't work for pypi3.

@matthew-brett
Copy link
Contributor Author

It's not too hard to solve this for PyPy 5.1 (Python 2 version, that has a recent cffi package version). The problem is with PyPy3 2.4 which has a very old cffi package version :

https://groups.google.com/d/msg/python-cffi/gkPqq1u52E4/ReKJWJiPCgAJ

Will you be supporting Python 3.2 for much longer? How about PyPy3 (which is an implementation of Python 3.2)?

@coveralls
Copy link

coveralls commented May 29, 2016

Coverage Status

Changes Unknown when pulling 5b22239 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@coveralls
Copy link

coveralls commented May 29, 2016

Coverage Status

Changes Unknown when pulling 0385ac9 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@wiredfool
Copy link
Member

It looks like there hasn't been a pypy3 release in almost 2 years. I'm guessing that it's likely that the improvements from pypy will make it in on the next release, and then this will likely work.

Is it possible that a newer version of cffi would be installable alongside pypy3?

As for 3.2 support, I believe that there are still LTS distros where 3.2 is the python3 version. I'd rather not drop support for them without a good reason, though paring down the build matrix is something that might happen first. 3.2 is probably the first to go when it does, as it's the least like the others.

@matthew-brett
Copy link
Contributor Author

I think I've got this working for PyPy3 and other old PyPies. I've tested lots of PyPy and PyPy3 versions from https://bitbucket.org/pypy/pypy/downloads and the finder works for all versions that have a compiled tkinter. I'll check on the cffi mailing list that this is likely to work for future cffi versions.

@coveralls
Copy link

coveralls commented May 29, 2016

Coverage Status

Changes Unknown when pulling 7fb40a6 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

Use imported module to find tkinter.  Should find tkinter module for all
available versions of PyPy that have tkinter compiled, as well as
CPython.
@coveralls
Copy link

coveralls commented May 30, 2016

Coverage Status

Changes Unknown when pulling 4bc75e4 on matthew-brett:run-time-tcl-tk into * on python-pillow:master*.

@matthew-brett
Copy link
Contributor Author

Tests all passing - from my point of view, this one is ready to merge.

@matthew-brett
Copy link
Contributor Author

From discussion at https://groups.google.com/forum/#!msg/python-cffi/gkPqq1u52E4/ReKJWJiPCgAJ - algorithm for finding Tcl / Tk libraries should continue to work for future pypi versions.

This branch also works with pypi3 5.2.0-alpha1 (released a few days ago).

@wiredfool
Copy link
Member

wiredfool commented Jun 8, 2016

@cjrh @ddale @jakirkham -- Can you check this PR without using the --disable-osx-tcltk-framework flag and confirm that it works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants