From 1ffdb024ba5387b9dd6b7d9d06afb29aa3c62096 Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sun, 23 Jun 2024 13:13:31 +0100 Subject: [PATCH] Support Python 3.13 This moves to using the 3.13 grammar as well as testing 3.13 in CI. --- .github/workflows/ci.yml | 4 ++-- CHANGELOG.rst | 2 ++ jedi/api/environment.py | 2 +- jedi/inference/__init__.py | 2 +- setup.py | 5 +++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a565425dc..13b744c90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,8 @@ jobs: strategy: matrix: os: [ubuntu-20.04, windows-2019] - 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'] + python-version: ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "3.7", "3.6"] + environment: ['3.8', '3.13', '3.12', '3.11', '3.10', '3.9', '3.7', '3.6', 'interpreter'] steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fca944293..cf6810fa0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,8 @@ Changelog Unreleased ++++++++++ +- Python 3.13 support + 0.19.1 (2023-10-02) +++++++++++++++++++ diff --git a/jedi/api/environment.py b/jedi/api/environment.py index 758917997..141b5dfd5 100644 --- a/jedi/api/environment.py +++ b/jedi/api/environment.py @@ -17,7 +17,7 @@ _VersionInfo = namedtuple('VersionInfo', 'major minor micro') # type: ignore[name-match] -_SUPPORTED_PYTHONS = ['3.12', '3.11', '3.10', '3.9', '3.8', '3.7', '3.6'] +_SUPPORTED_PYTHONS = ['3.13', '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) diff --git a/jedi/inference/__init__.py b/jedi/inference/__init__.py index aadfeba96..bd31cbd39 100644 --- a/jedi/inference/__init__.py +++ b/jedi/inference/__init__.py @@ -90,7 +90,7 @@ def __init__(self, project, environment=None, script_path=None): self.compiled_subprocess = environment.get_inference_state_subprocess(self) self.grammar = environment.get_grammar() - self.latest_grammar = parso.load_grammar(version='3.12') + self.latest_grammar = parso.load_grammar(version='3.13') 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]] diff --git a/setup.py b/setup.py index 68210ef23..ed1e67a40 100755 --- a/setup.py +++ b/setup.py @@ -35,8 +35,8 @@ long_description=readme, packages=find_packages(exclude=['test', 'test.*']), python_requires='>=3.6', - # Python 3.11 & 3.12 grammars are added to parso in 0.8.3 - install_requires=['parso>=0.8.3,<0.9.0'], + # Python 3.13 grammars are added to parso in 0.8.4 + install_requires=['parso>=0.8.4,<0.9.0'], extras_require={ 'testing': [ 'pytest<7.0.0', @@ -101,6 +101,7 @@ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Editors :: Integrated Development Environments (IDE)', 'Topic :: Utilities',