You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've encountered an issue with jedi where it fails to process files that doesn't contain lambda expressions. This issue arose after I introduced dynaconf to manage the project configurations, which might be altering the import mechanism in a way jedi can't handle.
Steps to Reproduce
Introduce dynaconf for project configuration management.
Use jedi to analyze the codebase for references.
Encounter errors related to unnamed lambda expressions.
importgitimportos,jsonimportastfromsettingimportsettingsasCONFIGfromutils.gitignore_checkerimportGitignoreCheckerclassFileHandler:
def__init__(self, repo_path, file_path):
self.file_path=file_pathself.repo_path=repo_pathself.project_hierarchy=os.path.join(repo_path, CONFIG['project_hierarchy'])
defconvert_all_to_markdown_files_from_json(self):
""" Converts all files to markdown format based on the JSON data. Reads the project hierarchy from a JSON file, checks if the Markdown_docs folder exists, creates it if it doesn't, and then iterates through each file in the JSON data. For each file, it converts the file to markdown format and writes it to the Markdown_docs folder. Args: self (object): The file_handler object. Returns: None """withopen(self.project_hierarchy, 'r', encoding='utf-8') asf:
json_data=json.load(f)
markdown_docs_path=os.path.join(self.repo_path, CONFIG['Markdown_Docs_folder'])
ifnotos.path.exists(markdown_docs_path):
os.mkdir(markdown_docs_path)
forrel_file_path, file_dictinjson_data.items():
md_path=os.path.join(markdown_docs_path, rel_file_path.replace('.py', '.md'))
markdown=self.convert_to_markdown_file(rel_file_path)
os.makedirs(os.path.dirname(md_path), exist_ok=True)
withopen(md_path, 'w', encoding='utf-8') asf:
f.write(markdown)
I am puzzled by this matter. From from config import CONFIG to from setting import settings as CONFIG, and this import sentence have been used in other file which works fine.
Actual Behavior
When running jedi to get references in my project, I receive the following error messages for files that contain lambda expressions:
File"/home/codespace/.local/lib/python3.10/site-packages/parso/python/tree.py", line669, innameraiseAttributeError("lambda is not named.")
AttributeError: lambdaisnotnamed.
Environment Information
Jedi version: 0.19.1
Python version: Python 3.10.13
Operating System: Linux
I have attached tracert logs showing the error messages.
Issue Description
Hi, I've encountered an issue with
jedi
where it fails to process files that doesn't contain lambda expressions. This issue arose after I introduceddynaconf
to manage the project configurations, which might be altering the import mechanism in a wayjedi
can't handle.Steps to Reproduce
dynaconf
for project configuration management.jedi
to analyze the codebase for references.Here is dynaconf code of
setting.py
The file
file_handler.py
needs to analyse.Jedi
UsageI use
from config import CONFIG
previously, which isconfig.py
I am puzzled by this matter. From
from config import CONFIG
tofrom setting import settings as CONFIG
, and thisimport
sentence have been used in other file which works fine.Actual Behavior
When running
jedi
to get references in my project, I receive the following error messages for files that contain lambda expressions:Environment Information
0.19.1
I have attached tracert logs showing the error messages.
tracert.txt
Thank you for looking into this issue. Please let me know if there's any additional information I can provide.
The text was updated successfully, but these errors were encountered: