File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,11 @@ def get_project_root():
7676
7777def read_pyproject_config ():
7878 """Read configurations from pyproject.toml if it exists"""
79- # Default path includes lib/pypi which is the default dependency folder for moccasin
8079 config = {
8180 "files" : [],
8281 "disabled_rules" : set (),
8382 "rule_configs" : {},
84- "path" : ["lib/pypi" ],
83+ "path" : [],
8584 }
8685
8786 try :
Original file line number Diff line number Diff line change @@ -55,11 +55,35 @@ def _obtain_sys_path():
5555 return valid_paths
5656
5757
58+ def _obtain_default_paths ():
59+ """
60+ Obtain default paths for Vyper imports.
61+ Only returns paths that actually exist on the system.
62+ """
63+ # List of default paths to check
64+ default_paths = [
65+ "lib/pypi" , # Default dependency folder for moccasin
66+ # Add more paths here in the future
67+ ]
68+
69+ # Return only existing paths
70+ existing_paths = []
71+ for path in default_paths :
72+ if os .path .exists (path ) and os .path .isdir (path ):
73+ existing_paths .append (path )
74+
75+ return existing_paths
76+
77+
5878def vyper_compile (filename , formatting , extra_paths = None ):
5979 _check_vyper_version ()
6080
6181 # For each path add a '-p /the/path' flag to the compiler
6282 paths = [item for p in _obtain_sys_path () for item in ["-p" , p ]]
83+
84+ # Add default paths (like lib/pypi for moccasin)
85+ for path in _obtain_default_paths ():
86+ paths .extend (["-p" , path ])
6387
6488 # Add extra paths if provided
6589 if extra_paths :
You can’t perform that action at this time.
0 commit comments