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

build: using extras_require and console_script entry point #100

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

sanzoghenzo
Copy link
Contributor

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.

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]`
Scripts now have a main function that functions as console entry point;
they're now specified as entry_points "console_scripts" with any optional dependency.
During the dependencies analysis, imports were optimized using pycharm.
@novoid novoid merged commit d094c97 into novoid:master Jun 5, 2020
@novoid
Copy link
Owner

novoid commented Jun 5, 2020

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

@novoid
Copy link
Owner

novoid commented Jun 5, 2020

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
Copy link
Contributor Author

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
Copy link
Owner

novoid commented Jun 6, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants