Skip to content

Commit

Permalink
chore: Don't throw error in 'detect_python()'
Browse files Browse the repository at this point in the history
* No longer throw error in 'detect_python()' so
  R CMD check doesn't fail on CRAN environments missing
  Python system dependency i.e. 'r-devel-windows-x86_64-gcc10-UCRT'.
  • Loading branch information
trevorld committed Sep 7, 2021
1 parent 202aa82 commit 5d2bfda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: argparse
Type: Package
Title: Command Line Optional and Positional Argument Parser
Version: 2.1.0
Version: 2.1.1
Authors@R: c(person("Trevor L", "Davis", role=c("aut", "cre"), email="[email protected]"),
person("Allen", "Day", role="ctb", comment="Some documentation and examples ported from the getopt package."),
person("Python Software Foundation", role="ctb", comment="Some documentation from the optparse Python module."),
Expand Down
5 changes: 2 additions & 3 deletions R/argparse.R
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ assert_python_cmd <- function(python_cmd) {
}

detects_python <- function() {
python_cmd <- find_python_cmd()
findpython::is_python_sufficient(python_cmd,
required_modules = c("argparse", "json | simplejson"))
python_cmd <- try(find_python_cmd())
!inherits(python_cmd, "try-error")
}

# Internal function to find python cmd
Expand Down
4 changes: 4 additions & 0 deletions cran-comments.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Notes

* The examples and unit tests are now skipped if an appropriate
version of Python is not found as with the 'r-devel-windows-x86_64-gcc10-UCRT'
CRAN flavor.

* As in previous uploads while in a non-interactive session (i.e. in an
Rscript) if ``parse_args()`` observes a help flag it will print a usage
message and then call ``quit()``. Additionally if a user specifically adds
Expand Down

0 comments on commit 5d2bfda

Please sign in to comment.