- Cherry-pick patch from Fedora to add support for Python 3.13

* python3.13-support.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jedi?expand=0&rev=115
This commit is contained in:
Benjamin Greiner 2024-09-20 07:49:39 +00:00 committed by Git OBS Bridge
commit 4b9bfc2b5b
7 changed files with 1235 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
jedi-0.19.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd
size 1227821

2
python-jedi-rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
addFilter("zero-length.*typeshed.*pyi")
addFilter("zero-length.*django-stubs.*pyi")

596
python-jedi.changes Normal file
View File

@ -0,0 +1,596 @@
-------------------------------------------------------------------
Fri Sep 20 06:56:42 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Cherry-pick patch from Fedora to add support for Python 3.13
* python3.13-support.patch
-------------------------------------------------------------------
Tue Oct 17 05:23:31 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.19.1:
* Python 3.12 support
- Stop skipping some tests.
-------------------------------------------------------------------
Thu Aug 10 22:27:43 UTC 2023 - Benjamin Greiner <code@bnavigator.de>
- Update requirements
-------------------------------------------------------------------
Thu Aug 10 21:59:38 UTC 2023 - Arun Persaud <arun@gmx.de>
- specfile:
* remove patch supported_pythons_310_311.patch, included upstream
* remove patch support-python-311-typing.patch, included upstreamx
- update to version 0.19.0:
* Python 3.11 support
* Massive improvements in performance for Interpreter (e.g. IPython)
users. This especially affects pandas users with large datasets.
* Add jedi.settings.allow_unsafe_interpreter_executions to make it
easier for IPython users to avoid unsafe executions.
-------------------------------------------------------------------
Wed May 10 12:13:38 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Skip a test failing with attrs 23.1
* gh#davidhalter/jedi#1929
-------------------------------------------------------------------
Fri Apr 21 12:27:27 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:42:15 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Mon Feb 13 12:25:57 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Remove fix_test_compiled_signature_annotation_string.patch
All tests pass without it
-------------------------------------------------------------------
Sun Feb 12 23:52:07 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Add supported_pythons_310_311.patch which includes '3.11' among
_SUPPORTED_PYTHONS (gh#davidhalter/jedi#1914).
-------------------------------------------------------------------
Sat Feb 11 00:28:05 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Add fix_test_compiled_signature_annotation_string.patch to make
test passing with Python 3.10+ (gh#davidhalter/jedi#1732).
-------------------------------------------------------------------
Tue Jan 10 04:01:51 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python-311-typing.patch:
* Support typing changes for Python 3.11+
-------------------------------------------------------------------
Tue Jan 3 19:08:04 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Move to PEP517
- Pin parso like upstream does
- Skip a test for embedded systems which unexplicably fails on
backports 15.4_py39
-------------------------------------------------------------------
Tue Dec 6 03:49:55 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to 0.18.2
* Added dataclass-equivalent for attrs.define
* Find fixtures from Pytest entrypoints; Examples of pytest plugins installed like this are pytest-django, pytest-sugar and Faker.
* Fixed Project.search, when a venv was involved, which is why for example :Pyimport django.db did not work in some cases in jedi-vim.
* And many smaller bugfixes
-------------------------------------------------------------------
Sun Mar 27 18:44:40 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Skip two test failing with pytest 7.1 -- gh#davidhalter/jedi#1846
-------------------------------------------------------------------
Mon Jan 10 23:17:12 UTC 2022 - Benjamin Greiner <code@bnavigator.de>
- Force pytest >= 5 for successful 15.3 build in d:l:p
-------------------------------------------------------------------
Fri Dec 10 20:53:13 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 0.18.1
* Implict namespaces are now a separate types in Name().type
* Python 3.10 support
* Mostly bugfixes
- Drop jedi-py39-pytest.patch
- Skip failing test (reported as gh#davidhalter/jedi#1824)
-------------------------------------------------------------------
Sun Oct 31 15:56:52 UTC 2021 - Benjamin Greiner <code@bnavigator.de>
- Force pytest5 because it has the pluggy<1 pin patched out
-------------------------------------------------------------------
Sat Mar 13 13:33:44 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Add jedi-py39-pytest.patch to support Python 3.9
-------------------------------------------------------------------
Fri Dec 25 19:03:26 UTC 2020 - Matej Cepl <mcepl@suse.com>
- update to 0.18.0 (get it together with the latest python-parso just to
be sure):
- Dropped Python 2 and Python 3.5
- Using ``pathlib.Path()`` as an output instead of ``str`` in most
places:
- ``Project.path``
- ``Script.path``
- ``Definition.module_path``
- ``Refactoring.get_renames``
- ``Refactoring.get_changed_files``
- Functions with ``@property`` now return ``property`` instead of
``function`` in ``Name().type``
- Started using annotations
- Better support for the walrus operator
- Project attributes are now read accessible
- Removed all deprecations
This is likely going to be the last minor release before 1.0.
-------------------------------------------------------------------
Thu Sep 3 20:26:53 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Revert back to 0.17.2.
-------------------------------------------------------------------
Thu Aug 27 11:04:42 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Exclude pytest 6 gh#davidhalter/jedi#1660
-------------------------------------------------------------------
Fri Jul 17 21:43:14 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to version 0.17.2
* Added an option to pass environment variables to ``Environment``
* ``Project(...).path`` exists now
* Support for Python 3.9
* A few bugfixes
- rpmlint zero length django-stubs
-------------------------------------------------------------------
Sat Jun 20 12:15:53 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to version 0.17.1
* Django ``Model`` meta class support
* Django Manager support (completion on Managers/QuerySets)
* Added Django Stubs to Jedi, thanks to all contributors of the
`Django Stubs <https://github.com/typeddjango/django-stubs>`_ project
* Added ``SyntaxError.get_message``
* Python 3.9 support
* Bugfixes (mostly towards Generics)
- drop jedi-pr1543-sorttest.patch merged upstream
-------------------------------------------------------------------
Sun May 24 08:30:33 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Skip two tests on leap not just sp1+
-------------------------------------------------------------------
Wed Apr 15 10:03:54 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to v0.17.0
* Added ``Project`` support. This allows a user to specify which
folders Jedi should work with.
* Added support for Refactoring. The following refactorings have
been implemented: ``Script.rename``, ``Script.inline``,
``Script.extract_variable`` and ``Script.extract_function``.
* Added ``Script.get_syntax_errors`` to display syntax errors in
the current script.
* Added code search capabilities both for individual files and
projects. The new functions are ``Project.search``,
``Project.complete_search``, ``Script.search`` and
``Script.complete_search``.
* Added ``Script.help`` to make it easier to display a help
window to people. Now returns pydoc information as well for
Python keywords/operators. This means that on the class
keyword it will now return the docstring of Python's builtin
function ``help('class')``.
* The API documentation is now way more readable and complete.
Check it out under https://jedi.readthedocs.io. A lot of it
has been rewritten.
* Removed Python 3.4 support
* Many bugfixes
- back to regular releases, no git service needed anymore
- jedi-pr1543-sorttest.patch gh#davidhalter/jedi#1543
-------------------------------------------------------------------
Mon Apr 13 10:01:10 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- tell Leap 15.1 and SLE 15 SP1 pytest to ignore test/__init__.py
so that a test file with purposely placed syntax errors does not
trip the entire discovery
-------------------------------------------------------------------
Thu Apr 9 18:59:55 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- reenable (most) unittests
- remove unbundle.patch -- according to upstream, typeshed is meant
to be bundled.
-------------------------------------------------------------------
Tue Mar 17 21:45:28 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- fix version string to 0.16.0+git55.17b3611c
-------------------------------------------------------------------
Mon Mar 16 09:20:12 UTC 2020 - tchvatal@suse.com
- Update to version v0.16.0+git55.17b3611c:
* Included statement as a possible return type for BaseDefinition.type
-------------------------------------------------------------------
Mon Mar 16 09:20:01 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Disable tests
-------------------------------------------------------------------
Sat Mar 14 10:22:47 UTC 2020 - tchvatal@suse.com
- Update to version v0.16.0+git54.0888dd46:
* Fix partialmethod issues
* Make sure partialmethod tests are only executed for Python 3
* Refactor stdlib PartialObject
* Fix PartialMethodObject (WIP)
* Changed semantics of ClassVar attributes in classes, fixes #1502
* Avoid duplicate definitions for goto, fixes #1514
* Merge _remove_statements and infer_expr_stmt, fixes #1504
* Add partialmethod, fixes #1519
* Attempt at a test of completion of filepath after ~.
* Complete path after ~.
-------------------------------------------------------------------
Sat Mar 14 10:16:25 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Remove patches from git in preparation to switch to git service:
* delete.patch
* typing.patch
-------------------------------------------------------------------
Fri Mar 6 11:55:48 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
- add typing.patch - fix test_sys_getwindowsversion with new parso
-------------------------------------------------------------------
Tue Feb 4 09:38:03 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.16.0
- add delete.patch
* Added Script.get_context to get information where you currently are.
* Completions/type inference of Pytest fixtures.
* Tensorflow, Numpy and Pandas completions should now be about 4-10x faster after the first time they are used.
* Dict key completions are working now. e.g. d = {1000: 3}; d[10 will expand to 1000.
* Completion for “proxies” works now. These are classes that have a __getattr__(self, name) method that does a return getattr(x, name). after loading them initially.
* Goto on a function/attribute in a class now goes to the definition in its super class.
* Big Script API Changes:
+ The line and column parameters of jedi.Script are now deprecated
+ completions deprecated, use complete instead
+ goto_assignments deprecated, use goto instead
+ goto_definitions deprecated, use infer instead
+ call_signatures deprecated, use get_signatures instead
+ usages deprecated, use get_references instead
+ jedi.names deprecated, use jedi.Script(...).get_names()
* BaseDefinition.goto_assignments renamed to BaseDefinition.goto
* Add follow_imports to Definition.goto. Now its signature matches Script.goto.
* Python 2 support deprecated. For this release it is best effort. Python 2 has reached the end of its life and now its just about a smooth transition. Bugs for Python 2 will not be fixed anymore and a third of the tests are already skipped.
* Removed settings.no_completion_duplicates. It wasnt tested and nobody was probably using it anyway.
* Removed settings.use_filesystem_cache and settings.additional_dynamic_modules, they have no usage anymore. Pretty much nobody was probably using them.
-------------------------------------------------------------------
Sat Dec 28 15:02:12 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.15.2
- skip tests based on bundled typeshed
- refreshed unbundle.patch
* Call signatures are now detected a lot better
* Add fuzzy completions with Script(...).completions(fuzzy=True)
* Files bigger than one MB (about 20kLOC) get cropped to avoid
getting stuck completely.
* A big refactoring around contexts/values
-------------------------------------------------------------------
Sat Nov 23 17:06:14 CET 2019 - Matej Cepl <mcepl@suse.com>
- So, this is completely boring, non-offensive changelog record,
which says, that I have also add previously missing skip over
test_compiled_signature test case, because of
gh#davidhalter/jedi#1429
-------------------------------------------------------------------
Thu Oct 24 20:07:37 CEST 2019 - Matej Cepl <mcepl@suse.com>
- Skip TestSetupReadline.test_import because of gh#davidhalter/jedi#1429
-------------------------------------------------------------------
Thu Sep 12 17:43:32 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Skip another time based test test_os_path_join
-------------------------------------------------------------------
Wed Sep 11 12:03:10 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Skip flaky test test_static_analysis
-------------------------------------------------------------------
Sun Aug 25 17:56:17 UTC 2019 - Arun Persaud <arun@gmx.de>
- update to version 0.15.1:
* Small bugfix and removal of a print statement
- changes from version 0.15.0:
* Added file path completions, there's a new "Completion.type" path,
now. Example: '/ho -> '/home/
* *args/**kwargs resolving. If possible Jedi replaces the parameters
with the actual alternatives.
* Better support for enums/dataclasses
* When using Interpreter, properties are now executed, since a lot
of people have complained about this. Discussion in #1299, #1347.
* New APIs:
+ Definition.get_signatures() -> List[Signature]. Signatures are
similar to CallSignature. Definition.params is therefore
deprecated.
+ Signature.to_string() to format call signatures.
+ Signature.params -> List[ParamDefinition], ParamDefinition has
the following additional attributes infer_default(),
infer_annotation(), to_string(), and kind.
+ Definition.execute() -> List[Definition], makes it possible to
infer return values of functions.
-------------------------------------------------------------------
Tue Jul 16 10:41:56 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.14.1
* CallSignature.index should now be working a lot better
* A couple of smaller bugfixes
-------------------------------------------------------------------
Thu Jul 4 11:12:49 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.14.0
- enable tests
- add unbundle.patch
* Added goto_*(prefer_stubs=True) as well as goto_*(prefer_stubs=True)
* Stubs are used now for type inference
* Typeshed is used for better type inference
* Reworked Definition.full_name, should have more correct return values
-------------------------------------------------------------------
Wed May 29 12:51:13 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Disable tests as it is not working at all on python 3.7
-------------------------------------------------------------------
Tue Mar 26 10:48:44 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Do not bother condition for typing, on 3.7+ it is provided by base
-------------------------------------------------------------------
Sat Mar 2 15:12:14 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.13.3:
* Fixed an issue with embedded Python see https://github.com/davidhalter/jedi-vim/issues/870
-------------------------------------------------------------------
Thu Feb 14 12:05:41 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Fix the typing dependency
- Really run the tests
-------------------------------------------------------------------
Sun Jan 6 22:27:01 UTC 2019 - Arun Persaud <arun@gmx.de>
- specfile:
* update copyright year
- update to version 0.13.2:
* Fixed a bug that led to Jedi spawning a lot of subprocesses.
-------------------------------------------------------------------
Thu Oct 11 18:46:48 UTC 2018 - Todd R <toddrme2178@gmail.com>
- update to version 0.13.1
* Bugfixes, because tensorflow completions were still slow.
- update to version 0.13.0
* A small release. Some bug fixes.
* Remove Python 3.3 support. Python 3.3 support has been dropped by the Python
foundation.
* Default environments are now using the same Python version as the Python
process. In 0.12.x, we used to load the latest Python version on the system.
* Added ``include_builtins`` as a parameter to usages.
* ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that
changes the previous behavior slightly.
- Remove test_requrements.patch, no longer needed
-------------------------------------------------------------------
Mon Jul 2 01:09:29 UTC 2018 - arun@gmx.de
- specfile:
* require parso >= 0.3.0
* remove python-devel requirement
- update to version 0.12.1:
* This release forces you to upgrade parso. If you don't, nothing
will work anymore. Otherwise changes should be limited to bug
fixes. Unfortunately Jedi still uses a few internals of parso that
make it hard to keep compatibility over multiple releases. Parso
>=0.3.0 is going to be needed.
-------------------------------------------------------------------
Thu Apr 19 17:18:37 UTC 2018 - toddrme2178@gmail.com
- Update to version 0.12.0
* Virtualenv/Environment support
* F-String Completion/Goto Support
* Cannot crash with segfaults anymore
* Cleaned up import logic
* Understand async/await and autocomplete it (including async generators)
* Better namespace completions
* Passing tests for Windows (including CI for Windows)
* Remove Python 2.6 support
- Update to version 0.11.1
* Parso update - the caching layer was broken
* Better usages - a lot of internal code was ripped out and improved.
- Remove upstream-included test_requrements.patch
- Add new test_requrements.patch to avoid limit on pytest version.
- Disable tests, they don't work in most situations.
-------------------------------------------------------------------
Fri Nov 10 13:40:12 UTC 2017 - mimi.vx@gmail.com
- fix requires
-------------------------------------------------------------------
Fri Nov 10 12:59:53 UTC 2017 - mimi.vx@gmail.com
- fix tests to run on current python3
- added test_requrements.patch to allow newer versions of python-parso
-------------------------------------------------------------------
Fri Nov 10 12:43:52 UTC 2017 - mimi.vx@gmail.com
- fix test conditions
-------------------------------------------------------------------
Tue Sep 26 05:19:34 UTC 2017 - arun@gmx.de
- specfile:
* require python-parso
* require python-numpydoc for tests
- update to version 0.11.0:
* Split Jedi's parser into a separate project called parso.
* Avoiding side effects in REPL completion.
* Numpy docstring support should be much better.
* Moved the settings.*recursion* away, they are no longer usable.
-------------------------------------------------------------------
Mon Jun 19 18:58:25 UTC 2017 - sebix+novell.com@sebix.at
- only require python3-typing if necessary
-------------------------------------------------------------------
Fri Apr 28 17:16:29 UTC 2017 - jengelh@inai.de
- Grammatical corrections to description.
Replace historic focus by current focus.
-------------------------------------------------------------------
Thu Apr 27 18:17:53 UTC 2017 - toddrme2178@gmail.com
- Fix license.
-------------------------------------------------------------------
Thu Apr 27 15:47:45 UTC 2017 - toddrme2178@gmail.com
- Disable tests on non-x86/x86_64 platforms.
-------------------------------------------------------------------
Tue Apr 25 15:40:49 UTC 2017 - toddrme2178@gmail.com
- Update to version 0.10.2
* Python Packaging sucks. Some files were not included in 0.10.1.
- Update to version 0.10.1
* Fixed a few very annoying bugs.
* Prepared the parser to be factored out of Jedi.
- Update to version 0.10.0
* Actual semantic completions for the complete Python syntax.
* Basic type inference for ``yield from`` PEP 380.
* PEP 484 support (most of the important features of it).
* Added ``get_line_code`` to ``Definition`` and ``Completion``
objects.
* Completely rewritten the type inference engine.
* A new and better parser for (fast) parsing diffs of Python
code.
- Implement single-spec version
-------------------------------------------------------------------
Thu Nov 5 10:32:32 UTC 2015 - toddrme2178@gmail.com
- Fix tests
-------------------------------------------------------------------
Wed May 6 16:34:44 UTC 2015 - benoit.monin@gmx.fr
- update to version 0.9.0:
* The import logic has been rewritten to look more like Python's.
There is now an Evaluator.modules import cache, which resembles
sys.modules.
* Integrated the parser of 2to3. This will make refactoring
possible. It will also be possible to check for error messages
(like compiling an AST would give) in the future.
* With the new parser, the evaluation also completely changed.
It's now simpler and more readable.
* Completely rewritten REPL completion.
* Added jedi.names, a command to do static analysis. Thanks to
that sourcegraph guys for sponsoring this!
* Alpha version of the linter.
- remove "-final0" appended to source version
- add python-unittest2 as a test dependency for SLE11
- skip failing tests in test_integration_import.py
-------------------------------------------------------------------
Wed Aug 13 11:03:20 UTC 2014 - toddrme2178@gmail.com
- Update to version 0.8.1
* Bugfix release, the last release forgot to include files that
improve autocompletion for builtin libraries. Fixed.
- Update to version 0.8.0
* Memory Consumption for compiled modules (e.g. builtins, sys)
has been reduced drastically. Loading times are down as well
(it takes basically as long as an import).
* REPL completion is starting to become usable.
* Various small API changes. Generally this released focuses on
stability and refactoring of internal APIs.
* Introducing operator precedence, which makes calculating
correct Array indices and __getattr__ strings possible.
-------------------------------------------------------------------
Sun Dec 8 19:52:44 UTC 2013 - p.drouand@gmail.com
- Update to version 0.7.0
* switched from LGPL to MIT license
* added an Interpreter class to the API to make autocompletion
in REPL possible.
* added autocompletion support for namespace packages
* add sith.py, a new random testing method
- Change License to MIT
- Drop old python3 stuff
-------------------------------------------------------------------
Thu Oct 24 11:07:13 UTC 2013 - speilicke@suse.com
- Require python-setuptools instead of distribute (upstreams merged)
-------------------------------------------------------------------
Thu Aug 15 14:03:53 UTC 2013 - mvyskocil@suse.com
- update to 0.6.0
* Created find_module helper to handle compatibility with python 3.3
* Fixed caching issues
* More robust source encoding detection
* Improved documentantion
* and lot of bugfixes
- drop pre-checkin.sh
- drop a dependency on rpmbuild > 4.10, we don't need no ~ in version
-------------------------------------------------------------------
Thu May 9 07:53:19 UTC 2013 - mvyskocil@suse.com
- package python3 variant via pre_checkin.sh
-------------------------------------------------------------------
Thu May 2 09:16:31 UTC 2013 - mvyskocil@suse.com
- first packaging of jedi 0.5b5 for SUSE

87
python-jedi.spec Normal file
View File

@ -0,0 +1,87 @@
#
# spec file for package python-jedi
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-jedi
Version: 0.19.1
Release: 0
Summary: An autocompletion tool for Python
License: MIT AND Python-2.0
URL: https://github.com/davidhalter/jedi
Source0: https://files.pythonhosted.org/packages/source/j/jedi/jedi-%{version}.tar.gz
Source1: %{name}-rpmlintrc
# PATCH-FIX-UPSTREAM - Add support for Python 3.13
# https://github.com/davidhalter/jedi/pull/2008
# https://github.com/davidhalter/jedi/pull/2003
Patch0: python3.13-support.patch
# The author of jedi and parso takes pinning very seriously, adhere to it!
BuildRequires: %{python_module parso >= 0.8.3 with %python-parso < 0.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest >= 5}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# See pinning note above
Requires: (python-parso >= 0.8.3 with python-parso < 0.9)
BuildArch: noarch
%python_subpackages
%description
Jedi is a static analysis tool for Python that can be used in
IDEs/editors. Its focus is autocompletion and static
analysis.
Jedi has support for two different goto functions. It's possible to
search for related names and to list all names in a Python file and
infer them. Jedi understands docstrings and you can use Jedi
autocompletion in your REPL as well.
Jedi uses an API to connect with IDEs. There is a reference
implementation as a VIM plugin which uses Jedi's autocompletion.
%prep
%autosetup -p1 -n jedi-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG="en_US.UTF-8"
skiptests="test_venv_and_pths"
skiptests+=" or test_sqlite3_conversion"
# some architectures are too slow for these optimizer devel checks
skiptests+=" or test_speed"
# fails on some architectures
skiptests+=" or test_init_extension_module"
# This fails on 15.4_py39 server-side but not locally (!?)
skiptests+=" or test_get_default_environment_when_embedded"
%pytest -k "not ($skiptests)"
%files %{python_files}
%doc AUTHORS.txt CHANGELOG.rst README.rst
%license LICENSE.txt
%{python_sitelib}/jedi
%{python_sitelib}/jedi-%{version}.dist-info
%changelog

523
python3.13-support.patch Normal file
View File

@ -0,0 +1,523 @@
From 43902d83018c950c9ac1a97c58abc32838228867 Mon Sep 17 00:00:00 2001
From: Peter Law <PeterJCLaw@gmail.com>
Date: Thu, 4 Jul 2024 22:39:29 +0100
Subject: [PATCH 1/2] Merge branch 'ensure-unique-subprocess-reference-ids'
(cherry picked from commit e839683e91b78355f0363bcc6f74f762995344f8)
---
jedi/api/environment.py | 15 +-
.../inference/compiled/subprocess/__init__.py | 157 ++++++++++++++++--
2 files changed, 152 insertions(+), 20 deletions(-)
diff --git a/jedi/api/environment.py b/jedi/api/environment.py
index 771a9a83..cfe8cfe3 100644
--- a/jedi/api/environment.py
+++ b/jedi/api/environment.py
@@ -8,6 +8,7 @@ import hashlib
import filecmp
from collections import namedtuple
from shutil import which
+from typing import TYPE_CHECKING
from jedi.cache import memoize_method, time_cache
from jedi.inference.compiled.subprocess import CompiledSubprocess, \
@@ -15,6 +16,10 @@ from jedi.inference.compiled.subprocess import CompiledSubprocess, \
import parso
+if TYPE_CHECKING:
+ from jedi.inference import InferenceState
+
+
_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']
@@ -102,7 +107,10 @@ class Environment(_BaseEnvironment):
version = '.'.join(str(i) for i in self.version_info)
return '<%s: %s in %s>' % (self.__class__.__name__, version, self.path)
- def get_inference_state_subprocess(self, inference_state):
+ def get_inference_state_subprocess(
+ self,
+ inference_state: 'InferenceState',
+ ) -> InferenceStateSubprocess:
return InferenceStateSubprocess(inference_state, self._get_subprocess())
@memoize_method
@@ -134,7 +142,10 @@ class SameEnvironment(_SameEnvironmentMixin, Environment):
class InterpreterEnvironment(_SameEnvironmentMixin, _BaseEnvironment):
- def get_inference_state_subprocess(self, inference_state):
+ def get_inference_state_subprocess(
+ self,
+ inference_state: 'InferenceState',
+ ) -> InferenceStateSameProcess:
return InferenceStateSameProcess(inference_state)
def get_sys_path(self):
diff --git a/jedi/inference/compiled/subprocess/__init__.py b/jedi/inference/compiled/subprocess/__init__.py
index cd5fe74c..3a6039f7 100644
--- a/jedi/inference/compiled/subprocess/__init__.py
+++ b/jedi/inference/compiled/subprocess/__init__.py
@@ -5,6 +5,23 @@ goals:
1. Making it safer - Segfaults and RuntimeErrors as well as stdout/stderr can
be ignored and dealt with.
2. Make it possible to handle different Python versions as well as virtualenvs.
+
+The architecture here is briefly:
+ - For each Jedi `Environment` there is a corresponding subprocess which
+ operates within the target environment. If the subprocess dies it is replaced
+ at this level.
+ - `CompiledSubprocess` manages exactly one subprocess and handles communication
+ from the parent side.
+ - `Listener` runs within the subprocess, processing each request and yielding
+ results.
+ - `InterpreterEnvironment` provides an API which matches that of `Environment`,
+ but runs functionality inline rather than within a subprocess. It is thus
+ used both directly in places where a subprocess is unnecessary and/or
+ undesirable and also within subprocesses themselves.
+ - `InferenceStateSubprocess` (or `InferenceStateSameProcess`) provide high
+ level access to functionality within the subprocess from within the parent.
+ Each `InterpreterState` has an instance of one of these, provided by its
+ environment.
"""
import collections
@@ -16,6 +33,7 @@ import traceback
import weakref
from functools import partial
from threading import Thread
+from typing import Dict, TYPE_CHECKING
from jedi._compatibility import pickle_dump, pickle_load
from jedi import debug
@@ -25,6 +43,9 @@ from jedi.inference.compiled.access import DirectObjectAccess, AccessPath, \
SignatureParam
from jedi.api.exceptions import InternalError
+if TYPE_CHECKING:
+ from jedi.inference import InferenceState
+
_MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py')
PICKLE_PROTOCOL = 4
@@ -83,10 +104,9 @@ def _cleanup_process(process, thread):
class _InferenceStateProcess:
- def __init__(self, inference_state):
+ def __init__(self, inference_state: 'InferenceState') -> None:
self._inference_state_weakref = weakref.ref(inference_state)
- self._inference_state_id = id(inference_state)
- self._handles = {}
+ self._handles: Dict[int, AccessHandle] = {}
def get_or_create_access_handle(self, obj):
id_ = id(obj)
@@ -116,11 +136,49 @@ class InferenceStateSameProcess(_InferenceStateProcess):
class InferenceStateSubprocess(_InferenceStateProcess):
- def __init__(self, inference_state, compiled_subprocess):
+ """
+ API to functionality which will run in a subprocess.
+
+ This mediates the interaction between an `InferenceState` and the actual
+ execution of functionality running within a `CompiledSubprocess`. Available
+ functions are defined in `.functions`, though should be accessed via
+ attributes on this class of the same name.
+
+ This class is responsible for indicating that the `InferenceState` within
+ the subprocess can be removed once the corresponding instance in the parent
+ goes away.
+ """
+
+ def __init__(
+ self,
+ inference_state: 'InferenceState',
+ compiled_subprocess: 'CompiledSubprocess',
+ ) -> None:
super().__init__(inference_state)
self._used = False
self._compiled_subprocess = compiled_subprocess
+ # Opaque id we'll pass to the subprocess to identify the context (an
+ # `InferenceState`) which should be used for the request. This allows us
+ # to make subsequent requests which operate on results from previous
+ # ones, while keeping a single subprocess which can work with several
+ # contexts in the parent process. Once it is no longer needed(i.e: when
+ # this class goes away), we also use this id to indicate that the
+ # subprocess can discard the context.
+ #
+ # Note: this id is deliberately coupled to this class (and not to
+ # `InferenceState`) as this class manages access handle mappings which
+ # must correspond to those in the subprocess. This approach also avoids
+ # race conditions from successive `InferenceState`s with the same object
+ # id (as observed while adding support for Python 3.13).
+ #
+ # This value does not need to be the `id()` of this instance, we merely
+ # need to ensure that it enables the (visible) lifetime of the context
+ # within the subprocess to match that of this class. We therefore also
+ # depend on the semantics of `CompiledSubprocess.delete_inference_state`
+ # for correctness.
+ self._inference_state_id = id(self)
+
def __getattr__(self, name):
func = _get_function(name)
@@ -128,7 +186,7 @@ class InferenceStateSubprocess(_InferenceStateProcess):
self._used = True
result = self._compiled_subprocess.run(
- self._inference_state_weakref(),
+ self._inference_state_id,
func,
args=args,
kwargs=kwargs,
@@ -164,6 +222,17 @@ class InferenceStateSubprocess(_InferenceStateProcess):
class CompiledSubprocess:
+ """
+ A subprocess which runs inference within a target environment.
+
+ This class manages the interface to a single instance of such a process as
+ well as the lifecycle of the process itself. See `.__main__` and `Listener`
+ for the implementation of the subprocess and details of the protocol.
+
+ A single live instance of this is maintained by `jedi.api.environment.Environment`,
+ so that typically a single subprocess is used at a time.
+ """
+
is_crashed = False
def __init__(self, executable, env_vars=None):
@@ -213,18 +282,18 @@ class CompiledSubprocess:
t)
return process
- def run(self, inference_state, function, args=(), kwargs={}):
+ def run(self, inference_state_id, function, args=(), kwargs={}):
# Delete old inference_states.
while True:
try:
- inference_state_id = self._inference_state_deletion_queue.pop()
+ delete_id = self._inference_state_deletion_queue.pop()
except IndexError:
break
else:
- self._send(inference_state_id, None)
+ self._send(delete_id, None)
assert callable(function)
- return self._send(id(inference_state), function, args, kwargs)
+ return self._send(inference_state_id, function, args, kwargs)
def get_sys_path(self):
return self._send(None, functions.get_sys_path, (), {})
@@ -272,21 +341,65 @@ class CompiledSubprocess:
def delete_inference_state(self, inference_state_id):
"""
- Currently we are not deleting inference_state instantly. They only get
- deleted once the subprocess is used again. It would probably a better
- solution to move all of this into a thread. However, the memory usage
- of a single inference_state shouldn't be that high.
+ Indicate that an inference state (in the subprocess) is no longer
+ needed.
+
+ The state corresponding to the given id will become inaccessible and the
+ id may safely be re-used to refer to a different context.
+
+ Note: it is not guaranteed that the corresponding state will actually be
+ deleted immediately.
"""
- # With an argument - the inference_state gets deleted.
+ # Warning: if changing the semantics of context deletion see the comment
+ # in `InferenceStateSubprocess.__init__` regarding potential race
+ # conditions.
+
+ # Currently we are not deleting the related state instantly. They only
+ # get deleted once the subprocess is used again. It would probably a
+ # better solution to move all of this into a thread. However, the memory
+ # usage of a single inference_state shouldn't be that high.
self._inference_state_deletion_queue.append(inference_state_id)
class Listener:
+ """
+ Main loop for the subprocess which actually does the inference.
+
+ This class runs within the target environment. It listens to instructions
+ from the parent process, runs inference and returns the results.
+
+ The subprocess has a long lifetime and is expected to process several
+ requests, including for different `InferenceState` instances in the parent.
+ See `CompiledSubprocess` for the parent half of the system.
+
+ Communication is via pickled data sent serially over stdin and stdout.
+ Stderr is read only if the child process crashes.
+
+ The request protocol is a 4-tuple of:
+ * inference_state_id | None: an opaque identifier of the parent's
+ `InferenceState`. An `InferenceState` operating over an
+ `InterpreterEnvironment` is created within this process for each of
+ these, ensuring that each parent context has a corresponding context
+ here. This allows context to be persisted between requests. Unless
+ `None`, the local `InferenceState` will be passed to the given function
+ as the first positional argument.
+ * function | None: the function to run. This is expected to be a member of
+ `.functions`. `None` indicates that the corresponding inference state is
+ no longer needed and should be dropped.
+ * args: positional arguments to the `function`. If any of these are
+ `AccessHandle` instances they will be adapted to the local
+ `InferenceState` before being passed.
+ * kwargs: keyword arguments to the `function`. If any of these are
+ `AccessHandle` instances they will be adapted to the local
+ `InferenceState` before being passed.
+
+ The result protocol is a 3-tuple of either:
+ * (False, None, function result): if the function returns without error, or
+ * (True, traceback, exception): if the function raises an exception
+ """
+
def __init__(self):
self._inference_states = {}
- # TODO refactor so we don't need to process anymore just handle
- # controlling.
- self._process = _InferenceStateProcess(Listener)
def _get_inference_state(self, function, inference_state_id):
from jedi.inference import InferenceState
@@ -308,6 +421,9 @@ class Listener:
if inference_state_id is None:
return function(*args, **kwargs)
elif function is None:
+ # Warning: if changing the semantics of context deletion see the comment
+ # in `InferenceStateSubprocess.__init__` regarding potential race
+ # conditions.
del self._inference_states[inference_state_id]
else:
inference_state = self._get_inference_state(function, inference_state_id)
@@ -348,7 +464,12 @@ class Listener:
class AccessHandle:
- def __init__(self, subprocess, access, id_):
+ def __init__(
+ self,
+ subprocess: _InferenceStateProcess,
+ access: DirectObjectAccess,
+ id_: int,
+ ) -> None:
self.access = access
self._subprocess = subprocess
self.id = id_
--
2.45.2
From 2a638c784ff63ab869626d23ce95856dece31a9b Mon Sep 17 00:00:00 2001
From: Peter Law <PeterJCLaw@gmail.com>
Date: Sat, 6 Jul 2024 11:39:06 +0100
Subject: [PATCH 2/2] Merge branch 'python-3.13'
(cherry picked from commit 82d1902f382ddac5b0e6647646b72f28a3181ec3)
---
CHANGELOG.rst | 2 ++
jedi/_compatibility.py | 15 ++++++++++++++-
jedi/api/environment.py | 2 +-
jedi/inference/__init__.py | 2 +-
setup.py | 5 +++--
test/test_api/test_interpreter.py | 13 +++++++++----
test/test_inference/test_signature.py | 5 +++--
test/test_utils.py | 14 ++++++++++----
8 files changed, 43 insertions(+), 15 deletions(-)
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index fca94429..cf6810fa 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/_compatibility.py b/jedi/_compatibility.py
index 13a74b7b..48563d00 100644
--- a/jedi/_compatibility.py
+++ b/jedi/_compatibility.py
@@ -5,11 +5,24 @@ different Python versions.
import errno
import sys
import pickle
+from typing import Any
+
+
+class Unpickler(pickle.Unpickler):
+ def find_class(self, module: str, name: str) -> Any:
+ # Python 3.13 moved pathlib implementation out of __init__.py as part of
+ # generalising its implementation. Ensure that we support loading
+ # pickles from 3.13 on older version of Python. Since 3.13 maintained a
+ # compatible API, pickles from older Python work natively on the newer
+ # version.
+ if module == 'pathlib._local':
+ module = 'pathlib'
+ return super().find_class(module, name)
def pickle_load(file):
try:
- return pickle.load(file)
+ return Unpickler(file).load()
# Python on Windows don't throw EOF errors for pipes. So reraise them with
# the correct type, which is caught upwards.
except OSError:
diff --git a/jedi/api/environment.py b/jedi/api/environment.py
index cfe8cfe3..a2134110 100644
--- a/jedi/api/environment.py
+++ b/jedi/api/environment.py
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
_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 aadfeba9..bd31cbd3 100644
--- a/jedi/inference/__init__.py
+++ b/jedi/inference/__init__.py
@@ -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.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 68210ef2..ed1e67a4 100755
--- a/setup.py
+++ b/setup.py
@@ -35,8 +35,8 @@ setup(name='jedi',
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 @@ setup(name='jedi',
'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',
diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py
index 74f066b8..efff7c5b 100644
--- a/test/test_api/test_interpreter.py
+++ b/test/test_api/test_interpreter.py
@@ -310,8 +310,9 @@ def test_completion_param_annotations():
# Need to define this function not directly in Python. Otherwise Jedi is too
# clever and uses the Python code instead of the signature object.
code = 'def foo(a: 1, b: str, c: int = 1.0) -> bytes: pass'
- exec(code, locals())
- script = jedi.Interpreter('foo', [locals()])
+ exec_locals = {}
+ exec(code, exec_locals)
+ script = jedi.Interpreter('foo', [exec_locals])
c, = script.complete()
sig, = c.get_signatures()
a, b, c = sig.params
@@ -323,7 +324,7 @@ def test_completion_param_annotations():
assert b.description == 'param b: str'
assert c.description == 'param c: int=1.0'
- d, = jedi.Interpreter('foo()', [locals()]).infer()
+ d, = jedi.Interpreter('foo()', [exec_locals]).infer()
assert d.name == 'bytes'
@@ -525,10 +526,14 @@ def test_partial_signatures(code, expected, index):
c = functools.partial(func, 1, c=2)
sig, = jedi.Interpreter(code, [locals()]).get_signatures()
- assert sig.name == 'partial'
assert [p.name for p in sig.params] == expected
assert index == sig.index
+ if sys.version_info < (3, 13):
+ # Python 3.13.0b3 makes functools.partial be a descriptor, which breaks
+ # Jedi's `py__name__` detection; see https://github.com/davidhalter/jedi/issues/2012
+ assert sig.name == 'partial'
+
def test_type_var():
"""This was an issue before, see Github #1369"""
diff --git a/test/test_inference/test_signature.py b/test/test_inference/test_signature.py
index f8f71581..4a1fcb62 100644
--- a/test/test_inference/test_signature.py
+++ b/test/test_inference/test_signature.py
@@ -1,5 +1,5 @@
from textwrap import dedent
-from operator import ge, lt
+from operator import eq, ge, lt
import re
import os
@@ -14,7 +14,8 @@ from ..helpers import get_example_dir
('import math; math.cos', 'cos(x, /)', ['x'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], lt, (3, 12)),
- ('next', 'next()', [], ge, (3, 12)),
+ ('next', 'next()', [], eq, (3, 12)),
+ ('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (3, 13)),
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),
diff --git a/test/test_utils.py b/test/test_utils.py
index f17fc246..13786d38 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -73,15 +73,21 @@ class TestSetupReadline(unittest.TestCase):
import os
s = 'from os import '
goal = {s + el for el in dir(os)}
+
# There are minor differences, e.g. the dir doesn't include deleted
# items as well as items that are not only available on linux.
difference = set(self.complete(s)).symmetric_difference(goal)
+ ACCEPTED_DIFFERENCE_PREFIXES = [
+ '_', 'O_', 'EX_', 'EFD_', 'MFD_', 'TFD_',
+ 'SF_', 'ST_', 'CLD_', 'POSIX_SPAWN_', 'P_',
+ 'RWF_', 'CLONE_', 'SCHED_', 'SPLICE_',
+ ]
difference = {
x for x in difference
- if all(not x.startswith('from os import ' + s)
- for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_', 'ST_',
- 'CLD_', 'POSIX_SPAWN_', 'P_', 'RWF_',
- 'CLONE_', 'SCHED_'])
+ if not any(
+ x.startswith('from os import ' + prefix)
+ for prefix in ACCEPTED_DIFFERENCE_PREFIXES
+ )
}
# There are quite a few differences, because both Windows and Linux
# (posix and nt) libraries are included.
--
2.45.2