Skip to content

Commit

Permalink
use another approach to set custom path
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytropolityka committed Aug 12, 2024
1 parent f38f3ae commit fcdc7e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions scripts/install_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ def main():
]

success = True
path_env = os.environ["PATH"]

for module in modules:
if os.path.isdir(module):

venv_path = os.path.join(os.getcwd(), module, ".venv")
path = os.path.join(os.getcwd(), module, ".venv")
os.environ["VIRTUAL_ENV"] = path
os.environ["PATH"] = os.path.join(path, "bin") + os.pathsep + path_env

env = os.environ.copy()
env["POETRY_VIRTUALENVS_PATH"] = venv_path

result = subprocess.run(["poetry", "install"], cwd=module, env=env)
subprocess.run([sys.executable, "-m", "venv", path])
result = subprocess.run(["poetry", "install"], cwd=path)

if result.returncode != 0:
success = False
Expand Down
10 changes: 5 additions & 5 deletions scripts/lint_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ def main():
]

success = True
path_env = os.environ["PATH"]

for module in modules:
if os.path.isdir(module):

venv_path = os.path.join(os.getcwd(), module, ".venv")

env = os.environ.copy()
env["POETRY_VIRTUALENVS_PATH"] = venv_path
path = os.path.join(os.getcwd(), module, ".venv")
os.environ["VIRTUAL_ENV"] = path
os.environ["PATH"] = os.path.join(path, "bin") + os.pathsep + path_env

result = subprocess.run(["poetry", "run", "prospector", "--profile",
os.path.abspath(os.path.join(os.path.dirname(__file__), "../.prospector.yaml"))],
cwd=module, env=env)
cwd=module)
if result.returncode != 0:
success = False

Expand Down

0 comments on commit fcdc7e0

Please sign in to comment.