exo icon indicating copy to clipboard operation
exo copied to clipboard

Improve setup.py for proper installation

Open GaetanLepage opened this issue 1 year ago • 8 comments

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.py script is omitted and not copied to the lib/python3.12/site-packages/exo/ install folder. By moving the source file under the exo/ subfolder, it gets properly included.
  • add entry_point exo to run main.py This allows being able to run exo from the command line and get the application to start.
  • add missing init.py files Two __init__.py files 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 tinychat webapp is installed too.

GaetanLepage avatar Sep 08 '24 19:09 GaetanLepage

Have you managed to nix package your fork, @GaetanLepage ?

Teebor-Choka avatar Sep 28 '24 19:09 Teebor-Choka

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.

GaetanLepage avatar Sep 28 '24 20:09 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.

Do you have a repo for the nix package?

Teebor-Choka avatar Sep 29 '24 20:09 Teebor-Choka

Yes, I have opened a draft PR here: https://github.com/NixOS/nixpkgs/pull/345352

GaetanLepage avatar Sep 29 '24 20:09 GaetanLepage

@AlexCheema would you like me to do/test anything else about this PR ?

GaetanLepage avatar Sep 29 '24 22:09 GaetanLepage

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!

AlexCheema avatar Sep 30 '24 17:09 AlexCheema

Thanks a lot for the review !

I rebased the branch on main, solved conflicts and corrected the README (python main.py -> exo).

GaetanLepage avatar Oct 01 '24 06:10 GaetanLepage

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 :)

GaetanLepage avatar Oct 01 '24 06:10 GaetanLepage

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.

AlexCheema avatar Oct 02 '24 11:10 AlexCheema

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.

GaetanLepage avatar Oct 02 '24 11:10 GaetanLepage