mirror of
https://github.com/davidhalter/jedi.git
synced 2026-04-27 16:01:26 +08:00
Remove Python 3.9 and 3.10
This commit is contained in:
+3
-3
@@ -102,7 +102,7 @@ Features and Limitations
|
||||
Jedi's features are listed here:
|
||||
`Features <https://jedi.readthedocs.org/en/latest/docs/features.html>`_.
|
||||
|
||||
You can run Jedi on Python 3.8+ but it should also
|
||||
You can run Jedi on Python 3.10+ but it should also
|
||||
understand code that is older than those versions. Additionally you should be
|
||||
able to use `Virtualenvs <https://jedi.readthedocs.org/en/latest/docs/api.html#environments>`_
|
||||
very well.
|
||||
@@ -183,10 +183,10 @@ The test suite uses ``pytest``::
|
||||
|
||||
pip install pytest
|
||||
|
||||
If you want to test only a specific Python version (e.g. Python 3.8), it is as
|
||||
If you want to test only a specific Python version (e.g. Python 3.14), it is as
|
||||
easy as::
|
||||
|
||||
python3.8 -m pytest
|
||||
python3.14 -m pytest
|
||||
|
||||
For more detailed information visit the `testing documentation
|
||||
<https://jedi.readthedocs.org/en/latest/docs/testing.html>`_.
|
||||
|
||||
+1
-17
@@ -42,7 +42,7 @@ def pytest_addoption(parser):
|
||||
help="Warnings are treated as errors.")
|
||||
|
||||
parser.addoption("--env", action='store',
|
||||
help="Execute the tests in that environment (e.g. 39 for python3.9).")
|
||||
help="Execute the tests in that environment (e.g. 314 for python3.14).")
|
||||
parser.addoption("--interpreter-env", "-I", action='store_true',
|
||||
help="Don't use subprocesses to guarantee having safe "
|
||||
"code execution. Useful for debugging.")
|
||||
@@ -164,19 +164,3 @@ def skip_pre_python311(environment):
|
||||
# This if is just needed to avoid that tests ever skip way more than
|
||||
# they should for all Python versions.
|
||||
pytest.skip()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def skip_pre_python38(environment):
|
||||
if environment.version_info < (3, 8):
|
||||
# This if is just needed to avoid that tests ever skip way more than
|
||||
# they should for all Python versions.
|
||||
pytest.skip()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def skip_pre_python37(environment):
|
||||
if environment.version_info < (3, 7):
|
||||
# This if is just needed to avoid that tests ever skip way more than
|
||||
# they should for all Python versions.
|
||||
pytest.skip()
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ Completions
|
||||
>>> code = '''import json; json.l'''
|
||||
>>> script = jedi.Script(code, path='example.py')
|
||||
>>> script
|
||||
<Script: 'example.py' <SameEnvironment: 3.9.0 in /usr>>
|
||||
<Script: 'example.py' <SameEnvironment: 3.14.0 in /usr>>
|
||||
>>> completions = script.complete(1, 19)
|
||||
>>> completions
|
||||
[<Completion: load>, <Completion: loads>]
|
||||
|
||||
@@ -16,7 +16,7 @@ Jedi's main API calls and features are:
|
||||
Basic Features
|
||||
--------------
|
||||
|
||||
- Python 3.8+ support
|
||||
- Python 3.10+ support
|
||||
- Ignores syntax errors and wrong indentation
|
||||
- Can deal with complex module / function / class structures
|
||||
- Great ``virtualenv``/``venv`` support
|
||||
|
||||
@@ -7,10 +7,10 @@ The test suite depends on ``pytest``::
|
||||
|
||||
pip install pytest
|
||||
|
||||
If you want to test only a specific Python version (e.g. Python 3.8), it is as
|
||||
If you want to test only a specific Python version (e.g. Python 3.14), it is as
|
||||
easy as::
|
||||
|
||||
python3.8 -m pytest
|
||||
python3.14 -m pytest
|
||||
|
||||
Tests are also run automatically on `GitHub Actions
|
||||
<https://github.com/davidhalter/jedi/actions>`_.
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ class BaseName:
|
||||
@property
|
||||
def module_path(self) -> Optional[Path]:
|
||||
"""
|
||||
Shows the file path of a module. e.g. ``/usr/lib/python3.9/os.py``
|
||||
Shows the file path of a module. e.g. ``/usr/lib/python3.14/os.py``
|
||||
"""
|
||||
module = self._get_module_context()
|
||||
if module.is_stub() or not module.is_compiled():
|
||||
|
||||
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
|
||||
|
||||
_VersionInfo = namedtuple('VersionInfo', 'major minor micro') # type: ignore[name-match]
|
||||
|
||||
_SUPPORTED_PYTHONS = ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
|
||||
_SUPPORTED_PYTHONS = ['3.13', '3.12', '3.11', '3.10']
|
||||
_SAFE_PATHS = ['/usr/bin', '/usr/local/bin']
|
||||
_CONDA_VAR = 'CONDA_PREFIX'
|
||||
_CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor)
|
||||
|
||||
@@ -9,7 +9,7 @@ just use IPython instead::
|
||||
Then you will be able to use Jedi completer in your Python interpreter::
|
||||
|
||||
$ python
|
||||
Python 3.9.2+ (default, Jul 20 2020, 22:15:08)
|
||||
Python 3.14.0+ (default, Jul 20 2020, 22:15:08)
|
||||
[GCC 4.6.1] on linux2
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> import os
|
||||
|
||||
@@ -10,7 +10,7 @@ from parso import tree
|
||||
|
||||
def is_stdlib_path(path):
|
||||
# Python standard library paths look like this:
|
||||
# /usr/lib/python3.9/...
|
||||
# /usr/lib/python3.14/...
|
||||
# TODO The implementation below is probably incorrect and not complete.
|
||||
parts = path.parts
|
||||
if 'dist-packages' in parts or 'site-packages' in parts:
|
||||
|
||||
@@ -35,7 +35,7 @@ setup(name='jedi',
|
||||
keywords='python completion refactoring vim',
|
||||
long_description=readme,
|
||||
packages=find_packages(exclude=['test', 'test.*']),
|
||||
python_requires='>=3.8',
|
||||
python_requires='>=3.10',
|
||||
# Python 3.13 grammars are added to parso in 0.8.4
|
||||
install_requires=['parso>=0.8.6,<0.9.0'],
|
||||
extras_require={
|
||||
@@ -93,8 +93,6 @@ setup(name='jedi',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Programming Language :: Python :: 3.12',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# For assignment expressions / named expressions / walrus operators / whatever
|
||||
# they are called.
|
||||
|
||||
# python >= 3.8
|
||||
b = (a:=1, a)
|
||||
|
||||
#? int()
|
||||
|
||||
@@ -476,8 +476,6 @@ dynamic_annotation('')
|
||||
# TypeDict
|
||||
# -------------------------
|
||||
|
||||
# python >= 3.8
|
||||
|
||||
class Foo(typing.TypedDict):
|
||||
foo: str
|
||||
bar: typing.List[float]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# python >= 3.9
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
# This is just a dummy and very meaningless thing to use with to the Annotated
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# python >= 3.8
|
||||
|
||||
def positional_only_call(a, /, b):
|
||||
#? str()
|
||||
a
|
||||
|
||||
@@ -459,8 +459,6 @@ X().just_partial('')[0]
|
||||
#? str()
|
||||
X().just_partial('')[1]
|
||||
|
||||
# python >= 3.8
|
||||
|
||||
@functools.lru_cache
|
||||
def x() -> int: ...
|
||||
@functools.lru_cache()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import sys
|
||||
sys.path[0:0] = [
|
||||
'/usr/lib/python3.8/site-packages',
|
||||
'/usr/lib/python3.14/site-packages',
|
||||
'/tmp/.buildout/eggs/important_package.egg'
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -448,7 +448,7 @@ Options:
|
||||
--pdb Enable pdb debugging on fail.
|
||||
-d, --debug Enable text output debugging (please install ``colorama``).
|
||||
--thirdparty Also run thirdparty tests (in ``completion/thirdparty``).
|
||||
--env <dotted> A Python version, like 3.9, 3.8, etc.
|
||||
--env <dotted> A Python version, like 3.14, 3.13, etc.
|
||||
"""
|
||||
if __name__ == '__main__':
|
||||
import docopt
|
||||
|
||||
@@ -523,7 +523,7 @@ def test_added_equals_to_params(Script):
|
||||
|
||||
def test_builtin_module_with_path(Script):
|
||||
"""
|
||||
This test simply tests if a module from /usr/lib/python3.8/lib-dynload/ has
|
||||
This test simply tests if a module from /usr/lib/python3.14/lib-dynload/ has
|
||||
a path or not. It shouldn't have a module_path, because that is just
|
||||
confusing.
|
||||
"""
|
||||
|
||||
@@ -26,7 +26,7 @@ def test_find_system_environments():
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'version',
|
||||
['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
['3.10', '3.11', '3.12', '3.13']
|
||||
)
|
||||
def test_versions(version):
|
||||
try:
|
||||
|
||||
@@ -54,6 +54,7 @@ def test_rename_mod(Script, dir_with_content):
|
||||
''').format(dir=dir_with_content)
|
||||
|
||||
|
||||
# TODO does this test still make sense?
|
||||
@pytest.mark.skipif('sys.version_info[:2] < (3, 8)', reason="Python 3.8 introduces dirs_exist_ok")
|
||||
def test_namespace_package(Script, tmpdir):
|
||||
origin = get_example_dir('implicit_namespace_package')
|
||||
|
||||
@@ -67,7 +67,7 @@ def test_path_from_sys_path_assignment(Script):
|
||||
|
||||
import sys
|
||||
sys.path[0:0] = [
|
||||
{os.path.abspath('/usr/lib/python3.8/site-packages')!r},
|
||||
{os.path.abspath('/usr/lib/python3.14/site-packages')!r},
|
||||
{os.path.abspath('/home/test/.buildout/eggs/important_package.egg')!r},
|
||||
]
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@ def test_get_signatures_stdlib(Script):
|
||||
assert len(sigs[0].params) == 1
|
||||
|
||||
|
||||
# Check only on linux 64 bit platform and Python3.8.
|
||||
# TODO This is currently only checked on linux 64 bit platform and Python3.8,
|
||||
# which we don't support anymore, this test should be rewritten (or the
|
||||
# extension recreated).
|
||||
@pytest.mark.parametrize('load_unsafe_extensions', [False, True])
|
||||
@pytest.mark.skipif(
|
||||
'sys.platform != "linux" or sys.maxsize <= 2**32 or sys.version_info[:2] != (3, 8)',
|
||||
@@ -48,7 +50,8 @@ def test_init_extension_module(Script, load_unsafe_extensions):
|
||||
`__init__.cpython-38m.so` by compiling it (create a virtualenv and run
|
||||
`setup.py install`.
|
||||
|
||||
This is also why this test only runs on certain systems and Python 3.8.
|
||||
This is also why this test only runs on certain systems and a specific
|
||||
Python version.
|
||||
"""
|
||||
|
||||
project = jedi.Project(get_example_dir(), load_unsafe_extensions=load_unsafe_extensions)
|
||||
|
||||
@@ -406,7 +406,7 @@ def test_wraps_signature(Script, code, signature):
|
||||
],
|
||||
)
|
||||
def test_dataclass_signature(
|
||||
Script, skip_pre_python37, start, start_params, include_params, environment
|
||||
Script, start, start_params, include_params, environment
|
||||
):
|
||||
if environment.version_info < (3, 8):
|
||||
# Final is not yet supported
|
||||
@@ -725,7 +725,7 @@ ids = [
|
||||
'start, start_params, include_params', dataclass_transform_cases, ids=ids
|
||||
)
|
||||
def test_extensions_dataclass_transform_signature(
|
||||
Script, skip_pre_python37, start, start_params, include_params, environment
|
||||
Script, start, start_params, include_params, environment
|
||||
):
|
||||
has_typing_ext = bool(Script('import typing_extensions').infer())
|
||||
if not has_typing_ext:
|
||||
@@ -846,7 +846,7 @@ def test_dataclass_transform_signature(
|
||||
],
|
||||
ids=["define", "frozen", "define_customized", "define_subclass", "define_both"]
|
||||
)
|
||||
def test_attrs_signature(Script, skip_pre_python37, start, start_params):
|
||||
def test_attrs_signature(Script, start, start_params):
|
||||
has_attrs = bool(Script('import attrs').infer())
|
||||
if not has_attrs:
|
||||
raise pytest.skip("attrs needed in target environment to run this test")
|
||||
|
||||
@@ -67,7 +67,7 @@ def test_hex_values_in_docstring():
|
||||
('lambda x, y, z: x + y * z\n', '<lambda>(x, y, z)')
|
||||
])
|
||||
def test_get_signature(code, signature):
|
||||
node = parse(code, version='3.8').children[0]
|
||||
node = parse(code, version='3.14').children[0]
|
||||
if node.type == 'simple_stmt':
|
||||
node = node.children[0]
|
||||
assert parser_utils.get_signature(node) == signature
|
||||
|
||||
Reference in New Issue
Block a user