1
0
forked from VimPlug/jedi
Commit Graph

772 Commits

Author SHA1 Message Date
Dave Halter e7fdbcc834 Fix a few more typing issues 2026-02-04 02:24:41 +01:00
Dave Halter 3ffed76884 Improve a weird typing issue 2026-02-04 01:28:30 +01:00
Dave Halter 30ef824abd Introduce some stricter typing 2026-02-04 01:19:14 +01:00
Dave Halter c7481b3319 Fix a linter issue 2026-01-20 02:05:51 +01:00
Dave Halter 3ac1632a5c Avoid the need to import search_ancestor 2026-01-19 20:30:03 +01:00
Mark Diekhans a89757a966 Handle object with __file__ attribute having a None value (issue #2082) 2025-12-20 17:24:25 -08:00
Hoblovski 3454ebb1de fix: let star_expr infer to NO_VALUES instead of crashing 2025-11-13 20:41:58 +08:00
Eric Masseran 15a7513fd0 Improve code comment 2025-08-29 18:54:30 +02:00
Eric Masseran 3a436df7ac Remove property usage 2025-08-29 18:37:37 +02:00
Eric Masseran c1e9aee15b Clean code comments 2025-08-29 18:37:23 +02:00
Eric Masseran 6e5f201f6c Use future annotations 2025-08-29 18:36:54 +02:00
Eric Masseran 356923e40d Merge remote-tracking branch 'origin' into support-dataclass-transform
* origin:
  Fix pip install -e in docs
  Upgrade Mypy
  Fix a few flake8 issues
  Upgrade flake8
  Upgrade other test runners
  Remove 3.6/3.7 references and change tests slightly
  Upgrade OS's that it is tested on
  Try to add something to the README
2025-08-28 10:33:17 +02:00
Dave Halter d411290dff Upgrade Mypy 2025-06-16 16:49:46 +02:00
Dave Halter e5a72695a8 Remove 3.6/3.7 references and change tests slightly 2025-06-16 16:18:15 +02:00
Eric Masseran 503c88d987 Merge remote-tracking branch 'origin' into support-dataclass-transform
* origin:
  Don't remove `sys.path[0]`.
  perf: improve performance by replacing list to set
  Explicit sphinx config path
2025-05-05 02:03:07 +02:00
Eric Masseran d53a8ef81c Support init customization on dataclass_transform source 2025-05-05 02:02:17 +02:00
Eric Masseran 5f4afa27e5 Documentation and better naming 2025-05-04 23:34:58 +02:00
Eric Masseran 999332ef77 Dataclass transform change init False 2025-03-18 00:30:50 +01:00
Eric Masseran 50778c390f Fix init=false for transform and exclude fields on base transform 2025-03-15 16:23:32 +01:00
Eric Masseran 8912a35502 Support init=False for dataclass_transform 2025-03-15 16:00:51 +01:00
Eric Masseran 77cf382a1b Support init=False for dataclass 2025-03-15 15:53:51 +01:00
Eric Masseran 472ee75e3c Add ClassVar support for dataclass 2025-03-15 13:15:19 +01:00
Eric Masseran efc7248175 Fix mypy 2025-03-15 12:05:05 +01:00
Damian Birchler 35a12fab7a Don't remove sys.path[0].
Fixes https://github.com/davidhalter/jedi/issues/2053.
2025-03-13 09:52:49 +01:00
Robin 699c930bd4 perf: improve performance by replacing list to set 2025-03-05 12:53:08 +00:00
Eric Masseran 74b46f3ee3 Add doc 2025-02-15 20:27:08 +01:00
Eric Masseran 027e29ec50 Support base class and metaclass mode 2025-02-15 20:12:53 +01:00
WutingjiaX 2859e4f409 Support inferring not expr to bool (#2016)
* support inferring some not expr

* format

---------

Co-authored-by: wutingjia <wutingjia@bytedance.com>
2024-07-12 12:58:39 +00:00
wutingjia 4d09ac07e4 When inferring comparison operators, return a definite type instead of NO_VALUES for the in/not in operator 2024-07-10 11:20:11 +08:00
Peter Law d543d1d004 Support Python 3.13
This moves to using the 3.13 grammar as well as testing 3.13 in CI.
2024-07-02 21:37:34 +01:00
Peter Law a67deeb602 Fix race condition around subprocess inference state tidyup
There was a race condition due to the combination of Python's
object ids being re-usable and Jedi persisting such ids beyond
the real lifeteime of some objects. This could lead to the
subprocess' view of the lifetime of `InferenceState` contexts
getting out of step with that in the parent process and
resulting in errors when removing them. It is also possible
that this could result in erroneous results being reported,
however this was not directly observed.

The race was specifically:
- `InferenceState` A created, gets id 1
- `InferenceStateSubprocess` A' created, uses `InferenceState`
  A which it stores as a weakref and an id
- `InferenceStateSubprocess` A' is used, the sub-process learns
  about an `InferenceState` with id 1
- `InferenceState` A goes away, `InferenceStateSubprocess` A' is
  not yet garbage collected
- `InferenceState` B created, gets id 1
- `InferenceStateSubprocess` B' created, uses `InferenceState` B
  which it stores as a weakref and an id
- `InferenceStateSubprocess` B' is used, the sub-process re-uses
  its entry for an `InferenceState` with id 1

At this point the order of operations between the two
`InferenceStateSubprocess` instances going away is immaterial --
both will trigger a removal of a state with id 1. As long as B'
doesn't try to use the sub-process again after the first removal
has happened then the second removal will fail.

This commit resolves the race condition by coupling the context
in the subprocess to the corresponding manager class instance
in the parent process, rather than to the consumer `InferenceState`.

See inline comments for further details.
2024-07-02 21:37:34 +01:00
Peter Law 9d18b7c36d Document how Jedi manages its subprocesses
This is derived from my understanding of the code, plus a bit of
experimentation.
2024-07-02 21:37:34 +01:00
Peter Law fff6e0ce2e Drop unused member
I'm not sure where this was used in the past, however it appears
to be unused now. Removing this simplifies a change I'm about to
make to _InferenceStateProcess.
2024-07-02 21:37:34 +01:00
Peter Law a0527a5af5 Pass through the inference state id rather than recomputing it
This removes some of the coupling between the management of the
underlying process and the inference state itself, which intends
to enable changing the origin of the id. This will be useful in
the next commit.
2024-07-02 21:37:34 +01:00
pyscripter a4574a50d0 Fix resolving of names that are not annotations (#1989), fixes #1988
* Fix #1988

* Fix failing code quality test.

* Fix  flake W504 line break after binary operator.  Now as formatted by Black.

* Added test to test/completion/pep0484_basic.py
Addressed feedback from Dave
2024-04-25 09:11:24 +00:00
Peter Law 770cdade00 Claim support for Python 3.12 2023-09-16 21:41:06 +01:00
Dave Halter 57aefed6ea Allow unsafe custom __getitem__ executions when allow unsafe executions is on 2023-07-29 00:33:09 +02:00
Dave Halter 8a4b079d0f allow_descriptor_getattr -> allow_unsafe_interpreter_executions 2023-07-29 00:06:55 +02:00
Dave Halter d8420d0f72 Add a note to the changelog 2023-07-28 22:59:03 +02:00
Dave Halter 886279fb6d Try to use the return annotations of properties, if available, fixes #1933 2023-07-28 22:35:15 +02:00
Dave Halter ff3a7f367f Avoid evaluating properties just for the api type, improves #1933 2023-07-28 22:11:15 +02:00
Dave Halter 1f70e3301e Revert "Avoid one layer of caching that is probably useless"
This reverts commit a34c348a55.
2023-07-28 16:10:30 +02:00
Dave Halter a34c348a55 Avoid one layer of caching that is probably useless 2023-07-28 16:05:56 +02:00
Dave Halter 972123c9c9 Introduce the property return annotation 2023-07-28 15:54:54 +02:00
Dave Halter 6455a14841 Avoid multiple getattrs instead of a single one, see also #1933 2023-07-28 15:10:37 +02:00
Dave Halter 8d9e3ab3a7 Simplify 2023-07-28 13:10:26 +02:00
Dave Halter 048173e467 Remove a piece of unimportant code, see discussion in #1933 2023-07-28 10:15:28 +02:00
Dave Halter 1947e7dd56 Avoid dynamic params search for Interpreter, fixes #1899 2023-07-27 13:49:27 +02:00
Dave Halter 6ea5ad7b19 Fix issue around completions with multiple with with_items, fixes 1931 2023-07-27 11:54:39 +02:00
Luc Khai Hai 72d34f3d7d Support typing.Annotated inference 2023-06-17 20:46:03 +09:00