mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00
refactor: remove xonsh.ptk2 module (#4570)
This commit is contained in:
parent
adafa20b88
commit
9a8cc74c4b
8 changed files with 23 additions and 46 deletions
23
news/remove-ptk2.rst
Normal file
23
news/remove-ptk2.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* Removed ``xonsh.ptk2`` module whcih was kept for some old packages sake. Now xonsh requires atleast ptk3 version.
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
1
setup.py
1
setup.py
|
@ -319,7 +319,6 @@ def main():
|
|||
"xonsh",
|
||||
"xonsh.ply.ply",
|
||||
"xonsh.ptk_shell",
|
||||
"xonsh.ptk2",
|
||||
"xonsh.procs",
|
||||
"xonsh.parsers",
|
||||
"xonsh.xoreutils",
|
||||
|
|
|
@ -20,43 +20,3 @@ def test_obj(history_obj):
|
|||
assert ["line10"] == history_obj.get_strings()
|
||||
assert len(history_obj) == 1
|
||||
assert ["line10"] == [x for x in history_obj]
|
||||
|
||||
|
||||
def test_ptk2_backcompat():
|
||||
"""
|
||||
Test that legacy code (ahem, xontribs) can still reference xonsh.ptk2 (for a while)
|
||||
"""
|
||||
|
||||
import xonsh.ptk_shell.shell as imports_new
|
||||
import xonsh.ptk2.shell as imports_legacy
|
||||
|
||||
# defining the ptk2 package this way leaves out the internal global names (which all start with '_')
|
||||
|
||||
s_new = set(dir(imports_new))
|
||||
s_legacy = set(dir(imports_legacy))
|
||||
extra_names = s_new - s_legacy
|
||||
|
||||
for name in extra_names:
|
||||
assert name.startswith("_")
|
||||
|
||||
assert s_legacy.issubset(s_new)
|
||||
|
||||
|
||||
# prove that legacy API is usable
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def history_obj_legacy():
|
||||
"""Instantiate `PromptToolkitHistory` via legacy alias and append a line string"""
|
||||
from xonsh.ptk2.history import PromptToolkitHistory
|
||||
|
||||
hist = PromptToolkitHistory(load_prev=False)
|
||||
hist.append_string("line10")
|
||||
return hist
|
||||
|
||||
|
||||
def test_obj_legacy(history_obj_legacy):
|
||||
history_obj = history_obj_legacy
|
||||
assert ["line10"] == history_obj.get_strings()
|
||||
assert len(history_obj) == 1
|
||||
assert ["line10"] == [x for x in history_obj]
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
from xonsh.ptk_shell import * # noqa: F403 F401
|
|
@ -1 +0,0 @@
|
|||
from xonsh.ptk_shell.completer import * # noqa: F403 F401
|
|
@ -1 +0,0 @@
|
|||
from xonsh.ptk_shell.history import * # noqa: F403 F401
|
|
@ -1 +0,0 @@
|
|||
from xonsh.ptk_shell.key_bindings import * # noqa: F403 F401
|
|
@ -1 +0,0 @@
|
|||
from xonsh.ptk_shell.shell import * # noqa: F403 F401
|
Loading…
Add table
Reference in a new issue