Skip to content
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

implement sub-packages to install only selected module dependencies #114

Open
nbehrnd opened this issue Jul 13, 2022 · 6 comments
Open

implement sub-packages to install only selected module dependencies #114

nbehrnd opened this issue Jul 13, 2022 · 6 comments

Comments

@nbehrnd
Copy link
Contributor

nbehrnd commented Jul 13, 2022

The issue either suggests to reformulate the project's main README.org, or to revise how individual modules of Memacs are installed.

The aim was to install Memacs with the photos module in an instance of Linux Debian 12/bookworm, branch testing. Before this, there was no permanent installation of Memacs at all (a virtual environment for Python earlier used for testing already was removed). At this point, there was no intent to use any other optional module of Memacs. This is why I thought

python3 -m pip install memacs photos

would fit well.

Contrasting to anticipation, the log reports the installation of multiple modules of Memacs:

norwid@carnot2:~$ python3 -m pip install memacs photos
Defaulting to user installation because normal site-packages is not writeable
Collecting memacs
  Using cached memacs-2021.1.28.1-py3-none-any.whl (110 kB)
Collecting photos
  Using cached photos-0.0.5-py3-none-any.whl (6.5 kB)
Collecting orgformat
  Using cached orgformat-2019.12.29.1-py3-none-any.whl (22 kB)
Collecting emoji
  Using cached emoji-1.7.0.tar.gz (175 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: click>=7.0 in /usr/lib/python3/dist-packages (from photos) (8.0.3)
Requirement already satisfied: colorama>=0.4.0 in /usr/lib/python3/dist-packages (from photos) (0.4.5)
Collecting filesystemlib
  Using cached filesystemlib-0.1.0-py3-none-any.whl (6.5 kB)
Collecting ExifRead
  Using cached ExifRead-3.0.0-py3-none-any.whl (40 kB)
Collecting pyheif
  Using cached pyheif-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB)
Requirement already satisfied: cffi>=1.0.0 in /usr/lib/python3/dist-packages (from pyheif->photos) (1.15.0)
Building wheels for collected packages: emoji
  Building wheel for emoji (setup.py) ... done
  Created wheel for emoji: filename=emoji-1.7.0-py3-none-any.whl size=171046 sha256=3e7601d9e0302683ad709f4e5286161b9cecaaaab9b8e8abf98cf9036a930710
  Stored in directory: /home/norwid/.cache/pip/wheels/31/8a/8c/315c9e5d7773f74b33d5ed33f075b49c6eaeb7cedbb86e2cf8
Successfully built emoji
Installing collected packages: orgformat, ExifRead, emoji, pyheif, memacs, filesystemlib, photos
  WARNING: The scripts memacs_arbtt, memacs_battery, memacs_chrome, memacs_csv, memacs_example, memacs_filenametimestamps, memacs_firefox, memacs_git, memacs_gpx, memacs_ical, memacs_imap, memacs_kodi, memacs_lastfm, memacs_mumail, memacs_phonecalls, memacs_phonecalls_superbackup, memacs_photos, memacs_rss, memacs_simplephonelogs, memacs_sms, memacs_sms_superbackup, memacs_svn, memacs_twitter and memacs_whatsapp are installed in '/home/norwid/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script photos is installed in '/home/norwid/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed ExifRead-3.0.0 emoji-1.7.0 filesystemlib-0.1.0 memacs-2021.1.28.1 orgformat-2019.12.29.1 photos-0.0.5 pyheif-0.7.0
norwid@carnot2:~$ 
norwid@carnot2:~$ PATH=/home/norwid/.local/bin:$PATH  # addition for the PATH variable

for a total of

norwid@carnot2:~/.local/bin$ ls ~/.local/bin/memacs_* | wc -l
24

though for now I would like to get familiar with a sub set of them.

@novoid
Copy link
Owner

novoid commented Jul 14, 2022

This would be a helpful improvement, indeed. Unfortunately, I don't know how to do that.

Maybe somebody wants to contribute here? I've set the "help wanted" label.

@nbehrnd
Copy link
Contributor Author

nbehrnd commented Jul 15, 2022

@novoid By «git archeology» / reading the git log by June 2, 2020, I speculate Andrea Ghensi might help here. Because the symbolization / profile picture does not appear among the self declared «watchers» of this very project, I send one ping («one ping only ... ») to inform about the obstacle ahead.

@nbehrnd
Copy link
Contributor Author

nbehrnd commented Jul 15, 2022

@sanzoghenzo The selection of one Memacs module (e.g., about photos) currently yields the installation of all Memacs modules. Because the functionality was implemented by you, may you look on this again; perhaps it is just a detail you spot immediately to improve Memacs once again. Thank you!

@sanzoghenzo
Copy link
Contributor

sanzoghenzo commented Jul 15, 2022

Hi @nbehrnd ,
It's been a long time since I last used memacs, but this is what I got by a quick look:

  • my changes were done not to install specific modules, but to install the dependencies of said modules. To be able to do what you ask, the project needs to be split into multiple sub packages;
  • the right syntax for pip is pip install memacs[xxx] where xxx is the functionality that you whish to have the dependencies installed;
  • there's no such option as photos: I once added the extras_requre to setup.py to define the dependencies of the modules that existed at that time, if new modules with external dependencies were created, they should have been added to the extras_require dictionary.

so, to fix this specific case:

  • add "photos": ["Pillow"], to the extras_require dict in setup.py
  • install memacs with pip install memacs[photos]

You will still see all the commands, but at least you only install the photos depencencies

@novoid
Copy link
Owner

novoid commented Jul 17, 2022

I'll close this issue here as it seems to be a duplicate of #74

Feel free to continue discussing there.

@novoid novoid closed this as completed Jul 17, 2022
@novoid novoid changed the title suggest revision installation via pip, module selection implement sub-packages to install only selected module dependencies Jul 20, 2022
@novoid
Copy link
Owner

novoid commented Jul 20, 2022

After realizing the suggested change (see above and #74 (comment)) I reopen this issue because it actually introduces an in-between step between the current situation (Memacs as one single big blob) and Memacs split up into separate repositories.

By being able to install the dependencies of selected modules, users are able to keep their setup footprint small in comparison to "setup every dependency at once".

@novoid novoid reopened this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants