[ https://issues.apache.org/jira/browse/CASSANDRA-17914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17742033#comment-17742033 ]
Brandon Williams edited comment on CASSANDRA-17914 at 7/13/23 4:30 PM: ----------------------------------------------------------------------- We got this sorted out on slack, and I've rebased/squashed these branches: ||Branch||CI|| |[4.0|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-4.0]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1126/workflows/5e46e9da-a131-4c07-bec8-3a01308903dd], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1126/workflows/26f91c7c-5e2c-4ef8-8869-50b421a88a83]| |[4.1|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-4.1]| [j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/63a385c3-2378-4b35-a37c-68cc54f2d2e0], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/a8d74f5d-5700-4a7e-a988-28d457263e04]| |[trunk|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-trunk]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1125/workflows/e82b8d49-4e2f-4c42-9532-1a9f53a19231], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1125/workflows/5159b99b-cdc2-41b4-8fb3-4ca51b91b8ce]| was (Author: brandon.williams): We got this sorted out on slack, and I've rebased/squashed these branches: ||Branch||CI|| |[4.0|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-4.0]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1126/workflows/5e46e9da-a131-4c07-bec8-3a01308903dd], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1126/workflows/26f91c7c-5e2c-4ef8-8869-50b421a88a83]| |[4.1|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-4.1]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/82172bf7-4f07-4dac-a81c-3c361f0b2b3a], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/133fb9d3-6de5-43b6-b62e-957fef7e1a26], [j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/63a385c3-2378-4b35-a37c-68cc54f2d2e0], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1127/workflows/a8d74f5d-5700-4a7e-a988-28d457263e04]| |[trunk|https://github.com/driftx/cassandra/tree/CASSANDRA-17914-trunk]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1125/workflows/e82b8d49-4e2f-4c42-9532-1a9f53a19231], [j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1125/workflows/5159b99b-cdc2-41b4-8fb3-4ca51b91b8ce]| > 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