pombredanne / anyreadline

A sane readline meta-component for Python that installs the right readline module on windows and macosx (and nothing on linux which has it right by default)
1 stars 1 forks source link

Add Travis with OSX job #7

Open jayvdb opened 6 years ago

jayvdb commented 6 years ago

Copy readline tests from cpython and try running them?

Or run (subset of) tests from pyreadline or gnureadline

yzgyyang commented 6 years ago

One thing that is not easy to achieve: how to get a Python version without libreadline on OSX in the CI...

jayvdb commented 6 years ago

What have you tried?

And why does it matter? This package currently uses gnureadline on Darwin whether it has libreadline or not.

yzgyyang commented 6 years ago

@jayvdb I intended to change this package to use built-in readline on Darwin since (in my observation) it is widely available (from brew, or even custom compiled ones). Is it not preferred? What is the point o f using gnureadline even if readline is available?

jayvdb commented 6 years ago

Sure, if the real readline was built in, that is ok.

According to https://docs.python.org/3/library/readline.html

you can check for the text “libedit” in readline.__doc__

jayvdb commented 6 years ago

The problem is the native Python (2.7?) provided by macOS uses libedit IIUC

yzgyyang commented 6 years ago

@jayvdb Very interesting, and I can see that on my mac as well:

➜  ~ python
Python 2.7.10 (default, Oct  6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> readline.__doc__
'Importing this module enables command line editing using libedit readline.'
>>> exit()
➜  ~ python3
Python 3.7.0 (default, Jun 29 2018, 20:13:13)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> readline.__doc__
'Importing this module enables command line editing using GNU readline.'
>>>

(with the first one being the system one and the second being the brew-installed one)

It is determined at runtime, so does that mean we should check that as well on macos during runtime, or just install gnureadline either way?