Skip to content

Commit aeca2ab

Browse files
authored
optimize installation (#3202)
1 parent 96ba48b commit aeca2ab

3 files changed

Lines changed: 10 additions & 23 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@azure-tools/typespec-python"
5+
---
6+
7+
Improve install process

packages/typespec-python/scripts/install.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,4 @@
2323
raise Exception("Your Python installation doesn't have venv available")
2424

2525

26-
# Now we have a package manager (uv or pip) and Py >= 3.9, go to work
27-
28-
from pathlib import Path
29-
30-
_ROOT_DIR = Path(__file__).parent.parent
31-
32-
33-
def main():
34-
venv_path = _ROOT_DIR / "venv"
35-
36-
# Create virtual environment using package manager abstraction
37-
from package_manager import create_venv_with_package_manager, install_packages
38-
39-
venv_context = create_venv_with_package_manager(venv_path)
40-
41-
# Install required packages - install_packages handles package manager logic
42-
install_packages(["-U", "black"], venv_context)
43-
44-
45-
if __name__ == "__main__":
46-
main()
26+
# Now we have a package manager (uv or pip) and Py >= 3.9 and check is over

packages/typespec-python/scripts/prepare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
def main():
2020
venv_path = _ROOT_DIR / "venv"
21-
venv_preexists = venv_path.exists()
2221

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

2525
venv_context = create_venv_with_package_manager(venv_path)
2626

0 commit comments

Comments
 (0)