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

Can 'docopt' be installed when this package is installed? #88

Closed
DaveParr opened this issue Jan 8, 2020 · 5 comments
Closed

Can 'docopt' be installed when this package is installed? #88

DaveParr opened this issue Jan 8, 2020 · 5 comments

Comments

@DaveParr
Copy link

DaveParr commented Jan 8, 2020

Thanks, this is actually just what I was looking for.

Ran into a small bump on install:

I ran:

remotes::install_github("lorenzwalthert/precommit")

then added this to a pre-existing .pre-commit-config.yaml (I'm actually using this to extend a project that has both R and Python and is already also using pre-commit)

-   repo: https://github.com/lorenzwalthert/precommit
    rev: v0.0.0.9027
    hooks: 
    -   id: style-files

Which on run of pre-commit from the terminal gave:

style-files..............................................................Failed
hookid: style-files

Error in loadNamespace(name) : there is no package called ‘docopt’

I was easily able to correct for this after running install.packages("docopt"), but is it possible to add this to the imports or similar so it's already sorted? but it appears it's already in the imports section. Maybe it needs to be in depends?

@lorenzwalthert
Copy link
Owner

That's indeed strange. I thought {remotes} would also install all dependencies. No, I think Imports: is right, I don't think Depends: is the right field for almost any dependency.

@DaveParr
Copy link
Author

DaveParr commented Jan 9, 2020

Sure, no problem. Close if you think best, thanks for the work and for getting back to me.

@DaveParr DaveParr closed this as completed Jan 9, 2020
@scottgigante
Copy link

I don't think it's a problem with Depends vs Imports, but this is definitely a problem.

 style-files..............................................................Failed
- hook id: style-files
- exit code: 1

Error: Error in loadNamespace(name) : there is no package called ‘docopt’

https://github.com/singlecellopenproblems/SingleCellOpenProblems/runs/2042401231?check_suite_focus=true#step:7:60

scottgigante added a commit to openproblems-bio/openproblems that referenced this issue Mar 5, 2021
@scottgigante
Copy link

I just saw this cautionary note in the docs: https://lorenzwalthert.github.io/precommit/index.html#caution

I think the right solution here is to give a clearer error message that dependencies should be installed manually, and list the relevant deps for each hook.

@lorenzwalthert
Copy link
Owner

lorenzwalthert commented Mar 5, 2021

Thanks. We’ll hopefully get R support in pre-coming soon in pre-commit/pre-commit#1799 so I hope you understand I don’t bother to add better error messages for this case.

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

No branches or pull requests

3 participants