-
Notifications
You must be signed in to change notification settings - Fork 11
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
parse_known_intermixed_args()
tests failing on CRAN's Debian GNU/Linux testing machines
#53
Comments
|
library("argparse")
parser <- ArgumentParser()
parser$add_argument('--foo')
parser$add_argument('cmd')
parser$add_argument('rest', nargs='*', type='integer')
args <- strsplit('doit 1 --foo bar 2 3 -n 4', ' ')[[1]]
a_r <- parser$parse_known_intermixed_args(args) Locally with Python v3.12.7 I see > a_r
[[1]]
[[1]]$foo
[1] "bar"
[[1]]$cmd
[1] "doit"
[[1]]$rest
[1] 1 2 3
[[2]]
[1] "-n" "4" While in > a_r
[[1]]
[[1]]$foo
[1] "bar"
[[1]]$cmd
[1] "doit"
[[1]]$rest
[1] 1 2 3 4
[[2]]
[1] "-n" |
Can see a difference in behaviour with underlying Python 3.12.7: from argparse import ArgumentParser
import sys
parser = ArgumentParser()
parser.add_argument("--foo")
parser.add_argument("cmd")
parser.add_argument("rest", nargs="*", type=int)
args = ["doit", "1", "--foo", "bar", "2", "3", "-n", "4"]
a_r = parser.parse_known_intermixed_args(args)
print(a_r)
print(sys.version) When run locally in Python 3.12.7: (Namespace(foo='bar', cmd='doit', rest=[1, 2, 3]), ['-n', '4'])
3.12.7 (main, Nov 16 2024, 08:02:39) [GCC 11.4.0] When run in (Namespace(foo='bar', cmd='doit', rest=[1, 2, 3, 4]), ['-n'])
3.12.7 (main, Nov 8 2024, 17:55:36) [GCC 14.2.0] |
Weird, if I download the source for 3.12.7 in (Namespace(foo='bar', cmd='doit', rest=[1, 2, 3]), ['-n', '4'])
3.12.7 (main, Nov 16 2024, 20:18:07) [GCC 14.2.0] |
I've reported the bug to Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087681 |
parse_intermixed_args()
tests failing on CRAN's Debian GNU/Linux testing machinesparse_known_intermixed_args()
tests failing on CRAN's Debian GNU/Linux testing machines
* Skips two `parse_known_intermixed_args()` tests on CRAN on Debian Testing to avoid raising an ERROR due to a bug in Debian Testing's version of python: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087681 closes #53
Apologies for not giving a better explanation on Debian BTS, but this is not only a Debian problem. The new |
@aitap Thanks for the follow-up! |
* Tweaks the `parse_known_intermixed_args()` tests so they work with the development version of Python. closes #53
CRAN writes:
parse_known_intermixed_args()
tests are failing on CRAN's Debian GNU/Linux testing machinesparse_known_intermixed_args()
. Will need to install a newer version of Python and check.The text was updated successfully, but these errors were encountered: