Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-python"
---

Improve install process
22 changes: 1 addition & 21 deletions packages/typespec-python/scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,4 @@
raise Exception("Your Python installation doesn't have venv available")


# Now we have a package manager (uv or pip) and Py >= 3.9, go to work

from pathlib import Path

_ROOT_DIR = Path(__file__).parent.parent


def main():
venv_path = _ROOT_DIR / "venv"

# Create virtual environment using package manager abstraction
from package_manager import create_venv_with_package_manager, install_packages

venv_context = create_venv_with_package_manager(venv_path)

# Install required packages - install_packages handles package manager logic
install_packages(["-U", "black"], venv_context)


if __name__ == "__main__":
main()
# Now we have a package manager (uv or pip) and Py >= 3.9 and check is over
4 changes: 2 additions & 2 deletions packages/typespec-python/scripts/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

def main():
venv_path = _ROOT_DIR / "venv"
venv_preexists = venv_path.exists()

assert venv_preexists # Otherwise install was not done
# Create virtual environment using package manager abstraction
from package_manager import create_venv_with_package_manager, install_packages

venv_context = create_venv_with_package_manager(venv_path)

Expand Down
Loading