Skip to content

Commit

Permalink
Improved script for updating local dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
dotchetter committed Jan 7, 2024
1 parent b5ea34c commit 0ebb059
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions devtools/update_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,17 @@
"Run devtools/create_environment.py first.")

print("Building new Pyttman package...")
os.system("deactivate")
subprocess.check_call("python devtools/build.py".split())
os.chdir(LAB_ENV_PATH.as_posix())
shutil.rmtree("venv")
subprocess.run("python -m virtualenv venv".split())

while not Path("venv").exists():
sleep(0.01)

package_file = [
i for i in os.listdir(BUILD_OUTPUT_PATH.as_posix()) if i.endswith("tar.gz")
].pop()

print(f"Installing your new version of Pyttman from local build: '{package_file}'")
package_file = (BUILD_OUTPUT_PATH / package_file).as_posix()
venv_python = (LAB_ENV_PATH / "venv/scripts/python.exe").as_posix()
subprocess.run(f"{venv_python} -m pip install multidict".split())
subprocess.run(f"{venv_python} -m pip install --upgrade {package_file}".split())
subprocess.check_call(f"{venv_python} -m pip install --upgrade {package_file}".split())

print("\nFinished! Here's how to get started:",
f"1. Activate the virtual environment:\n\tcd dev_env\n\tvenv/scripts/activate",
f"2. Run the command 'pyttman' to see available commands to the Pyttman CLI",
Expand Down

0 comments on commit 0ebb059

Please sign in to comment.