-
Notifications
You must be signed in to change notification settings - Fork 463
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
Use uv to manage Python dependencies, add Ubuntu 24.04 CI test. #5047
base: main
Are you sure you want to change the base?
Conversation
Out of curiosity, when you say modernize, do you perhaps mean accepting the perhaps-unpleasant change in pip3 that prevents (or very strongly discourages) one from installing Python packages in system-wide directories? Perhaps considering using a Python virtual environment? |
Yes. We might have to go with the times here because the workarounds are quite aggressive/invasive. I am exploring using poetry + virtualenv. If I work the kinks out you should be able to set up the entire Python environment in few commands:
sudo applications can be run using |
FYI, my install-p4dev-v8.sh script here: https://github.com/jafingerhut/p4-guide/blob/master/bin/install-p4dev-v8.sh can run as a normal user, with liberal I doubt that exactly what it does is what you need for this work, but just wanted to point it out as a working example of using a venv for all these tools together. I believe I also needed LD_LIBRARY_PATH=$LD_LIBRARY_PATH in addition to PATH=$PATH from some sudo commands, perhaps ones like Oh, and sometimes I found that instead of a command like |
Yes, I am aware of these and have recommended it to students I work with! But for the sake of the compiler installation we can stay be much simpler. Nonetheless, the changes here should definitely integrate with your scripts. I'll explore further. |
bca3a83
to
cefdc44
Compare
ac75baf
to
eceef54
Compare
@jafingerhut Poetry works really well for managing Python dependencies. It was not difficult at all to set this up for all our distributions. All you need to do is call Poetry also exposes a bunch of small issues we had hidden in the environment. For example, we are relying on the external One thing: It looks Poetry is not supported well Ubuntu18.04. This might be a good opportunity to finally deprecate this version. |
eb1ef3d
to
1c1268d
Compare
6f47c5f
to
d75e137
Compare
257e094
to
99f3b3e
Compare
|
||
sudo apt-get install -y python3-poetry python3-venv | ||
poetry install | ||
poetry shell |
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.
Is my understanding correct that uv is a poetry replacement, and if we use uv, there is no need to install poetry at all?
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.
Yeah, I am trying out uv
as an alternative and it is pretty neat for dependency management so far.
daacc39
to
f53547b
Compare
Signed-off-by: fruffy <fruffy@nyu.edu>
Signed-off-by: fruffy <fruffy@nyu.edu>
Signed-off-by: fruffy <fruffy@nyu.edu>
@vbnogueira Trying to refactor the Python setup for TC STF I am seeing timeouts. Do you know possible reasons for that? Could be a simple fix. |
I tested it out and I believe the VM is not getting started because the runner is not finding the |
Thanks, that already helps me. I can likely fix this. |
@@ -0,0 +1 @@ | |||
3.12 |
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.
Is adding this .python-version intentional? What uses it?
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.
Yes, this picks the default Python version for this particular project. It's optional, I might remove it once I clean up these particular files.
4280b4c
to
c17124b
Compare
Signed-off-by: fruffy <fruffy@nyu.edu>
WiP. Try to modernize the way we set up our Python environment.