Skip to content

Cap Sphinx version to avoid issue with newer version#56

Merged
dmey merged 4 commits intomasterfrom
ci/sphinx
Apr 8, 2020
Merged

Cap Sphinx version to avoid issue with newer version#56
dmey merged 4 commits intomasterfrom
ci/sphinx

Conversation

@dmey
Copy link
Contributor

@dmey dmey commented Apr 7, 2020

Temporary workaround for:

Exception occurred:
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/sphinx/application.py", line 1069, in add_source_parser
    self.registry.add_source_parser(*args, **kwargs)
TypeError: add_source_parser() takes 2 positional arguments but 3 were given

@dmey dmey requested a review from didierthevenard April 7, 2020 19:34
@dmey
Copy link
Contributor Author

dmey commented Apr 8, 2020

@hongyuanjia I am getting an issue with R on the CI (please see https://travis-ci.com/github/psychrometrics/psychrolib/jobs/316453651#L4373-L4376). Do you know how to fix this?

@hongyuanjia
Copy link
Contributor

This is caused that we did not commit the NAMESPACE file, which makes Rcpp confused and it thinks that it was not inside an R package. See r-lib/devtools#1599 and https://github.com/RcppCore/Rcpp/blob/a83163943bcbbafc91f66cac72ff8f7bab790730/R/Attributes.R#L425-L430.

I am not sure why NAMESPACE was not automatically generated by devtools::document() and I cannot reproduce this error on local repo.

@dmey
Copy link
Contributor Author

dmey commented Apr 8, 2020

It looks like the real reason for the failure is actually due to ‘shiny’’: https://travis-ci.com/github/psychrometrics/psychrolib/jobs/316453651#L3762. Great error reporting in R, I am surprised that builds continue even when individual packages fail to build.

@hongyuanjia
Copy link
Contributor

No. I don't think so. The reason htmlwidgets package is to be installed is that we specify dependencies = TRUE when installing devtools, which will also install packages listed in Suggests in devtools' DESCRIPTION. Those packages are not directly required by the core functionalities of devtools and are mainly used for testing devtools itself. It is safe to remove them for our purpose. And the reason why shiny is failed to install and does not cause the build to fail is that shiny is only listed as Enhances in htmlwidgets and will not be caught by the option dependencies = TRUE, which equals to c("Depends", "Imports", "LinkingTo", "Suggests"). Thus failed to find shiny package will not cause htmlwidgets package to fail to install.

The root of the failure still lies in missing NAMESPACE file before devtools::document(). After manually creating NAMESPACE, the error is gone.

.travis.yml Outdated
before_install:
- Rscript -e 'install.packages("devtools", dependencies = TRUE)'
- cd $TRAVIS_BUILD_DIR/src/r
- touch NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

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

Also since we did not commit RcppExports.R, when fresh installing, devtools::document() sometimes will not run Rcpp::compileAttributes() to automatically create it. It is safe to call it after devtools::document().

@hongyuanjia
Copy link
Contributor

See PR #58

@dmey dmey merged commit f3a2891 into master Apr 8, 2020
@dmey dmey deleted the ci/sphinx branch April 8, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants