sinaatalay / rendercv

The engine of the RenderCV App
http://docs.rendercv.com
MIT License
1.75k stars 116 forks source link

Remove 3rd party dependencies as source #8

Closed michael-sbarra closed 6 months ago

michael-sbarra commented 9 months ago

This project can minimize its footprint by removing the following 3rd party dependencies from source and instead pull them in in the install/setup stage:

Tools:

  1. [ ] TinyTex Fonts:
  2. [ ] Source-sans
  3. [ ] Roboto
  4. [ ] EB-Garmand
sinaatalay commented 9 months ago

This is a very good point. It would be great to achieve this eventually. I will keep this open until we find a way.

A potential issue that may arise when making TinyTeX a dependency:

I'm not knowledgeable enough about adding the fonts to dependencies. But I'm sure there is an elegant way.

michael-sbarra commented 9 months ago

This is a very good point. It would be great to achieve this eventually. I will keep this open until we find a way.

A potential issue that may arise when making TinyTeX a dependency:

* I made TinyTeX smaller (~500 MB to ~100 MB). Even though we can make it a dependency and let users install it during RenderCV installation, we wouldn't want them to install the whole 500 MB package.

I'm not knowledgeable enough about adding the fonts to dependencies. But I'm sure there is an elegant way.

@sinaatalay Which version of TinyText did you start with to make smaller? They offer four different bundles: https://github.com/rstudio/tinytex-releases#releases. I experimented and discovered that the regular TinyTeX bundle (~200MB archive) has all the dependencies this project needs (titlesec and enumitem) in addition to the ones in TinyTeX-1.

sinaatalay commented 9 months ago

@michael-sbarra I used regular TinyTeX. Yes, it has everything we need and more. Its compressed version is 225 MB, but it should be around ~500 MB after the extraction.

michael-sbarra commented 9 months ago

@sinaatalay I think its great that you are cognizant of the size of external dependencies that your project depends on. However, it is not a best practice to manually download dependencies, strip away the pieces a project doesn't need, and then include that dependency in the distribution of a project.

The TinyTex-1 bundle can be used, then only the extra packages can be installed instead of all of them from TinyTex:

tlmgr install titlesec enumitem fontawesome5 eso-pic bookmark lastpage
sinaatalay commented 9 months ago

@michael-sbarra Okay, that sounds really nice. How can we achieve this during installation, though? I have never added a non-Python dependency to a Python project before.

michael-sbarra commented 9 months ago

@sinaatalay Great question! Apparently as of today, this functionality doesn't exist. There is a PEP proposal for it: https://peps.python.org/pep-0725. I think the next best option is to just list the installation steps in the README. I have it tested for just TinyTex on macOS, I can't test the Windows one. #9

sinaatalay commented 6 months ago

I am closing this issue because, in v1, TinyTeX has been moved to another repository, which is being pulled as a submodule.