1
0
forked from VimPlug/jedi

Compare commits

...

14 Commits

Author SHA1 Message Date
Dave Halter
4e175ca82b Prepare for release 0.19.1 2023-10-02 10:55:17 +02:00
Dave Halter
30e9b7b5be Merge pull request #1961 from PeterJCLaw/docs-link
Include a link to the docs in the package metadata
2023-09-23 23:56:11 +00:00
Peter Law
83545bc9ec Include a link to the docs in the package metadata 2023-09-22 21:33:52 +01:00
Peter Law
57e7b83455 Add missing import
I suspect this got lost in a merge somewhere, probably the
combination of 7e533ca7e1 and the
Python 3.12 work in a60fdba1d4.
2023-09-22 21:29:31 +01:00
Dave Halter
0770372857 Merge pull request #1956 from PeterJCLaw/python-3.12
Support Python 3.12
2023-09-17 19:25:45 +00:00
Peter Law
7e533ca7e1 Drop redundant conditional skips for unsupported Python versions 2023-09-17 18:38:12 +01:00
Peter Law
a60fdba1d4 Adjust for change to documention change of next in Python 3.12
The signature of the builtin isn't actually changing in Python 3.12,
however its documentation has changed.
2023-09-17 18:27:53 +01:00
Dave Halter
9d399a9229 Merge pull request #1959 from davidhalter/unpin-test-django
Unpin Django in tests
2023-09-17 12:37:00 +00:00
Peter Law
770cdade00 Claim support for Python 3.12 2023-09-16 21:41:06 +01:00
Peter Law
29890c1f29 Ignore linux-only os.CLONE_* constants in Python 3.12 in import test 2023-09-16 21:41:06 +01:00
Peter Law
159566e1a0 Add Python 3.12 as a tested platform 2023-09-16 21:41:06 +01:00
Peter Law
a80618a2df Unpin Django in tests
It's not completely clear why this was pinned originally, though
at the time Jedi supported Python 2.7 as well as 3.5-3.8, so that
may have had something to do with it.

Removing this pin now seems to work in CI and unblocks some issues
we're seeing around Python 3.12 (specifically that Django<3.1
implicitly relies on distutils, which is no longer available by
default, and possibly other issues).
2023-09-16 21:40:34 +01:00
Peter Law
4bc1b6ef99 Bump use of actions/checkout to avoid Node JS deprecations 2023-09-16 18:12:28 +01:00
Peter Law
d655d65d3a Fix typo in comment 2023-09-16 18:03:56 +01:00
12 changed files with 34 additions and 38 deletions

View File

@@ -7,11 +7,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
python-version: ["3.11", "3.10", "3.9", "3.8", "3.7", "3.6"]
environment: ['3.8', '3.11', '3.10', '3.9', '3.7', '3.6', 'interpreter']
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7", "3.6"]
environment: ['3.8', '3.12', '3.11', '3.10', '3.9', '3.7', '3.6', 'interpreter']
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
@@ -19,10 +19,12 @@ jobs:
if: ${{ matrix.environment != 'interpreter' }}
with:
python-version: ${{ matrix.environment }}
allow-prereleases: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: 'pip install .[testing]'
@@ -36,7 +38,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
@@ -53,7 +55,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

View File

@@ -6,6 +6,11 @@ Changelog
Unreleased
++++++++++
0.19.1 (2023-10-02)
+++++++++++++++++++
- Python 3.12 support (Thanks Peter!)
0.19.0 (2023-07-29)
+++++++++++++++++++

View File

@@ -27,7 +27,7 @@ ad
load
"""
__version__ = '0.19.0'
__version__ = '0.19.1'
from jedi.api import Script, Interpreter, set_debug_function, preload_module
from jedi import settings

View File

@@ -17,7 +17,7 @@ import parso
_VersionInfo = namedtuple('VersionInfo', 'major minor micro') # type: ignore[name-match]
_SUPPORTED_PYTHONS = ['3.11', '3.10', '3.9', '3.8', '3.7', '3.6']
_SUPPORTED_PYTHONS = ['3.12', '3.11', '3.10', '3.9', '3.8', '3.7', '3.6']
_SAFE_PATHS = ['/usr/bin', '/usr/local/bin']
_CONDA_VAR = 'CONDA_PREFIX'
_CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor)

View File

@@ -90,7 +90,7 @@ class InferenceState:
self.compiled_subprocess = environment.get_inference_state_subprocess(self)
self.grammar = environment.get_grammar()
self.latest_grammar = parso.load_grammar(version='3.11')
self.latest_grammar = parso.load_grammar(version='3.12')
self.memoize_cache = {} # for memoize decorators
self.module_cache = imports.ModuleCache() # does the job of `sys.modules`.
self.stub_module_cache = {} # Dict[Tuple[str, ...], Optional[ModuleValue]]

View File

@@ -27,12 +27,15 @@ setup(name='jedi',
maintainer=__AUTHOR__,
maintainer_email=__AUTHOR_EMAIL__,
url='https://github.com/davidhalter/jedi',
project_urls={
"Documentation": 'https://jedi.readthedocs.io/en/latest/',
},
license='MIT',
keywords='python completion refactoring vim',
long_description=readme,
packages=find_packages(exclude=['test', 'test.*']),
python_requires='>=3.6',
# Python 3.11 grammar is added to parso in 0.8.3
# Python 3.11 & 3.12 grammars are added to parso in 0.8.3
install_requires=['parso>=0.8.3,<0.9.0'],
extras_require={
'testing': [
@@ -41,7 +44,7 @@ setup(name='jedi',
'docopt',
# coloroma for colored debug output
'colorama',
'Django<3.1', # For now pin this.
'Django',
'attrs',
],
'qa': [
@@ -97,6 +100,7 @@ setup(name='jedi',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Editors :: Integrated Development Environments (IDE)',
'Topic :: Utilities',

View File

@@ -188,10 +188,7 @@ def test_functions_should_have_params(Script):
assert c.get_signatures()
def test_hashlib_params(Script, environment):
if environment.version_info < (3,):
pytest.skip()
def test_hashlib_params(Script):
script = Script('from hashlib import sha256')
c, = script.complete()
sig, = c.get_signatures()

View File

@@ -1,4 +1,5 @@
from textwrap import dedent
import sys
import math
from collections import Counter
from datetime import datetime
@@ -26,7 +27,10 @@ def test_builtin_loading(inference_state):
assert not from_name.py__doc__() # It's a stub
def test_next_docstr(inference_state):
def test_next_docstr(inference_state, environment):
if environment.version_info[:2] != sys.version_info[:2]:
pytest.skip()
next_ = compiled.builtin_from_name(inference_state, 'next')
assert next_.tree_node is not None
assert next_.py__doc__() == '' # It's a stub

View File

@@ -1,13 +1,6 @@
import pytest
from textwrap import dedent
@pytest.fixture(autouse=True)
def skip_not_supported(environment):
if environment.version_info < (3, 6):
pytest.skip()
def test_fstring_multiline(Script):
code = dedent("""\
'' f'''s{

View File

@@ -12,29 +12,23 @@ def _infer_literal(Script, code, is_fstring=False):
return def_._name._value.get_safe_value()
def test_f_strings(Script, environment):
def test_f_strings(Script):
"""
f literals are not really supported in Jedi. They just get ignored and an
empty string is returned.
"""
if environment.version_info < (3, 6):
pytest.skip()
assert _infer_literal(Script, 'f"asdf"', is_fstring=True) == ''
assert _infer_literal(Script, 'f"{asdf} "', is_fstring=True) == ''
assert _infer_literal(Script, 'F"{asdf} "', is_fstring=True) == ''
assert _infer_literal(Script, 'rF"{asdf} "', is_fstring=True) == ''
def test_rb_strings(Script, environment):
def test_rb_strings(Script):
assert _infer_literal(Script, 'x = br"asdf"; x') == b'asdf'
assert _infer_literal(Script, 'x = rb"asdf"; x') == b'asdf'
def test_thousand_separators(Script, environment):
if environment.version_info < (3, 6):
pytest.skip()
def test_thousand_separators(Script):
assert _infer_literal(Script, '1_2_3') == 123
assert _infer_literal(Script, '123_456_789') == 123456789
assert _infer_literal(Script, '0x3_4') == 52

View File

@@ -13,18 +13,15 @@ from ..helpers import get_example_dir
'code, sig, names, op, version', [
('import math; math.cos', 'cos(x, /)', ['x'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], lt, (3, 12)),
('next', 'next()', [], ge, (3, 12)),
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),
('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 6)),
('pow', 'pow(base, exp, mod=None)', ['base', 'exp', 'mod'], ge, (3, 8)),
('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)',
['self', 'sep'], lt, (3, 6)),
('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 6)),
('bytes().partition', 'partition(sep, /) -> (head, sep, tail)', ['sep'], lt, (3, 6)),
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 6)),
]
)

View File

@@ -81,7 +81,7 @@ class TestSetupReadline(unittest.TestCase):
if all(not x.startswith('from os import ' + s)
for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_', 'ST_',
'CLD_', 'POSIX_SPAWN_', 'P_', 'RWF_',
'SCHED_'])
'CLONE_', 'SCHED_'])
}
# There are quite a few differences, because both Windows and Linux
# (posix and nt) libraries are included.