novoid / Memacs

What did I do on February 14th 2007? Visualize your (digital) life in Org-mode
GNU General Public License v3.0
1.03k stars 66 forks source link

build: using extras_require and console_script entry point #100

Closed sanzoghenzo closed 4 years ago

sanzoghenzo commented 4 years ago

Dependencies are made optional using setuptools extras_require argument. Users can now install the package via pip install memacs[gps,rss]. To get all the functionality, use pip install memacs[all] During the dependencies analysis, imports were optimized using pycharm.

Scripts now have a main function that functions as console entry point; they're now specified as entry_points "console_scripts" to be cross-platform compatible.

I also moved from "scripts" to "console_scripts" because setuptools documentation states that, after specifying the "extra" required for an entry point,

an appropriate error message can be displayed if the needed package(s) are missing

Unfortunately I wasn't able to reproduce this behavior, the scripts are all installed and running them doesn't result in the display message.

novoid commented 4 years ago

Wow, this is truly awesome. Thank you very much for this. I'll create the package soon.

novoid commented 4 years ago

Hi @sanzoghenzo, I tried to find some documentation that teaches me more on the pip install options you're mentioning. So far, I could not find anything on the [all] option or the [gps,rss] example you provided. For example, I wanted to learn what happens when the option is omitted. Is this the same as with [all] or does this install just the main framework without the modules? If you do have an URL for me, I'd be very happy so that I am able to document it properly in the README file.

sanzoghenzo commented 4 years ago

hi @novoid , here the relevant part of the official setuptools documentation.

As the paragraph says,

These requirements will not be automatically installed unless [...] the extras were listed in a requirement spec on the “pip install” command line.

So you have to use pip install memacs[all] if you want to install everything.

Note that memacs is always installed with all the modules, the dependences are those that can be installed (or not) via the extras declaration.

novoid commented 4 years ago

Thanks for clarification - so the README is correct as it is for now.

Note that memacs is always installed with all the modules, the dependences are those that can be installed (or not) via the extras declaration.

Damn. I was not choosing the right words for my question although I knew it's about dependencies. Thanks for the correction and your help. Very much appreciated!