[ https://issues.apache.org/jira/browse/CASSANDRA-17914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17738083#comment-17738083 ]
Stefan Miklosovic edited comment on CASSANDRA-17914 at 6/28/23 12:27 PM: ------------------------------------------------------------------------- I run Jenkins CI and I see some failures (1) There are some python code compliance issues, I am not sure about the rest, we can rerun the job when compliance issues are addressed. You can do this to reproduce: pycodestyle --ignore E501,E402,E731,W503 pylib/cqlshlib/*.py bin/cqlsh.py (1) https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2525/#showFailuresLink was (Author: smiklosovic): I run Jenkins CI and I see some failures (1) There are some python code compliance issues, I am not sure about the rest, we can rerun the job when compliance issues are addressed. (1) https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2525/#showFailuresLink > Argparse migration as the Python Optparse library is deprecated > --------------------------------------------------------------- > > Key: CASSANDRA-17914 > URL: https://issues.apache.org/jira/browse/CASSANDRA-17914 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter > Reporter: Brad Schoening > Assignee: Vineet Gali > Priority: Normal > > [Deprecated since version 2.7: The optparse module is deprecated and will not > be developed further; development will continue with the argparse > module.|https://docs.python.org/2/library/optparse.html] > Argparse is described in [PEP 389 – argparse - New Command Line Parsing > Module|https://peps.python.org/pep-0389/] > > A partial upgrade path from > [{{optparse}}|https://docs.python.org/3/library/optparse.html#module-optparse] > to > [{{argparse}}|https://docs.python.org/3/library/argparse.html#module-argparse]: > https://docs.python.org/3/library/argparse.html#upgrading-optparse-code > * Replace all > [{{optparse.OptionParser.add_option()}}|https://docs.python.org/3/library/optparse.html#optparse.OptionParser.add_option] > calls with > [{{ArgumentParser.add_argument()}}|https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument] > calls. > * Replace {{(options, args) = parser.parse_args()}} with {{args = > parser.parse_args()}} and add additional > [{{ArgumentParser.add_argument()}}|https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument] > calls for the positional arguments. Keep in mind that what was previously > called {{{}options{}}}, now in the > [{{argparse}}|https://docs.python.org/3/library/argparse.html#module-argparse] > context is called {{{}args{}}}. > * Replace > [{{optparse.OptionParser.disable_interspersed_args()}}|https://docs.python.org/3/library/optparse.html#optparse.OptionParser.disable_interspersed_args] > by using > [{{parse_intermixed_args()}}|https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_intermixed_args] > instead of > [{{parse_args()}}|https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_args]. > * Replace callback actions and the {{callback_*}} keyword arguments with > {{type}} or {{action}} arguments. > * Replace string names for {{type}} keyword arguments with the corresponding > type objects (e.g. int, float, complex, etc). > * Replace {{optparse.Values}} with > [{{Namespace}}|https://docs.python.org/3/library/argparse.html#argparse.Namespace] > and {{optparse.OptionError}} and {{optparse.OptionValueError}} with > {{{}ArgumentError{}}}. > * Replace strings with implicit arguments such as {{%default}} or {{%prog}} > with the standard Python syntax to use dictionaries to format strings, that > is, {{%(default)s}} and {{{}%(prog)s{}}}. > * Replace the OptionParser constructor {{version}} argument with a call to > {{{}parser.add_argument('--version', action='version', version='<the > version>'){}}}. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org