-
Notifications
You must be signed in to change notification settings - Fork 164
FEAT: Install pyaedt via uv #6338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
FEAT: Install pyaedt via uv #6338
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6338 +/- ##
==========================================
- Coverage 84.27% 81.96% -2.31%
==========================================
Files 175 175
Lines 65983 65983
==========================================
- Hits 55606 54083 -1523
- Misses 10377 11900 +1523 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give a try at making the whole project moving to uv instead of only this installation file ? Also, could you consider using UV_HTTP_TIMEOUT
in order to keep the previous behavior with ``--default-timeout` ? It has a larger scope but if I understand well the documentation it should be helping for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some comments, thanks for the contribution !
Note that we might have issues when using pyaedt
with uv
. In particular for those still leveraging the dotnet
target.
See ansys/pymechanical#1143 and the associated uv issue astral-sh/python-build-standalone#596
env = os.environ.copy() | ||
env["VIRTUAL_ENV"] = str(venv_dir) | ||
env["PATH"] = str(venv_dir / "Scripts") + os.pathsep + env.get("PATH", "") | ||
env["UV_HTTP_TIMEOUT "] = "1000" # Increase timeout for uv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env["UV_HTTP_TIMEOUT "] = "1000" # Increase timeout for uv | |
env["UV_HTTP_TIMEOUT"] = "1000" # Increase timeout for uv |
|
||
if args.version <= "231": | ||
subprocess.run([str(pip_exe), "uninstall", "-y", "pywin32"], check=True) # nosec | ||
subprocess.run([str(uv_exe), "pip", "uninstall", "-y", "pywin32"], check=True, env=env) # nosec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subprocess.run([str(uv_exe), "pip", "uninstall", "-y", "pywin32"], check=True, env=env) # nosec | |
subprocess.run([str(uv_exe), "pip", "uninstall", "-y", "pywin32"], check=True) # nosec |
Not defined here
subprocess.call([str(pip_exe), "uninstall", "-y", "pyaedt"], check=True) # nosec | ||
# Ensure uv is installed in the venv | ||
subprocess.run([str(pip_exe), "install", "uv"], check=True) # nosec | ||
subprocess.call([str(uv_exe), "pip", "uninstall", "-y", "pyaedt"], check=True, env=env) # nosec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subprocess.call([str(uv_exe), "pip", "uninstall", "-y", "pyaedt"], check=True, env=env) # nosec | |
subprocess.call([str(uv_exe), "pip", "uninstall", "-y", "pyaedt"], check=True) # nosec |
Not defined here
@@ -301,16 +314,16 @@ def install_pyaedt(): | |||
command.append("pyaedt[all,dotnet]=='0.9.0'") | |||
else: | |||
command.append("pyaedt[all]") | |||
subprocess.run(command, check=True) # nosec | |||
subprocess.run(command, check=True, env=env) # nosec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subprocess.run(command, check=True, env=env) # nosec | |
subprocess.run(command, check=True) # nosec |
else: | ||
print("Installing PyAEDT using online sources") | ||
print("Installing PyAEDT using online sources with uv...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to define the env variable here too or possibly sooner in your script.
…-to-use-uv-package-manager
Description
Use uv to install pyaedt dependencies
Issue linked
#6317
Checklist