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

Use correct CLI entrypoint #146

Merged
merged 3 commits into from Oct 25, 2022
Merged

Conversation

charlesbluca
Copy link
Member

@charlesbluca charlesbluca commented Oct 25, 2022

Closes #145
Closes #144
Fixes dask/distributed#7176

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@charlesbluca
Copy link
Member Author

@conda-forge-admin, please rerender

@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub actions workflow run https://github.com/conda-forge/dask-core-feedstock/actions/runs/3322902694.

@charlesbluca charlesbluca mentioned this pull request Oct 25, 2022
1 task
@douglasdavis
Copy link
Member

douglasdavis commented Oct 25, 2022

Perhaps we should use dask.__main__:main as the entry point, because that's the one used in the pip(setuptools) installation.

The dask.__main__:main entry point was created to allow for the Click-not-installed error message. Is Click always installed when dask is installed via conda-forge?

Comment on lines +38 to +40
- dask docs --help
- dask info --help
- dask info versions --help
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing because the CLI requires click; are we okay with adding click as a core dependency for the Dask conda packages? Or are these tests better suited for the dask metapackage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes think that is reasonable

We should then also added it to Dask's setup.py and the nightly package

Would reuse Distributed click >=6.6 requirement

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially suggested adding click as a required dependency of dask (pip) / dask-core (conda) but there was some push back against that. I personally don't have strong thoughts one way or the other. I agree we should have these. We currently have these types of checks over in the dask-feedstock due to the current places that click is installed

Copy link
Member

@jakirkham jakirkham Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah think we still want some kind of check in this feedstock to make sure the entry point added here works

We could just add click to test/requires as is done with pip below

That said, I think not including click as a requirement in Dask itself while adding entry points is a subpar user experience. Think we should bring this up again and point back to this issue (and its resolution) as a reason to change it

@charlesbluca
Copy link
Member Author

The dask.main:main entry point was created to allow for the Click-not-installed error message.

Was going to ask about this, as it seems like this error handling is implemented in cli.py as well, so wasn't sure if dask.__main__ was redundant now?

Is Click always installed when dask is installed via conda-forge?

It's not, we would need to make changes to the core dependencies if we wanted Dask's CLI to work out of the box after installing dask-core, see #146 (comment)

@jakirkham
Copy link
Member

cc @jrbourbeau

@douglasdavis
Copy link
Member

so wasn't sure if dask.__main__ was redundant now?

dask.__main__ isn't redundant because we want to allow folks to use $ python -m dask. The error message in dask.__main__ is there for folks who try to run $ dask or $ python -m dask, while the error message in dask.cli is there for folks who try to import dask.cli.

@charlesbluca
Copy link
Member Author

charlesbluca commented Oct 25, 2022

Thanks for the context @douglasdavis 😄 in that case, using dask.__main__:main as the entrypoint seems to make the most sense here.

Some follow up questions:

  1. how do we want to handle the click requirement since it's not specified in either dask-core or dask? We could just add it to the runtime requirements, though I notice it doesn't seem to be specified anywhere in the setup.py of dask-core
  2. do we want to install the entrypoints as part of dask-core, dask, or both? My preference would be dask-core only, as that's where the CLI code resides and I can imagine situations where a user would want the CLI from dask-core without installing distributed
  3. do we know why these distributed feedstock tests seemed to pass despite the fact that the distributed CLI wasn't working locally?

@douglasdavis
Copy link
Member

douglasdavis commented Oct 25, 2022

  1. how do we want to handle the click requirement since it's not specified in either dask-core or dask? We could just add it to the runtime requirements, though I notice it doesn't seem to be specified anywhere in the setup.py of dask-core

In the CLI PR we decided not to make Click a hard dependency. It seems that it may be easiest to just make it a dependency. I think an alternative is we can make it a dependency of dask-feedstock and not dask-core-feedstock. Nevermind, distributed already depends on Click and dask-feedstock depends on distributed!

  1. do we want to install the entrypoints as part of dask-core, dask, or both? My preference would be dask-core only, as that's where the CLI code resides and I can imagine situations where a user would want the CLI from dask-core without installing distributed

It looks like I shouldn't have opened conda-forge/dask-feedstock#200 - based on what @jrbourbeau and @jakirkham were doing I think the the entry point should be part of dask-core-feedstock?

@douglasdavis
Copy link
Member

3. do we know why these distributed feedstock tests seemed to pass despite the fact that the distributed CLI wasn't working locally?

The only thing I can think of is maybe the command still returned exit code 0

@jakirkham
Copy link
Member

It was doing that at the time. Maybe because of these?

Don't see that behavior with recent packages (that dropped those)

$ dask scheduler ; echo $?
Usage: dask [OPTIONS] COMMAND [ARGS]...
Try 'dask -h' for help.

Error: No such command 'scheduler'.
2

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all for digging in here!

Folks seem to think dask = dask.cli:run_cli is the right thing to do here. I'm inclined to remove the dask docs --help tests for the time being (we have some coverage still as those are included as test in dask-feedstock) to see if the entypoint update fixes things. Adding click as a dask-core dependency seems like a relevant, but separate, conversation. Thoughts?

@jakirkham
Copy link
Member

As noted above, think if we are adding an entry point here (especially given the issues we have had around it), we should have a test here as well. In terms of click we can add it to test/requires if it is controversial to make it a hard requirement

@douglasdavis
Copy link
Member

douglasdavis commented Oct 25, 2022

@jrbourbeau I agree with your inclination (kick the can down the road on the Click dep w.r.t this PR, but at this point I would say for the upcoming release I think it's a good idea to just have a Click dep).

I'll also add that I think dask.__main__:main is the better entry point (consistency with dask's setup.cfg and it keeps $ dask and $ python -m dask identical)

@charlesbluca
Copy link
Member Author

It was doing that at the time. Maybe because of these?

This is a passing run triggered by the removal of those entrypoints, so think it might be something else.

I'm generally in favor of @jakirkham's suggestion to add click to the test requirements for the time being so we at least have some security that the entrypoints are working properly, and @douglasdavis's suggestion to do with dask.__main__:main as the entrypoint for sake of consistency. Not sure if there have been internal conversations leaning towards dask.cli:run_cli though @jrbourbeau 🙂

@jakirkham
Copy link
Member

@conda-forge-admin, please re-render

@jakirkham
Copy link
Member

(oops missed re-rendering was already done above 🤦‍♂️)

@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub actions workflow run https://github.com/conda-forge/dask-core-feedstock/actions/runs/3323505831.

Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks all! 🙏

@jrbourbeau jrbourbeau merged commit 0c9c6bb into conda-forge:main Oct 25, 2022
@jrbourbeau
Copy link
Member

Just tried out the new build and dask scheduler is working as expected 🎉 thanks again @charlesbluca @douglasdavis @jakirkham!

@jakirkham
Copy link
Member

Nice! Also working for me 🎉

Think we will want to add these changes to the dask-core nightly as well

Am looking into making click a hard requirement ( dask/dask#9595 )

@jakirkham
Copy link
Member

click became a hard requirement in the recent release ( #147 )

Dropping click from test/requires in PR ( #148 )

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