summaryrefslogtreecommitdiff
path: root/astroid/interpreter
Commit message (Collapse)AuthorAgeFilesLines
* Recognize stub ``pyi`` Python files. (#2182)HEADmainMark Byrne2023-05-161-1/+1
| | | | | | | Recognize stub ``pyi`` Python files. Refs pylint-dev/pylint#4987 Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Fix constructors of ``BaseContainer`` and ``Dict``Daniël van Noord2023-05-081-5/+35
|
* Add two type ignoresDaniël van Noord2023-05-081-2/+3
|
* Fix the signature of ``infer_call_result``Daniel van Noord2023-04-251-12/+26
|
* Drop support for Python 3.7 (#2137)Marc Mueller2023-04-232-14/+3
|
* Remove all ``lazy_imports``Daniël van Noord2023-04-231-10/+20
|
* Fix constructors of ``FunctionDef``Daniël van Noord2023-04-221-3/+26
| | | | Co-authored-by: Nick Drozd <nicholasdrozd@gmail.com>
* Suppress UserWarning when finding module specs (#2121)Jacob Walls2023-04-161-1/+4
| | | | | | | Found when linting this code: ``` import setuptools import pip ```
* Fix constructors of ``Arguments``Daniël van Noord2023-04-031-2/+6
|
* Fix constructors of ``AssignName`` (#2077)Daniël van Noord2023-04-031-2/+12
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* [PyCQA migration] Upgrade links to the repositories in code and docPierre Sassoulas2023-03-294-11/+11
|
* Upgrade pre-commit configuration and move to ruff (#2057)Pierre Sassoulas2023-03-141-1/+1
|
* Update submodule_path after finding an editable install (#2033)noah-weingarden2023-02-261-2/+12
|
* Create ``UninferableBase``Daniël van Noord2023-02-051-1/+1
|
* Add support for custom import hooks (#1752)Daniël van Noord2023-02-051-8/+67
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Initial pass with ``pydocstringformatter``Daniël van Noord2023-01-093-8/+10
|
* [pre-commit] Trying out black 23.1a1 (#1909)Pierre Sassoulas2022-12-271-1/+0
| | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Bump pylint from 2.15.8 to 2.15.9 (#1907)dependabot[bot]2022-12-271-6/+5
|
* Add some inference annotations (#1887)Nick Drozd2022-12-151-4/+4
| | | | Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix misc type issues (#1884)Nick Drozd2022-11-221-2/+2
|
* Add some InferenceContext annotations (#1883)Nick Drozd2022-11-221-6/+18
|
* Add some bool annotations (#1877)Nick Drozd2022-11-221-1/+1
|
* Prevent a crash when a module's ``__path__`` is missingJacob Walls2022-10-151-0/+2
|
* Create ``ContextManagerModel`` and let ``GeneratorModel`` inheritDaniël van Noord2022-09-291-1/+43
|
* improve is_namespace checkSaugat Pachhai (सौगात)2022-09-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://stackoverflow.com/a/42962529. Let's take the following contents as an example: ```python import celery.result ``` From #1777, astroid started to use `processed_components` for namespace check. In the above case, the `modname` is `celery.result`, it first checks for `celery` and then `celery.result`. Before that PR, it'd always check for `celery.result`. `celery` is recreating module to make it lazily load. See https://github.com/celery/celery/blob/34533ab44d2a6492004bc3df44dc04ad5c6611e7/celery/__init__.py#L150. This module does not have `__spec__` set. Reading through Python's docs, it seems that `__spec__` can be set to None, so it seems like it's not a thing that we can depend upon for namespace checks. See https://docs.python.org/3/reference/import.html#spec__. --- The `celery.result` gets imported for me when pylint-pytest plugin tries to load fixtures, but this could happen anytime if any plugin imports packages. In that case, `importlib.util._find_spec_from_path("celery")` will raise ValueError since it's already in `sys.modules` and does not have a spec. Fixes https://github.com/PyCQA/pylint/issues/7488.
* [flake8] Set the max line length to 110 instead of 138Pierre Sassoulas2022-09-191-1/+3
| | | | | Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
* Stop detecting modules compiled by `cffi` as namespace packages (#1777)Jacob Walls2022-09-171-1/+7
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Give a created Arguments node a parentDaniël van Noord2022-09-151-3/+3
|
* Prevent first-party imports from being resolved to `site-packages` (#1756)Jacob Walls2022-08-291-1/+15
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add a comment about missing ``__spec__`` on ``PyPy`` (#1758)Daniël van Noord2022-08-281-0/+2
|
* Fix namespace package detection for frozen stdlib modules on PyPy (#1757)Jacob Walls2022-08-271-1/+3
|
* Remove str instance in model of BaseException.attrs (#1749)Daniël van Noord2022-08-231-5/+2
| | | | | | | | Do not require first exception argument to be a string. The word "usually" does not imply an obligation. https://docs.python.org/3/library/exceptions.html#BaseException.args Co-authored-by: Nicholas Guriev <nicholas@guriev.su>
* Fix crash in `ExplicitNamespacePackageFinder` (#1714)Jacob Walls2022-08-091-4/+5
| | | | | | | * Add skip if no `six` * `urllib3` does appear to be required * Check `submodule_search_locations` Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add some implicit typing (#1706)Daniël van Noord2022-07-111-1/+7
| | | | | | | * Type most defintions of ``pytype`` and ``qname`` * Add typing to ``implicit_parameters`` * Type ``type()``
* Add ``__init__`` to the ``ObjectModel`` and return ``BoundMethods`` (#1687)Daniël van Noord2022-07-061-36/+41
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Add ``__new__`` and ``__call__`` to``ObjectModel`` and ``ClassModel`` (#1606)Daniël van Noord2022-07-031-1/+18
|
* Add strict typing to ``modutils`` (#1626)Daniël van Noord2022-06-161-4/+4
|
* Only initialize importers when they are required (#1624)Daniël van Noord2022-06-161-70/+39
| | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Add ignores for missing imports from ``importlib``Daniël van Noord2022-06-161-1/+1
|
* Add strict typing to ``spec.py``Daniël van Noord2022-06-161-27/+59
|
* Do not use deprecated ``zipimport.load_module`` on ``PY310``Daniël van Noord2022-06-071-7/+28
|
* More conservative interpretation of `PathFinder.find_spec()` failures (#1581)Jacob Walls2022-05-311-2/+11
|
* Special case `__main__` in `is_namespace()` (#1579)Jacob Walls2022-05-311-2/+2
|
* Revert #1575 and catch further `KeyError`s (#1576)Jacob Walls2022-05-301-8/+40
| | | Provide `ModuleSpec.submodule_search_locations` to the `path` argument of `PathFinder.find_spec()`
* Provide first component of dotted path to namespace searches (#1575)Jacob Walls2022-05-301-7/+8
| | | | | | * Use first component of dotted path only in namespace searches * Add test and catch KeyError instead of altering search strategy
* Detect builtins module on PyPy 3.9 (#1567)Jacob Walls2022-05-241-13/+13
|
* Remove dependency on `pkg_resources` from `setuptools` (#1536)Jacob Walls2022-05-222-15/+36
| | | Avoid using `importlib.util.find_spec()` to avoid actually importing parent packages.
* Simplify namespace package detection on Python 3.7+ (#1566)Jacob Walls2022-05-151-4/+1
|
* Update typing for Python 3.7 (2) (#1556)Marc Mueller2022-05-131-1/+2
|
* Update typing for Python 3.7 (1) (#1555)Marc Mueller2022-05-132-16/+20
|