Improve setup.py for proper installation
I am working towards packaging exo to nixpkgs.
This required a few patches to the source code.
In this PR, there are two of them, which I think don't hurt to have.
Currently, exo is not expected to be installed as a proper python library (using pip install) but rather ran directly from the source directory.
However, to package it to nixpkgs, we need to have it behave as a proper package.
The good news is that there is not too much to do.
-
move main.py script to package dir
Right now, the
main.pyscript is omitted and not copied to thelib/python3.12/site-packages/exo/install folder. By moving the source file under theexo/subfolder, it gets properly included. -
add entry_point exo to run main.py
This allows being able to run
exofrom the command line and get the application to start. -
add missing init.py files
Two
__init__.pyfiles were missing in some subdirectories which lead to them not being copied to the install folder. -
move tinychat inside exo package
Same, ensure that the
tinychatwebapp is installed too.
Have you managed to nix package your fork, @GaetanLepage ?
Yes, I have made it work (almost, my GPU doesn't support bfloat16 so I could not have my prompt answered). Those changes should be enough.
Yes, I have made it work (almost, my GPU doesn't support bfloat16 so I could not have my prompt answered). Those changes should be enough.
Do you have a repo for the nix package?
Yes, I have opened a draft PR here: https://github.com/NixOS/nixpkgs/pull/345352
@AlexCheema would you like me to do/test anything else about this PR ?
This looks good. Conflicts need to be fixed and README needs to be updated. You can also add the info about running the nix package in the README!
Thanks a lot for the review !
I rebased the branch on main, solved conflicts and corrected the README (python main.py -> exo).
You can also add the info about running the nix package in the README!
I will wait for it to be successfully packaged before advertising it here. But this is a great idea :)
You can also add the info about running the nix package in the README!
I will wait for it to be successfully packaged before advertising it here. But this is a great idea :)
Awesome. Great work on this, I like this better than python main.py.
I think we need to inform the community about this change once it's successfully packaged.
Awesome. Great work on this, I like this better than
python main.py.
Thanks for reviewing and merging this patch. I'm happy to somehow contribute to exo !
I think we need to inform the community about this change once it's successfully packaged.
Sure, maybe doing a post in your discord could be useful.